Skip to content

Commit

Permalink
fix: add column header for table action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jorilindell committed Feb 19, 2024
1 parent 94bd52e commit ab088d8
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 18 deletions.
4 changes: 4 additions & 0 deletions src/common/components/table/table.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
width: 1%;
padding: var(--focus-outline-width) !important;
}

thead tr th:last-of-type {
@include hidden-from-screen;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/domain/app/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"yle": "YLE ID"
},
"common": {
"actions": "Actions",
"add": "Add",
"affiliate": "Affiliate",
"and": "and",
Expand Down
1 change: 1 addition & 0 deletions src/domain/app/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"part2": ", jos haluat tallentaa muutoksia."
},
"common": {
"actions": "Toiminnot",
"add": "Lisää",
"affiliate": "Liittyvä",
"and": "ja",
Expand Down
1 change: 1 addition & 0 deletions src/domain/app/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"part2": " för att spara dina ändringar."
},
"common": {
"actions": "Åtgärder",
"add": "Lägg till",
"affiliate": "Dotterbolag",
"and": "och",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const EventTimesTable: React.FC<EventTimesTableProps> = ({
<HeaderRow>
<th className={styles.indexColumn}>#</th>
<th>{t('event.form.labelTime')}</th>
<th className={styles.buttonColumn}></th>
<th>{t('common.actions')}</th>
</HeaderRow>
</thead>
<TableBody>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/events/eventsTable/EventsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const EventsTable: React.FC<EventsTableProps> = ({
<th className={styles.statusColumn}>
{t('eventsPage.eventsTableColumns.status')}
</th>
<th></th>
<th>{t('common.actions')}</th>
</HeaderRow>
</thead>
<TableBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ test('should render events table', () => {
'Alkuaika',
'Loppuaika',
'Status',
'Toiminnot',
];

for (const name of columnHeaders) {
Expand Down
1 change: 0 additions & 1 deletion src/domain/images/__tests__/ImagesPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import { mockedOrganizationAncestorsResponse } from '../../organization/__mocks__/organizationAncestors';
import { mockedUserResponse } from '../../user/__mocks__/user';
import {
imageNames,
images,
mockedImagesResponse,
mockedSortedImagesResponse,
Expand Down
2 changes: 1 addition & 1 deletion src/domain/images/imagesTable/ImagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const ImagesTable: React.FC<ImagesTableProps> = ({
},
{
key: 'actionButtons',
headerName: '',
headerName: t('common.actions'),
transform: ActionColumn,
},
]}
Expand Down
8 changes: 7 additions & 1 deletion src/domain/images/imagesTable/__tests__/ImagesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ const findImageRow = async (id: string) =>
test('should render images table', () => {
renderComponent();

const columnHeaders = ['Kuva', 'ID', 'Nimi', 'Viimeksi muokattu'];
const columnHeaders = [
'Kuva',
'ID',
'Nimi',
'Viimeksi muokattu',
'Toiminnot',
];

for (const name of columnHeaders) {
screen.getByRole('columnheader', { name });
Expand Down
1 change: 0 additions & 1 deletion src/domain/keywordSets/__tests__/KeywordSetsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import { mockedOrganizationAncestorsResponse } from '../../organization/__mocks__/organizationAncestors';
import { mockedUserResponse } from '../../user/__mocks__/user';
import {
keywordSetNames,
keywordSets,
mockedKeywordSetsResponse,
mockedSortedKeywordSetsResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const KeywordSetsTable: React.FC<KeywordSetsTableProps> = ({
},
{
key: 'actionButtons',
headerName: '',
headerName: t('common.actions'),
transform: ActionsColumn,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ beforeEach(() => {
mockAuthenticatedLoginState();
});

const keywordSetName = getValue(keywordSets.data[0]?.name?.fi, '');
const keywordSetId = getValue(keywordSets.data[0]?.id, '');

const defaultProps: KeywordSetsTableProps = {
Expand All @@ -46,7 +45,7 @@ const findKeywordSetRow = async (id: string) =>
test('should render keywords table', () => {
renderComponent();

const columnHeaders = ['ID', 'Nimi', 'Käyttötarkoitus'];
const columnHeaders = ['ID', 'Nimi', 'Käyttötarkoitus', 'Toiminnot'];

for (const name of columnHeaders) {
screen.getByRole('columnheader', { name });
Expand Down
1 change: 0 additions & 1 deletion src/domain/keywords/__tests__/KeywordsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import { mockedOrganizationAncestorsResponse } from '../../organization/__mocks__/organizationAncestors';
import { mockedUserResponse } from '../../user/__mocks__/user';
import {
keywordNames,
keywords,
mockedKeywordsResponse,
mockedSortedKeywordsResponse,
Expand Down
2 changes: 1 addition & 1 deletion src/domain/keywords/keywordsTable/KeywordsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const KeywordsTable: React.FC<KeywordsTableProps> = ({
},
{
key: 'actionButtons',
headerName: '',
headerName: t('common.actions'),
transform: ActionsColumn,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const findKeywordRow = async (id: string) =>
test('should render keywords table', async () => {
renderComponent();

const columnHeaders = ['ID', 'Nimi', 'Tapahtumien lkm'];
const columnHeaders = ['ID', 'Nimi', 'Tapahtumien lkm', 'Toiminnot'];

for (const name of columnHeaders) {
screen.getByRole('columnheader', { name });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const OrganizationsTable: React.FC<OrganizationsTableProps> = ({
setSortingAndOrder={setSortingAndOrder}
sortIconType={'other'}
/>
<th></th>
<th>{t('common.actions')}</th>
</HeaderRow>
</thead>
<TableBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test('should render organizations table', () => {
'Datalähde',
'Luokittelu',
'Pääorganisaatio',
'Toiminnot',
];

for (const name of columnHeaders) {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/places/placesTable/PlacesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const PlacesTable: React.FC<PlacesTableProps> = ({
},
{
key: '',
headerName: '',
headerName: t('common.actions'),
transform: ActionsColumn,
},
]}
Expand Down
8 changes: 7 additions & 1 deletion src/domain/places/placesTable/__tests__/PlacesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ const findPlaceRow = async (id: string) =>
test('should render places table', () => {
renderComponent();

const columnHeaders = ['ID', 'Nimi', 'Tapahtumien lkm', 'Katuosoite'];
const columnHeaders = [
'ID',
'Nimi',
'Tapahtumien lkm',
'Katuosoite',
'Toiminnot',
];

for (const name of columnHeaders) {
screen.getByRole('columnheader', { name });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable max-len */
import { createMemoryHistory } from 'history';

import getValue from '../../../utils/getValue';
import { mockAuthenticatedLoginState } from '../../../utils/mockLoginHooks';
import {
configure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const RegistrationsTable: React.FC<RegistrationsTableProps> = ({

{
key: '',
headerName: '',
headerName: t('common.actions'),
transform: ActionsColumn,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ test('should render registrations table', async () => {
'Jono',
'Ilmoittautumisaika',
'Tapahtuman ajankohta',
'Toiminnot',
];

for (const name of columnHeaders) {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/signups/signupsTable/SignupsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const SignupsTable: React.FC<SignupsTableProps> = ({
},
{
key: 'actionButtons',
headerName: '',
headerName: t('common.actions'),
transform: MemoizedSignupActionsDropdown,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ test('should render signups table', async () => {
'Yhteyshenkilön sähköposti',
'Yhteyshenkilön puhelinnumero',
'Status',
'Toiminnot',
];

for (const name of columnHeaders) {
Expand Down

0 comments on commit ab088d8

Please sign in to comment.