Added new note to the job details screen.
This commit is contained in:
@@ -15,17 +15,36 @@ export default function JobNotesComponent({
|
||||
const [noteModalVisible, setNoteModalVisible] = useState(false);
|
||||
const [existingNote, setExistingNote] = useState(null);
|
||||
const columns = [
|
||||
{
|
||||
title: "",
|
||||
dataIndex: "icons",
|
||||
key: "icons",
|
||||
width: 80,
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{" "}
|
||||
{record.critical ? (
|
||||
<Icon style={{ margin: 4, color: "red" }} type='warning' />
|
||||
) : null}
|
||||
{record.private ? (
|
||||
<Icon style={{ margin: 4 }} type='eye-invisible' />
|
||||
) : null}
|
||||
</span>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t("notes.fields.text"),
|
||||
dataIndex: "text",
|
||||
key: "text",
|
||||
ellipsis: true
|
||||
},
|
||||
|
||||
{
|
||||
title: t("notes.fields.updatedat"),
|
||||
dataIndex: "updated_at",
|
||||
key: "updated_at",
|
||||
defaultSortOrder: "descend",
|
||||
width: 200,
|
||||
sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at),
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
@@ -36,12 +55,14 @@ export default function JobNotesComponent({
|
||||
{
|
||||
title: t("notes.fields.createdby"),
|
||||
dataIndex: "created_by",
|
||||
key: "created_by"
|
||||
key: "created_by",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: t("notes.actions.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
width: 150,
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Button
|
||||
@@ -80,6 +101,13 @@ export default function JobNotesComponent({
|
||||
refetch={refetch}
|
||||
existingNote={existingNote}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setExistingNote(null);
|
||||
setNoteModalVisible(true);
|
||||
}}>
|
||||
{t("notes.actions.new")}
|
||||
</Button>
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={{ position: "bottom" }}
|
||||
|
||||
Reference in New Issue
Block a user