Skip to content

Commit

Permalink
CORE-1968 Added basic titles to each page
Browse files Browse the repository at this point in the history
  • Loading branch information
psarando committed Oct 26, 2023
1 parent c52d672 commit b10e87b
Show file tree
Hide file tree
Showing 40 changed files with 149 additions and 36 deletions.
1 change: 1 addition & 0 deletions public/static/locales/en/apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"appListingError": "Unable to get Apps. Please try again.",
"appPubRequestsFetchError": "Unable to fetch publication requests. Please try again.",
"appPublicationError": "Unable to publish {{appName}}. Please check the details.",
"appsAdmin": "Apps Admin",
"appType": "Type",
"appVersion": "Version",
"apps_under_development": "Apps Under Development",
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"dataNavUsageTitle": "{{percentage}}% usage",
"description": "Description",
"deTitle": "Discovery Environment",
"dePageTitle": "{{title}} - Discovery Environment",
"delete": "Delete",
"disable": "Disable",
"discard": "Discard",
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/en/referenceGenomes.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"createdOn": "Created On",
"lastModifiedBy": "Last Modified By",
"lastModifiedOn": "Last Modified On",
"referenceGenomes": "Reference Genomes",
"search": "Search",
"updateSuccess": "Reference Genome updated successfully.",
"updateFailed": "Unable to update the Reference Genome"
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/en/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"admin": "Admin",
"allTeams": "All Teams",
"ariaTeamFilter": "Team Filter",
"createTeam": "Create Team",
"createTeamFail": "Failed to create team name or description. Please try again.",
"creator": "Creator Name",
"deleteTeamFail": "Failed to delete team. Please try again.",
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/en/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"toolRequests": "Tool Requests",
"toolRequestSuccess": "Request submitted successfully. You will receive notifications about the progress.",
"tools": "Tools",
"toolsAdmin": "Tools Admin",
"toolSrcLinkLabel": "Provide a link for your tool's source (GitHub, BitBucket, DockerHub etc...)",
"toolsUsed": "Tools used by {{appName}}",
"toolTestDataLabel": "Provide a link for your tool's test data",
Expand Down
3 changes: 2 additions & 1 deletion public/static/locales/en/vice-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@
"userIDColumn": "User ID",
"username": "Username",
"usernameColumn": "Username",
"value": "Value"
"value": "Value",
"viceAdmin": "VICE Admin"
}
10 changes: 9 additions & 1 deletion src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ function MyApp({ Component, pageProps }) {
})
);

const { title } = pageProps;

