Skip to content

Commit 22c90f5

Browse files
Merge pull request #92 from MobilityData/feat/90-modernize-header-footer
feat: modernize header and footer
2 parents f2b493f + d8d06c4 commit 22c90f5

File tree

19 files changed

+846
-285
lines changed

19 files changed

+846
-285
lines changed

cypress/e2e/changepassword.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Change Password Screen', () => {
2222
cy.get('input[id="currentPassword"]').type('wrong');
2323
cy.get('input[id="newPassword"]').type(newPassword);
2424
cy.get('input[id="confirmNewPassword"]').type(newPassword);
25-
cy.get('button[type="submit"]').click();
25+
cy.get('[data-cy="changePasswordButton"]').click();
2626
cy.contains(
2727
'The password is invalid or the user does not have a password. (auth/wrong-password).',
2828
).should('exist');
@@ -44,7 +44,7 @@ describe('Change Password Screen', () => {
4444
cy.get('input[id="currentPassword"]').type(currentPassword);
4545
cy.get('input[id="newPassword"]').type(newPassword);
4646
cy.get('input[id="confirmNewPassword"]').type(newPassword);
47-
cy.get('button[type="submit"]').click();
47+
cy.get('[data-cy="changePasswordButton"]').click();
4848

4949
cy.contains('Change Password Succeeded').should('exist');
5050
cy.get('[cy-data="goToAccount"]').click();

cypress/e2e/resetpassword.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe('Reset Password Screen', () => {
99

1010
it('should show error when email no email is provided', () => {
1111
cy.get('input[id="email"]').type('not an email', { force: true });
12-
cy.get('[type="submit"]').click();
12+
cy.get('[data-cy="submitResetPasswordButton"]').click();
1313
cy.get('[data-testid=emailError]').should('exist');
1414
});
1515

1616
it('should show the captcha error when is not accepted', () => {
1717
cy.get('iframe[title="reCAPTCHA"]').should('exist');
1818
cy.get('input[id="email"]').type('notvalid@e.c', { force: true });
19-
cy.get('[type="submit"]').click();
19+
cy.get('[data-cy="submitResetPasswordButton"]').click();
2020
cy.get('[data-testid=reCaptchaError]')
2121
.should('exist')
2222
.contains('You must verify you are not a robot.');

messages/en.json

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,16 @@
105105
"showMore": "Show {count} more",
106106
"moreInfo": "More Info",
107107
"license": "License",
108-
"tags": "Tags"
108+
"tags": "Tags",
109+
"openDrawer": "Open drawer",
110+
"mobilityDatabaseHome": "Mobility Database home",
111+
"accountMenu": "Account menu",
112+
"accountDetails": "Account Details",
113+
"login": "Login",
114+
"metricsAdminOnly": "Metrics - Admin Only",
115+
"languageSelect": "Language select",
116+
"transitFeedsRedirectTitle": "You've been redirected from TransitFeeds",
117+
"transitFeedsRedirectBody": "This page now lives on MobilityDatabase.org, where you'll find the most up-to-date transit data."
109118
},
110119
"feeds": {
111120
"feeds": "Feeds",
@@ -513,5 +522,36 @@
513522
"addFeeds": "A simple, easy-to-use form to add new feeds",
514523
"openSource": "An open source community actively working to improve the tools"
515524
}
525+
},
526+
"footer": {
527+
"tagline": "An open catalog of transit and mobility data feeds, serving the global transportation community.",
528+
"maintainedBy": "Maintained with 💙 by MobilityData",
529+
"copyright": "© {year} MobilityDatabase. All rights reserved.",
530+
"columns": {
531+
"platform": "Platform",
532+
"validators": "Validators",
533+
"company": "Company",
534+
"legal": "Legal"
535+
},
536+
"links": {
537+
"feeds": "Feeds",
538+
"addFeed": "Add a Feed",
539+
"apiDocs": "API Docs",
540+
"gtfsValidator": "GTFS Validator",
541+
"gtfsRtValidator": "GTFS-RT Validator",
542+
"gbfsValidator": "GBFS Validator",
543+
"about": "About",
544+
"faq": "FAQ",
545+
"contactUs": "Contact Us",
546+
"shareFeedback": "Share Feedback",
547+
"privacyPolicy": "Privacy Policy",
548+
"termsAndConditions": "Terms and Conditions"
549+
},
550+
"aria": {
551+
"github": "GitHub",
552+
"slack": "Slack",
553+
"linkedin": "LinkedIn",
554+
"logo": "MobilityDatabase logo"
555+
}
516556
}
517557
}

messages/fr.json

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,16 @@
105105
"showMore": "Show {count} more",
106106
"moreInfo": "More Info",
107107
"license": "License",
108-
"tags": "Tags"
108+
"tags": "Tags",
109+
"openDrawer": "Ouvrir le menu",
110+
"mobilityDatabaseHome": "Accueil de Mobility Database",
111+
"accountMenu": "Menu du compte",
112+
"accountDetails": "Détails du compte",
113+
"login": "Connexion",
114+
"metricsAdminOnly": "Métriques - Admin uniquement",
115+
"languageSelect": "Sélection de la langue",
116+
"transitFeedsRedirectTitle": "Vous avez été redirigé depuis TransitFeeds",
117+
"transitFeedsRedirectBody": "Cette page se trouve désormais sur MobilityDatabase.org, où vous trouverez les données de transit les plus récentes."
109118
},
110119
"feeds": {
111120
"feeds": "Feeds",
@@ -513,5 +522,36 @@
513522
"addFeeds": "Un formulaire simple et facile à utiliser pour ajouter de nouveaux flux",
514523
"openSource": "Une communauté open source travaillant activement à améliorer les outils"
515524
}
525+
},
526+
"footer": {
527+
"tagline": "Le plus grand catalogue ouvert de flux de données de transit et de mobilité, au service de la communauté mondiale des transports.",
528+
"maintainedBy": "Maintenu avec 💙 par MobilityData",
529+
"copyright": "© {year} MobilityDatabase. Tous droits réservés.",
530+
"columns": {
531+
"platform": "Plateforme",
532+
"validators": "Validateurs",
533+
"company": "Entreprise",
534+
"legal": "Légal"
535+
},
536+
"links": {
537+
"feeds": "Flux",
538+
"addFeed": "Ajouter un flux",
539+
"apiDocs": "Docs API",
540+
"gtfsValidator": "Validateur GTFS",
541+
"gtfsRtValidator": "Validateur GTFS-RT",
542+
"gbfsValidator": "Validateur GBFS",
543+
"about": "À propos",
544+
"faq": "FAQ",
545+
"contactUs": "Contactez-nous",
546+
"shareFeedback": "Donner un avis",
547+
"privacyPolicy": "Politique de confidentialité",
548+
"termsAndConditions": "Conditions d'utilisation"
549+
},
550+
"aria": {
551+
"github": "GitHub",
552+
"slack": "Slack",
553+
"linkedin": "LinkedIn",
554+
"logo": "Logo MobilityDatabase"
555+
}
516556
}
517557
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"loadashes6": "^1.0.0",
3131
"maplibre-gl": "^5.7.0",
3232
"material-react-table": "^2.13.0",
33-
"mui-nested-menu": "3.4.0",
3433
"next": "16.1.1",
3534
"next-intl": "^4.7.0",
3635
"openapi-fetch": "^0.9.3",

src/app/App.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
position: relative;
4343
/* 100vh - header margin - header - footer - footer padding */
4444
/* Not perfect, to revisit: for client loading state */
45-
min-height: calc(100vh - 32px - 64px - 232px - 20px);
46-
padding-bottom: 20px;
45+
min-height: calc(100vh - 32px - 64px - 302px - 48px);
46+
4747
box-sizing: border-box;
4848
}

