Skip to content

Commit

Permalink
Simplifies Accessing Current Properties on Editor Objects (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbdubs authored Jan 18, 2024
1 parent 8d8c66a commit b743bc9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions frontend/components/analysis/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
:value="editorObjects"
data-key="id"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/incompleteupload/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ const saveChanges = (id: string) => {
data-key="id"
class="w-full"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
Expand All @@ -115,7 +115,7 @@ const saveChanges = (id: string) => {
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>Created At</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
</div>
<!-- TODO(grady) add failure information here. -->
Expand Down
20 changes: 10 additions & 10 deletions frontend/components/portfolio/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
:value="editorObjects"
data-key="id"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<template #empty>
Expand All @@ -136,16 +136,16 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
</template>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
Expand All @@ -155,12 +155,12 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
<template #body="slotProps">
<div class="flex flex-column gap-2">
<div
v-if="slotProps.data.editorValues.value.groups.originalValue.length > 0"
v-if="slotProps.data.currentValue.value.groups.length > 0"
class="flex gap-1 align-items-center flex-wrap"
>
<span>{{ tt('Groups') }}:</span>
<LinkButton
v-for="membership in slotProps.data.editorValues.value.groups.originalValue"
v-for="membership in slotProps.data.currentValue.value.groups"
:key="membership.portfolioGroup.id"
class="p-button-outlined p-button-xs"
icon="pi pi-table"
Expand All @@ -169,12 +169,12 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
/>
</div>
<div
v-if="slotProps.data.editorValues.value.initiatives.originalValue.length > 0"
v-if="slotProps.data.currentValue.value.initiatives.length > 0"
class="flex gap-1 align-items-center flex-wrap"
>
<span>{{ tt('Initiatives') }}:</span>
<LinkButton
v-for="membership in slotProps.data.editorValues.value.initiatives.originalValue"
v-for="membership in slotProps.data.currentValue.value.initiatives"
:key="membership.initiative.id"
class="p-button-xs"
:label="membership.initiative.name"
Expand All @@ -200,11 +200,11 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>{{ tt('Created At') }}</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>{{ tt('Number of Rows') }}</span>
<b>{{ slotProps.data.editorValues.value.numberOfRows.originalValue }}</b>
<b>{{ slotProps.data.currentValue.value.numberOfRows }}</b>
</div>
</div>
<h2 class="mt-5">
Expand Down
12 changes: 6 additions & 6 deletions frontend/components/portfolio/group/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const saveChanges = (id: string) => {
)
}
const editorObjectToIds = (editorObject: EditorObject): string[] => {
return (editorObject.editorValues.value.members.originalValue ?? []).map((m: PortfolioGroupMembershipPortfolio) => m.portfolio.id)
return (editorObject.currentValue.value.members ?? []).map((m: PortfolioGroupMembershipPortfolio) => m.portfolio.id)
}
</script>

Expand Down Expand Up @@ -102,7 +102,7 @@ const editorObjectToIds = (editorObject: EditorObject): string[] => {
data-key="id"
class="w-full"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<template #empty>
Expand All @@ -112,17 +112,17 @@ const editorObjectToIds = (editorObject: EditorObject): string[] => {
</template>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
Expand Down Expand Up @@ -152,7 +152,7 @@ const editorObjectToIds = (editorObject: EditorObject): string[] => {
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>Created At</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
</div>
<h2 class="mt-5">
Expand Down
16 changes: 8 additions & 8 deletions frontend/pages/incomplete-uploads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ const deleteAll = () => withLoading(
class="incomplete-upload-table"
>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
header="Created At"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
header="Name"
/>
Expand All @@ -99,23 +99,23 @@ const deleteAll = () => withLoading(
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>Created At</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Ran At</span>
<b>{{ slotProps.data.editorValues.value.ranAt.originalValue ? humanReadableTimeFromStandardString(slotProps.data.editorValues.value.ranAt.originalValue).value : 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.ranAt ? humanReadableTimeFromStandardString(slotProps.data.currentValue.value.ranAt).value : 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Completed At</span>
<b>{{ slotProps.data.editorValues.value.completedAt.originalValue ? humanReadableTimeFromStandardString(slotProps.data.editorValues.value.completedAt.originalValue).value : 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.completedAt ? humanReadableTimeFromStandardString(slotProps.data.currentValue.value.completedAt).value : 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Failure Code</span>
<b>{{ slotProps.data.editorValues.value.failureCode.originalValue ?? 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.failureCode ?? 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Failure Message</span>
<b>{{ slotProps.data.editorValues.value.failureMessage.originalValue ?? 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.failureMessage ?? 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>ID</span>
Expand Down

0 comments on commit b743bc9

Please sign in to comment.