Skip to content

Commit

Permalink
feat: re-organise help pages navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
jorilindell committed May 8, 2024
1 parent 853682d commit 74a6b39
Show file tree
Hide file tree
Showing 47 changed files with 983 additions and 2,851 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ REACT_APP_MATOMO_TRACKER_URL=matomo.php
REACT_APP_MATOMO_ENABLED=false

REACT_APP_SWAGGER_URL=https://dev.hel.fi/apis/linkedevents
REACT_APP_SWAGGER_SCHEMA_URL=https://raw.githubusercontent.com/City-of-Helsinki/api-linked-events/master/linked-events.swagger.yaml

REACT_APP_INTERNET_PLACE_ID=system:internet
REACT_APP_REMOTE_PARTICIPATION_KEYWORD_ID=yso:p26626
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ ARG REACT_APP_LINKED_EVENTS_SYSTEM_DATA_SOURCE
# Allowed domain for the substitute user
ARG REACT_APP_ALLOWED_SUBSTITUTE_USER_DOMAINS

# Swagger URLs
ARG REACT_APP_SWAGGER_SCHEMA_URL
# Swagger URL
ARG REACT_APP_SWAGGER_URL

# Feature flags
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Use .env.development.local for development.
| REACT_APP_MATOMO_TRACKER_URL | matomo.php |
| REACT_APP_MATOMO_ENABLED | Flag to enable matomo. Default false. |
| REACT_APP_SWAGGER_URL | https://dev.hel.fi/apis/linkedevents |
| REACT_APP_SWAGGER_SCHEMA_URL | https://raw.githubusercontent.com/City-of-Helsinki/api-linked-events/master/linked-events.swagger.yaml |
| REACT_APP_INTERNET_PLACE_ID | Id of the internet place. system:internet in development server, helsinki:internet in production |
| REACT_APP_REMOTE_PARTICIPATION_KEYWORD_ID | yso:p26626 |
| REACT_APP_LINKED_EVENTS_SYSTEM_DATA_SOURCE | helsinki |
Expand Down
71 changes: 19 additions & 52 deletions e2e/tests/help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,74 +13,71 @@ test.describe('Help page', () => {
.locator('#page-header')
.getByRole('link', { name: 'Tuki' })
.click();
await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Yleistä' })
.click();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Alusta' })
.getByRole('link', { name: 'Tietoa palvelusta' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Alusta' }))
.soft(page.getByRole('heading', { name: 'Tietoa palvelusta' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Hallintapaneeli' })
.getByRole('link', { name: 'Käyttöehdot' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Hallintapaneeli' }))
.soft(page.getByRole('heading', { name: 'Tietosuoja ja käyttöehdot' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Linked Registration -ohje' })
.getByRole('link', { name: 'Ota yhteyttä' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Linked Registration -ohje' }))
.soft(page.getByRole('heading', { name: 'Ota yhteyttä' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'UKK' })
.getByRole('link', { name: 'Pyydä käyttöoikeutta' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Usein kysytyt kysymykset' }))
.soft(page.getByRole('heading', { name: 'Pyydä käyttöoikeutta' }))
.toBeVisible();

await page.getByRole('button', { name: 'Teknologia' }).click();
await page.getByRole('button', { name: 'Ohjeet' }).click();
await page
.locator('[id="\\/fi\\/help\\/technology-menu"]')
.getByRole('link', { name: 'Yleistä' })
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Sisällöntuotannon ohjeet' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Yleistä' }))
.soft(page.getByRole('heading', { name: 'Sisällöntuotannon ohjeet' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Rajapinta' })
.getByRole('link', { name: 'Ilmoittautumisen ohjeet' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Rajapinta' }))
.soft(page.getByRole('heading', { name: 'Ilmoittautumisen ohjeet' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Kuvaoikeudet' })
.getByRole('link', { name: 'UKK' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Kuvaoikeudet' }))
.soft(page.getByRole('heading', { name: 'Usein kysytyt kysymykset' }))
.toBeVisible();

await page.getByRole('button', { name: 'Teknologia' }).click();
await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Lähdekoodi' })
.getByRole('link', { name: 'Lähdekoodi ja rajapinta' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Lähdekoodi' }))
.soft(page.getByRole('heading', { name: 'Lähdekoodi ja rajapinta' }))
.toBeVisible();

await page
Expand All @@ -90,36 +87,6 @@ test.describe('Help page', () => {
await expect
.soft(page.getByRole('heading', { name: 'Dokumentaatio' }))
.toBeVisible();

await page.getByRole('button', { name: 'Tuki' }).click();
await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Käyttöehdot' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Tietosuoja ja käyttöehdot' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Ota yhteyttä' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Ota yhteyttä' }))
.toBeVisible();

await page
.getByLabel('Lisätietoa palvelusta')
.getByRole('link', { name: 'Pyydä käyttöoikeutta' })
.click();
await expect
.soft(page.getByRole('heading', { name: 'Pyydä käyttöoikeutta' }))
.toBeVisible();

await page.getByLabel('Palvelun ominaisuudet').click();
await expect
.soft(page.getByRole('heading', { name: 'Palvelun ominaisuudet' }))
.toBeVisible();
});

test('Should submit contact form successfully', async ({
Expand Down
13 changes: 8 additions & 5 deletions e2e/tests/landing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ test.describe('Landing page', () => {
)
.toBeVisible();
await expect
.soft(page.getByRole('contentinfo').getByRole('link', { name: 'Tuki' }))
.soft(
page
.getByRole('contentinfo')
.getByRole('link', { name: 'Tietoa palvelusta' })
)
.toBeVisible();
await expect
.soft(page.getByRole('link', { name: 'Tietosuoja' }))
Expand Down Expand Up @@ -77,9 +81,6 @@ test.describe('Landing page', () => {
await expect
.soft(page.getByRole('link', { name: 'Technology' }))
.toBeVisible();
await expect
.soft(page.getByRole('link', { name: 'Service features' }))
.toBeVisible();
await expect
.soft(page.getByRole('link', { name: 'Data Protection' }))
.toBeVisible();
Expand All @@ -93,7 +94,9 @@ test.describe('Landing page', () => {
.toBeVisible();
await expect
.soft(
page.getByRole('contentinfo').getByRole('link', { name: 'Support' })
page
.getByRole('contentinfo')
.getByRole('link', { name: 'Information about the service' })
)
.toBeVisible();
});
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/react-scroll": "^1.8.10",
"@types/swagger-ui-react": "^4.18.3",
"@vitejs/plugin-react-swc": "^3.6.0",
"apollo-link-rest": "^0.9.0",
"apollo-link-sentry": "^3.3.0",
Expand Down Expand Up @@ -55,6 +54,7 @@
"leaflet-draw": "^1.0.4",
"object-keys-normalizer": "^1.0.1",
"pretty": "^2.0.0",
"qs": "^6.12.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
Expand All @@ -66,7 +66,6 @@
"react-router-dom": "^6.22.3",
"react-scroll": "^1.9.0",
"sass": "^1.72.0",
"swagger-ui-react": "^5.12.0",
"typescript": "~5.4.3",
"use-debounce": "^10.0.0",
"use-deep-compare-effect": "^1.8.1",
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 2 additions & 7 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ export enum ROUTES {
EDIT_SIGNUP_GROUP = '/registrations/:registrationId/signup-group/edit/:signupGroupId',
EVENT_SAVED = '/events/completed/:id',
EVENTS = '/events',
FEATURES = '/help/features',
HELP = '/help',
HOME = '/',
IMAGES = '/administration/images',
INSTRUCTIONS = '/help/instructions',
INSTRUCTIONS_CONTROL_PANEL = '/help/instructions/control-panel',
INSTRUCTIONS_EVENTS = '/help/instructions/events',
INSTRUCTIONS_FAQ = '/help/instructions/faq',
INSTRUCTIONS_GENERAL = '/help/instructions/general',
INSTRUCTIONS_PLATFORM = '/help/instructions/platform',
INSTRUCTIONS_REGISTRATION = '/help/instructions/registration',
KEYWORDS = '/administration/keywords',
KEYWORD_SETS = '/administration/keyword-sets',
Expand All @@ -68,12 +65,10 @@ export enum ROUTES {
SUPPORT = '/help/support',
SUPPORT_ASK_PERMISSION = '/help/support/ask-permission',
SUPPORT_CONTACT = '/help/support/contact',
SUPPORT_SERVICE_INFORMATION = '/help/support/service-information',
SUPPORT_TERMS_OF_USE = '/help/support/terms-of-use',
TECHNOLOGY = '/help/technology',
TECHNOLOGY_API = '/help/technology/api',
TECHNOLOGY_DOCUMENTATION = '/help/technology/documentation',
TECHNOLOGY_GENERAL = '/help/technology/general',
TECHNOLOGY_IMAGE_RIGHTS = '/help/technology/image-rights',
TECHNOLOGY_SOURCE_CODE = '/help/technology/source-code',
}

Expand Down
2 changes: 0 additions & 2 deletions src/domain/accessibilityStatement/AccessibilityStatement.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-require-imports */
import 'swagger-ui-react/swagger-ui.css';

import React from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
Expand Down
20 changes: 1 addition & 19 deletions src/domain/admin/layout/__tests__/AdminPageLayout.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';

import { ROUTES } from '../../../../constants';
import {
configure,
render,
screen,
userEvent,
waitFor,
} from '../../../../utils/testUtils';
import { configure, render, screen } from '../../../../utils/testUtils';
import AdminPageLayout from '../AdminPageLayout';

configure({ defaultHidden: true });
Expand All @@ -24,15 +18,3 @@ test('should render help page layout', async () => {
screen.getByRole('button', { name: 'Hallinta' });
screen.getByRole('link', { name: 'Avainsanat' });
});

test('should route to features help page', async () => {
const user = userEvent.setup();
const { history } = renderComponent();

const keywordsLink = screen.getByRole('link', { name: 'Avainsanat' });
await user.click(keywordsLink);

await waitFor(() =>
expect(history.location.pathname).toBe('/fi/administration/keywords')
);
});
4 changes: 1 addition & 3 deletions src/domain/app/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { useTheme } from '../theme/Theme';
import {
navigationGroupAdmin,
navigationGroupEvents,
navigationGroupFeatures,
navigationGroupHome,
navigationGroupInstructions,
navigationGroupRegistrations,
Expand Down Expand Up @@ -106,10 +105,9 @@ const Footer: React.FC = () => {
featureFlagUtils.isFeatureEnabled('SHOW_ADMIN') &&
areAdminRoutesAllowed(user) &&
navigationGroupAdmin,
navigationGroupSupport,
navigationGroupInstructions,
navigationGroupTechnology,
navigationGroupSupport,
navigationGroupFeatures,
]
.filter(skipFalsyType)
.map((group) => (
Expand Down
3 changes: 1 addition & 2 deletions src/domain/app/footer/__tests__/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ test('should show navigation links and should route to correct page after clicki
{ name: 'Hallinta', url: `/fi${ROUTES.ADMIN}` },
{ name: /ohjeet/i, url: `/fi${ROUTES.INSTRUCTIONS}` },
{ name: /teknologia/i, url: `/fi${ROUTES.TECHNOLOGY}` },
{ name: /tuki/i, url: `/fi${ROUTES.SUPPORT}` },
{ name: /palvelun ominaisuudet/i, url: `/fi${ROUTES.FEATURES}` },
{ name: /tietoa palvelusta/i, url: `/fi${ROUTES.SUPPORT}` },
];

for (const { name, url } of links) {
Expand Down

0 comments on commit 74a6b39

Please sign in to comment.