Skip to content

Commit

Permalink
Merge pull request #805 from cultuurnet/feature/III-5845
Browse files Browse the repository at this point in the history
III-5845 - Organizer form: change title of location tab to 'Adres'
  • Loading branch information
brampauwelyn authored Oct 12, 2023
2 parents 6c1abe5 + 11218ff commit c65ced5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@
"tip": "Geben Sie eine enthusiastische Beschreibung Ihrer Organisation, die sich speziell an Schulen und Lehrer richtet. Diese Beschreibung wird nur auf cultuurkuur.be, der Plattform für Bildung und Kultur, erscheinen."
},
"location": {
"title": "Standort"
"title": "Standort",
"title_organizer": "Adresse"
},
"place": {
"add_new_label": "Ort nicht gefunden? Neuen Standort hinzufügen"
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@
"tip": "Donnez une description enthousiaste de votre organisation, destinée spécifiquement aux écoles et aux enseignants. Cette description n'apparaîtra que sur cultuurkuur.be, la plateforme de l'éducation et de la culture."
},
"location": {
"title": "Lieu"
"title": "Lieu",
"title_organizer": "Adresse"
},
"place": {
"add_new_label": "Lieu introuvable ? Ajouter un nouveau lieu"
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@
"tip": "Geef een enthousiaste omschrijving van je organisatie, specifiek gericht naar scholen en leerkrachten. Deze beschrijving verschijnt enkel op cultuurkuur.be, het platform voor onderwijs en cultuur."
},
"location": {
"title": "Locatie"
"title": "Locatie",
"title_organizer": "Adres"
},
"place": {
"add_new_label": "Locatie niet gevonden? Nieuwe locatie toevoegen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type TabContentProps = {

type TabConfig = {
field: Field;
titleKey?: string;
TabContent: FC<TabContentProps & { [prop: string]: unknown }>;
shouldShowOn?: Values<typeof AdditionalInformationStepVariant>[];
shouldInvalidate: boolean;
Expand Down Expand Up @@ -120,6 +121,7 @@ const tabConfigurations: TabConfig[] = [
{
field: Fields.LOCATION,
TabContent: PhysicalLocationStep,
titleKey: 'create.additionalInformation.location.title_organizer',
shouldInvalidate: false,
shouldShowOn: [AdditionalInformationStepVariant.ORGANIZER],
},
Expand Down Expand Up @@ -152,17 +154,23 @@ const tabConfigurations: TabConfig[] = [
type TabTitleProps = InlineProps & {
scope: Scope;
field: Field;
titleKey?: string;
validationStatus: ValidationStatus;
};

const TabTitle = ({
scope,
field,
validationStatus,
titleKey,
...props
}: TabTitleProps) => {
const { t } = useTranslation();

const title = titleKey
? t(titleKey)
: t(`create.additionalInformation.${field}.title`);

return (
<Inline spacing={3} {...getInlineProps(props)}>
{validationStatus === ValidationStatus.SUCCESS && (
Expand All @@ -177,7 +185,7 @@ const TabTitle = ({
<Text>
{scope === ScopeTypes.ORGANIZERS && field === Fields.MEDIA
? t('organizers.create.step2.pictures.title')
: t(`create.additionalInformation.${field}.title`)}
: title}
</Text>
</Inline>
);
Expand Down Expand Up @@ -273,6 +281,7 @@ const AdditionalInformationStep = ({
({
shouldShowOn,
field,
titleKey,
shouldInvalidate,
TabContent,
stepProps,
Expand All @@ -298,6 +307,7 @@ const AdditionalInformationStep = ({
<TabTitle
scope={scope}
field={field}
titleKey={titleKey}
validationStatus={validatedFields[field]}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TabContentProps,
ValidationStatus,
} from '@/pages/steps/AdditionalInformationStep/AdditionalInformationStep';
import { isLocationSet, LocationStep } from '@/pages/steps/LocationStep';
import { LocationStep } from '@/pages/steps/LocationStep';
import { StepProps } from '@/pages/steps/Steps';
import { StackProps } from '@/ui/Stack';

Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/create-organizer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test('create an organizer', async ({ baseURL, page }) => {
await page.getByRole('button', { name: 'Uploaden' }).click();
await page.getByText(${dummyOrganizer.image.copyright}`).click();

await page.getByRole('tab', { name: 'Locatie' }).click();
await page.getByRole('tab', { name: 'Adres' }).click();
await page.getByLabel('Gemeente').click();
await page.getByLabel('Gemeente').fill(dummyOrganizer.location.municipality);
await page.getByLabel(dummyOrganizer.location.municipality).click();
Expand Down

0 comments on commit c65ced5

Please sign in to comment.