Skip to content

Commit

Permalink
feat(date): allow dates to be sorted and add dates to analysis table
Browse files Browse the repository at this point in the history
  • Loading branch information
brucetony committed Aug 29, 2024
1 parent 1212d42 commit 9cdcd7f
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 21 deletions.
28 changes: 27 additions & 1 deletion components/analysis/AnalysesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SearchBar from "~/components/table/SearchBar.vue";
const expandedRows = ref();
const analyses = ref();
const expandRowEntries = ["project_id", "node_id", "created_at", "updated_at"];
const expandRowEntries = ["project_id", "node_id"];
const { data: response, status, error } = await getAnalysisNodes();
Expand Down Expand Up @@ -119,6 +119,32 @@ const updateFilters = (filterText: string) => {
header="Project"
:sortable="true"
/>
<Column
header="Created On"
field="created_at.long"
filterField="created_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.created_at.long">
{{ data.created_at.short }}
</p>
</template>
</Column>
<Column
header="Last Updated"
field="updated_at.long"
filterField="updated_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.updated_at.long">
{{ data.updated_at.short }}
</p>
</template>
</Column>
<Column field="node.name" header="Node" :sortable="true" />
<Column
field="expand.id"
Expand Down
2 changes: 2 additions & 0 deletions components/data-stores/tables/DetailedAnalysisTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ const updateFilters = (filterText: string) => {
></Column>
<Column
header="Created On"
field="kongProjCreatedAt.long"
filterField="kongAnalysisCreatedAt.long"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.kongAnalysisCreatedAt.long">
Expand Down
23 changes: 20 additions & 3 deletions components/data-stores/tables/DetailedDataStoreTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,36 @@ const updateFilters = (filterText: string) => {
/>
</div>
</template>
<Column field="name" header="Name" :sortable="true"></Column>
<Column
field="name"
header="Name"
:sortable="true"
style="width: 30rem"
></Column>
<Column field="path" header="Path"></Column>
<Column field="host" header="Host" :sortable="true"></Column>
<Column field="port" header="Port"></Column>
<Column field="protocol" header="Protocol" :sortable="true"></Column>
<Column header="Created On" filterField="created_at.long" dataType="date">
<Column
header="Created On"
field="created_at.long"
filterField="created_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.created_at.long">
{{ data.created_at.short }}
</p>
</template>
</Column>
<Column header="Last Updated" filterField="date" dataType="date">
<Column
header="Last Updated"
field="updated_at.long"
filterField="updated_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.updated_at.long">
{{ data.updated_at.short }}
Expand Down
8 changes: 6 additions & 2 deletions components/data-stores/tables/DetailedProjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ const updateFilters = (filterText: string) => {
<Column field="dataStore" header="Data Store" :sortable="true"></Column>
<Column
header="Created On"
filterField="kongProjCreatedAt.short"
field="kongProjCreatedAt.long"
filterField="kongProjCreatedAt.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.kongProjCreatedAt.long">
Expand All @@ -171,8 +173,10 @@ const updateFilters = (filterText: string) => {
</Column>
<Column
header="Last Updated"
filterField="kongProjUpdatedAt.short"
field="kongProjUpdatedAt.long"
filterField="kongProjUpdatedAt.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.kongProjUpdatedAt.long">
Expand Down
41 changes: 28 additions & 13 deletions components/projects/ProjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ if (status.value === "success") {
// Table filters
const defaultFilters = {
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
"created_at.short": { value: null, matchMode: FilterMatchMode.DATE_IS },
"updated_at.short": { value: null, matchMode: FilterMatchMode.DATE_IS },
"created_at.date": {
value: null,
matchMode: FilterMatchMode.DATE_IS | FilterMatchMode.DATE_BEFORE,
},
"updated_at.date": { value: null, matchMode: FilterMatchMode.DATE_IS },
};
const filters = ref(defaultFilters);
Expand Down Expand Up @@ -72,27 +75,39 @@ const updateFilters = (filterText: string) => {
/>
</div>
</template>
<Column field="name" header="Name" :sortable="true"></Column>
<Column
field="name"
header="Name"
:sortable="true"
style="width: 30rem"
></Column>
<Column
header="Created On"
filterField="created_at.long"
field="created_at.long"
filterField="created_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.created_at.long">
{{ data.created_at.short }}
</p>
</template>
<template #filter="{ filterModel }">
<Calendar
v-model="filterModel.value"
dateFormat="dd.mm.yyyy"
placeholder="dd.mm.yyyy"
mask="99/99/9999"
/>
</template>
<!-- <template #filter="{ filterModel }">-->
<!-- <Calendar-->
<!-- v-model="filterModel.value"-->
<!-- dateFormat="dd.mm.yyyy"-->
<!-- placeholder="dd.mm.yyyy"-->
<!-- />-->
<!-- </template>-->
</Column>
<Column header="Last Updated" filterField="date" dataType="date">
<Column
header="Last Updated"
field="updated_at.long"
filterField="updated_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.updated_at.long">
{{ data.updated_at.short }}
Expand Down
12 changes: 10 additions & 2 deletions components/projects/ProposalTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,24 @@ const updateFilters = (filterText: string) => {
></Column>
<Column
header="Created On"
filterField="created_at.long"
field="created_at.long"
filterField="created_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.created_at.long">
{{ data.created_at.short }}
</p>
</template>
</Column>
<Column header="Last Updated" filterField="date" dataType="date">
<Column
header="Last Updated"
field="updated_at.long"
filterField="updated_at.date"
dataType="date"
:sortable="true"
>
<template #body="{ data }">
<p v-tooltip.top="data.updated_at.long">
{{ data.updated_at.short }}
Expand Down

0 comments on commit 9cdcd7f

Please sign in to comment.