Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show action dashboard columns for start and end date #423

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading