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] Vocabulary activity term changes filter b…
…ackend requests Removed time range input and implemented requesting data from BE using filter parameters.
- Loading branch information
Showing
9 changed files
with
278 additions
and
215 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
src/component/changetracking/VocabularyContentDeleteRow.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,37 @@ | ||
import * as React from "react"; | ||
import { FormattedDate, FormattedTime } from "react-intl"; | ||
import { Badge } from "reactstrap"; | ||
import { useI18n } from "../hook/useI18n"; | ||
import TermIriLink from "../term/TermIriLink"; | ||
import DeleteRecord from "../../model/changetracking/DeleteRecord"; | ||
|
||
export interface DeleteRowProps { | ||
record: DeleteRecord; | ||
} | ||
|
||
export const VocabularyContentDeleteRow: 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> | ||
<TermIriLink iri={record.changedEntity.iri} /> | ||
</td> | ||
<td> | ||
<Badge color="danger">{i18n(record.typeLabel)}</Badge> | ||
</td> | ||
<td></td> | ||
</tr> | ||
); | ||
}; | ||
|
||
export default VocabularyContentDeleteRow; |
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,22 @@ | ||
import ChangeRecord, { ChangeRecordData } from "./ChangeRecord"; | ||
import MultilingualString from "../MultilingualString"; | ||
|
||
export interface DeleteRecordData extends ChangeRecordData { | ||
label: MultilingualString; | ||
} | ||
|
||
/** | ||
* Represents insertion of an entity into the repository. | ||
*/ | ||
export default class DeleteRecord extends ChangeRecord { | ||
public readonly label: MultilingualString; | ||
public readonly vocabulary?: string; | ||
public constructor(data: DeleteRecordData) { | ||
super(data); | ||
this.label = data.label; | ||
} | ||
|
||
get typeLabel(): string { | ||
return "history.type.delete"; | ||
} | ||
} |
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,6 @@ | ||
export interface VocabularyContentChangeFilterData { | ||
author: string; | ||
term: string; | ||
type: string; | ||
attribute: string; | ||
} |
Oops, something went wrong.