src/app/[locale]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default async function LocaleLayout({
111111
component={'main'}
112112
id='next'
113113
sx={{
114-
minHeight: 'calc(100vh - 32px - 64px - 232px - 20px)',
114+
minHeight: 'calc(100vh - 32px - 64px - 302px - 48px)',
115115
}}
116116
>
117117
{children}

src/app/components/AuthSessionProvider.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ interface AuthSession {
1818
isAuthReady: boolean;
1919
email: string | null;
2020
isAuthenticated: boolean;
21+
displayName?: string | null;
2122
}
2223

2324
const AuthReadyContext = createContext<AuthSession>({
2425
isAuthReady: false,
2526
email: null,
2627
isAuthenticated: false,
28+
displayName: null,
2729
});
2830

2931
/**
@@ -58,6 +60,7 @@ export function AuthSessionProvider({
5860
isAuthReady: false,
5961
email: null,
6062
isAuthenticated: false,
63+
displayName: null,
6164
});
6265
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
6366

@@ -73,6 +76,7 @@ export function AuthSessionProvider({
7376
isAuthReady: true,
7477
email: user.email ?? null,
7578
isAuthenticated: !user.isAnonymous,
79+
displayName: user.displayName ?? null,
7680
});
7781
setUserCookieSession().catch(() => {
7882
console.error('Failed to establish session cookie');
@@ -90,7 +94,12 @@ export function AuthSessionProvider({
9094
5 * 60 * 1000,
9195
); // 5 minutes
9296
} else {
93-
setSession({ isAuthReady: false, email: null, isAuthenticated: false });
97+
setSession({
98+
isAuthReady: false,
99+
email: null,
100+
isAuthenticated: false,
101+
displayName: null,
102+
});
94103
dispatch(anonymousLogin());
95104
}
96105
});

0 commit comments

Comments
 (0)