-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 862-reject_duplicate_submissions
# Conflicts: # kobo/apps/openrosa/libs/utils/logger_tools.py
- Loading branch information
Showing
47 changed files
with
1,541 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
jsapp/js/account/security/accessLogs/accessLogsSection.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Libraries | ||
import React from 'react'; | ||
|
||
// Partial components | ||
import Button from 'js/components/common/button'; | ||
import PaginatedQueryUniversalTable from 'js/universalTable/paginatedQueryUniversalTable.component'; | ||
|
||
// Utilities | ||
import useAccessLogsQuery, {type AccessLog} from 'js/query/queries/accessLogs.query'; | ||
import {formatTime} from 'js/utils'; | ||
import sessionStore from 'js/stores/session'; | ||
|
||
// Styles | ||
import securityStyles from 'js/account/security/securityRoute.module.scss'; | ||
|
||
export default function AccessLogsSection() { | ||
function logOutAllSessions() { | ||
sessionStore.logOutAll(); | ||
} | ||
|
||
return ( | ||
<> | ||
<header className={securityStyles.securityHeader}> | ||
<h2 className={securityStyles.securityHeaderText}> | ||
{t('Recent account activity')} | ||
</h2> | ||
|
||
{/* TODO: we comment this out until we know how to handle exsiting | ||
sessions for the moment of release of the feature. */} | ||
{/*<div className={securityStyles.securityHeaderActions}> | ||
<Button | ||
type='text' | ||
size='m' | ||
onClick={logOutAllSessions} | ||
label={t('Log out of all devices')} | ||
startIcon='logout' | ||
/> | ||
</div>*/} | ||
</header> | ||
|
||
<PaginatedQueryUniversalTable<AccessLog> | ||
queryHook={useAccessLogsQuery} | ||
columns={[ | ||
// The `key`s of these columns are matching the `AccessLog` interface | ||
// properties (from `accessLogs.query.ts` file) using dot notation. | ||
{key: 'metadata.source', label: t('Source')}, | ||
{ | ||
key: 'date_created', | ||
label: t('Last activity'), | ||
cellFormatter: (date: string) => formatTime(date), | ||
}, | ||
{key: 'metadata.ip_address', label: t('IP Address')}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.