generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] simplify User, Staff, Admin, Log & Enrollment types & mode…
…ls based on Back-end API v6 (#214)
- Loading branch information
Showing
38 changed files
with
433 additions
and
630 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
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 |
---|---|---|
@@ -1,25 +1,38 @@ | ||
import { ActivityLog } from '@kaiyuanshe/openhackathon-service'; | ||
import { ScrollListProps } from 'mobx-restful-table'; | ||
import { Badge, ListGroup } from 'react-bootstrap'; | ||
import { formatDate } from 'web-utility'; | ||
|
||
import { Log, LogModel } from '../../models/Activity/Log'; | ||
import { LogModel } from '../../models/Activity/Log'; | ||
|
||
export interface ActivityLogListProps extends ScrollListProps<Log> { | ||
export interface ActivityLogListProps extends ScrollListProps<ActivityLog> { | ||
store: LogModel; | ||
} | ||
|
||
export const OperationName = { | ||
create: 'Create', | ||
update: 'Update', | ||
delete: 'Delete', | ||
}; | ||
|
||
export const ActivityLogListLayout = ({ | ||
defaultData = [], | ||
}: Pick<ActivityLogListProps, 'defaultData'>) => ( | ||
<ListGroup as="ol" numbered> | ||
{defaultData.map(({ id, message, activityLogType }) => ( | ||
<ListGroup.Item | ||
key={id} | ||
as="li" | ||
className="d-flex justify-content-between align-items-center" | ||
> | ||
<div className="ms-2 me-auto">{message}</div> | ||
<Badge>{activityLogType}</Badge> | ||
</ListGroup.Item> | ||
))} | ||
{defaultData.map( | ||
({ id, createdAt, createdBy, operation, tableName, recordId }) => ( | ||
<ListGroup.Item | ||
key={id} | ||
as="li" | ||
className="d-flex justify-content-between align-items-center gap-2" | ||
> | ||
<time dateTime={createdAt}>{formatDate(createdAt)}</time> | ||
{createdBy.name} | ||
<Badge>{OperationName[operation]}</Badge> | ||
<code>{tableName}</code> | ||
{recordId} | ||
</ListGroup.Item> | ||
), | ||
)} | ||
</ListGroup> | ||
); |
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
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
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
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.
32243dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for open-hackathon ready!
✅ Preview
https://open-hackathon-274kxx0up-techquerys-projects.vercel.app
Built with commit 32243dd.
This pull request is being automatically deployed with vercel-action