useEffect(() => {
const analytics_id = publicRuntimeConfig.ANALYTICS_ID;
const handleRouteChange = (url) => {
Expand Down Expand Up @@ -271,7 +273,13 @@ function MyApp({ Component, pageProps }) {
clientConfig={config}
>
<Head>
<title>{t("deTitle")}</title>
<title>
{title
? t("dePageTitle", {
title,
})
: t("deTitle")}
</title>
</Head>
<ReactQueryDevtools
initialIsOpen={false}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import { getLocalStorage } from "components/utils/localStorage";

Expand Down Expand Up @@ -145,8 +145,11 @@ export default function Apps() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("apps:appsAdmin");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"collections",
"tools",
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/doi.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";
import Listing from "components/doi/Listing";
import NotAuthorized from "components/error/NotAuthorized";
import { useUserProfile } from "contexts/userProfile";
Expand Down Expand Up @@ -73,8 +73,11 @@ export default function Doi() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("doiRequests");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"doi",
"data",
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/refgenomes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";
import ReferenceGenomes from "../../components/apps/admin/referenceGenomes/ReferenceGenomes";
import { useUserProfile } from "contexts/userProfile";
import NotAuthorized from "components/error/NotAuthorized";
Expand All @@ -17,8 +17,11 @@ export default function RefGenome() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("referenceGenomes:referenceGenomes");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"referenceGenomes",
...RequiredNamespaces,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useQuery, useQueryClient } from "react-query";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import Listing from "components/subscriptions/listing/Listing";
import AddOnsListing from "components/subscriptions/addons/listing/Listing";
Expand Down Expand Up @@ -158,8 +158,11 @@ export default function Subscriptions() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("subscriptions");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"subscriptions",
...RequiredNamespaces,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import constants from "../../constants";
import { getLocalStorage } from "components/utils/localStorage";
Expand Down Expand Up @@ -139,8 +139,11 @@ export default function Tools() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("tools:toolsAdmin");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"tools",
...RequiredNamespaces,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/admin/vice.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from "react";
import { useUserProfile } from "contexts/userProfile";
import NotAuthorized from "components/error/NotAuthorized";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import { serverSideTranslations } from "next-i18next/serverSideTranslations";

Expand Down Expand Up @@ -221,8 +221,11 @@ export default function VICEAdminPage() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("vice-admin:viceAdmin");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"vice-admin",
...RequiredNamespaces,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/analyses.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import constants from "../constants";

Expand Down Expand Up @@ -86,8 +86,11 @@ export default function Analyses() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("analyses");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"data",
// "analyses" already included by RequiredNamespaces
Expand Down
5 changes: 4 additions & 1 deletion src/pages/analyses/[analysisId]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";
import AnalysisSubmissionLanding from "components/analyses/landing/AnalysisSubmissionLanding";

/**
Expand All @@ -32,8 +32,11 @@ export default function Analysis() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("analyses:analysis");

return {
props: {
title,
...(await serverSideTranslations(locale, [
// "analyses" already included by RequiredNamespaces
"dashboard",
Expand Down
7 changes: 5 additions & 2 deletions src/pages/analyses/[analysisId]/relaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useQuery } from "react-query";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import constants from "../../../constants";
import {
Expand Down Expand Up @@ -122,14 +122,17 @@ const Relaunch = ({ showErrorAnnouncer }) => {
};

export async function getServerSideProps({ locale }) {
const title = i18n.t("analyses:relaunch");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"data",
"launch",
"upload",
"urlImport",
// "apps" already included by RequiredNamespaces
// "apps" and "analyses" already included by RequiredNamespaces
...RequiredNamespaces,
])),
},
Expand Down
5 changes: 4 additions & 1 deletion src/pages/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import { getLocalStorage } from "components/utils/localStorage";

Expand Down Expand Up @@ -80,8 +80,11 @@ export default function Apps() {

export async function getServerSideProps(context) {
const { locale } = context;
const title = i18n.t("apps");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"collections",
// "apps" already included by RequiredNamespaces
Expand Down
5 changes: 4 additions & 1 deletion src/pages/apps/[systemId]/[appId]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, { useCallback } from "react";
import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import { getLocalStorage } from "components/utils/localStorage";

Expand Down Expand Up @@ -76,8 +76,11 @@ export default function App() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("apps");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"collections",
// "apps" already included by RequiredNamespaces
Expand Down
5 changes: 4 additions & 1 deletion src/pages/apps/[systemId]/[appId]/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useQuery } from "react-query";

import { RequiredNamespaces, useTranslation } from "i18n";
import { i18n, RequiredNamespaces, useTranslation } from "i18n";

import {
getAppDescription,
Expand Down Expand Up @@ -120,8 +120,11 @@ function Launch({ showErrorAnnouncer }) {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("launch:launchAnalysis");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"data",
"upload",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useQuery } from "react-query";

import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";

import AppEditor from "components/apps/editor";
import ids from "components/apps/editor/ids";
Expand Down Expand Up @@ -156,8 +156,11 @@ export default function AppVersionCreate() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("apps:createAppVersion");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"app_editor",
"app_editor_help",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useQuery } from "react-query";

import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";

import AppEditor from "components/apps/editor";
import ids from "components/apps/editor/ids";
Expand Down Expand Up @@ -109,8 +109,11 @@ export default function AppEdit() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("apps:editApp");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"app_editor",
"app_editor_help",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useRouter } from "next/router";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useQuery } from "react-query";

import { RequiredNamespaces } from "i18n";
import { i18n, RequiredNamespaces } from "i18n";

import {
getAppDescription,
Expand Down Expand Up @@ -76,8 +76,11 @@ export default function Launch() {
}

export async function getServerSideProps({ locale }) {
const title = i18n.t("launch:launchAnalysis");

return {
props: {
title,
...(await serverSideTranslations(locale, [
"data",
"upload",
Expand Down
Loading

0 comments on commit b10e87b

Please sign in to comment.