forked from kbss-cvut/termit-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement kbss-cvut#520] Add change history filtering for term and…
… vocabulary details.
- Loading branch information
Showing
7 changed files
with
195 additions
and
57 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from "react"; | ||
import { FormattedDate, FormattedTime } from "react-intl"; | ||
import { Badge } from "reactstrap"; | ||
import { useI18n } from "../hook/useI18n"; | ||
import DeleteRecord from "../../model/changetracking/DeleteRecord"; | ||
|
||
export interface DeleteRowProps { | ||
record: DeleteRecord; | ||
} | ||
|
||
export const DeleteRow: React.FC<DeleteRowProps> = (props) => { | ||
const { i18n } = useI18n(); | ||
const record = props.record; | ||
const created = new Date(Date.parse(record.timestamp)); | ||
return ( | ||
<tr> | ||
<td> | ||
<div> | ||
<FormattedDate value={created} /> <FormattedTime value={created} /> | ||
</div> | ||
<div className="italics last-edited-message ml-2"> | ||
{record.author.fullName} | ||
</div> | ||
</td> | ||
<td> | ||
<Badge color="danger">{i18n(record.typeLabel)}</Badge> | ||
</td> | ||
<td /> | ||
<td /> | ||
<td /> | ||
</tr> | ||
); | ||
}; | ||
|
||
export default DeleteRow; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
import VocabularyUtils from "../../util/VocabularyUtils"; | ||
|
||
export interface VocabularyContentChangeFilterData { | ||
author: string; | ||
term: string; | ||
type: string; | ||
attribute: string; | ||
} | ||
|
||
export function getChangeTypeUri( | ||
filterData: VocabularyContentChangeFilterData | ||
): string { | ||
switch (filterData.type) { | ||
case "history.type.persist": | ||
return VocabularyUtils.PERSIST_EVENT; | ||
case "history.type.update": | ||
return VocabularyUtils.UPDATE_EVENT; | ||
case "history.type.delete": | ||
return VocabularyUtils.DELETE_EVENT; | ||
} | ||
return ""; | ||
} |