Skip to content

Commit

Permalink
Show action dashboard columns for start and end date
Browse files Browse the repository at this point in the history
  • Loading branch information
bbliem committed Oct 24, 2024
1 parent acb091f commit cea6f58
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 146 deletions.
322 changes: 176 additions & 146 deletions common/__generated__/graphql.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions common/__generated__/possible_types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions components/dashboard/dashboard.constants.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import dayjs from 'common/dayjs';
import React, { ReactNode } from 'react';

import { PlanContextFragment } from 'common/__generated__/graphql';
Expand Down Expand Up @@ -181,6 +182,23 @@ export const COLUMN_CONFIG: { [key in ColumnBlock]: Column } = {
<LastUpdatedTooltipContent action={action} />
),
},

StartDateColumnBlock: {
sortable: true,
headerKey: 'startDate',
renderHeader: (t, _, label) => label || t('action-start-date'),
renderCell: (action) =>
action.startDate != null && dayjs(action.startDate).format('l'),
},

EndDateColumnBlock: {
sortable: true,
headerKey: 'endDate',
renderHeader: (t, _, label) => label || t('action-end-date'),
renderCell: (action) =>
action.endDate != null && dayjs(action.endDate).format('l'),
},

FieldColumnBlock: {
renderHeader: (t, _, label) => label,
renderCell: (action, _, __, attributeType) => {
Expand Down
6 changes: 6 additions & 0 deletions fragments/action-list.fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ export const ACTION_TABLE_COLUMN_FRAGMENT = gql`
... on UpdatedAtColumnBlock {
columnLabel
}
... on StartDateColumnBlock {
columnLabel
}
... on EndDateColumnBlock {
columnLabel
}
... on OrganizationColumnBlock {
columnLabel
}
Expand Down
2 changes: 2 additions & 0 deletions locales/de/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"actions-show-continuous": "Nur laufende Maßnahmen anzeigen",
"action-description": "Beschreibung",
"action-description-official": "Offizielle Beschreibung",
"action-end-date": "Ende",
"action-id": "ID",
"action-identifier": "Kennung",
"action-impact": "Auswirkung",
Expand All @@ -18,6 +19,7 @@
"action-previous": "{context, select, STRATEGY {Vorherige Strategie} CASE_STUDY {Vorherige Fallstudie} other {Vorherige Maßnahme}}",
"action-progress": "Fortschritt",
"action-responsibles-short": "Verantwortliche",
"action-start-date": "Beginn",
"action-status-merged": "{context, select, STRATEGY {Zusammengeführt mit Strategie} CASE_STUDY {Zusammengeführt mit Fallstudie} other {Zusammengeführt mit Maßnahme}}",
"action-status-updates": "Letzte Aktualisierungen",
"action-task-done": "Erledigt",
Expand Down
2 changes: 2 additions & 0 deletions locales/en/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"actions-show-continuous": "Show only continuous actions",
"action-description": "Description",
"action-description-official": "Official description",
"action-end-date": "End",
"action-id": "ID",
"action-identifier": "Identifier",
"action-impact": "Impact",
Expand All @@ -18,6 +19,7 @@
"action-previous": "{context, select, CASE_STUDY {Previous case study} STRATEGY {Previous strategy} other {Previous action}}",
"action-progress": "Progress",
"action-responsibles-short": "Responsible parties",
"action-start-date": "Start",
"action-status-merged": "{context, select, CASE_STUDY {Merged with case study} STRATEGY {Merged with strategy} other {Merged with action}}",
"action-status-updates": "Latest updates",
"action-task-done": "Done",
Expand Down

0 comments on commit cea6f58

Please sign in to comment.