Skip to content

Commit ba20a3c

Browse files
committed
fix: remove upload link if experimental features is not enabled
1 parent ddb97ba commit ba20a3c

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

apps/web/src/features/upload/pages/UploadSelectPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export const UploadSelectPage = () => {
2727
<PageHeader>
2828
<Heading className="text-center" variant="h2">
2929
{t({
30-
en: 'Select Instrument (Feature in Beta)',
31-
fr: 'Selectionnez un instrument (Fonctionnalité en bêta)'
30+
en: 'Select Instrument (Experimental Feature)',
31+
fr: 'Selectionnez un instrument (Fonctionnalité expérimentale)'
3232
})}
3333
</Heading>
3434
</PageHeader>

apps/web/src/hooks/useNavItems.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515

1616
import { useAppStore } from '@/store';
1717

18+
import { useSetupState } from './useSetupState';
19+
1820
export type NavItem = {
1921
disabled?: boolean;
2022
icon: React.ComponentType<Omit<React.SVGProps<SVGSVGElement>, 'ref'>>;
@@ -34,6 +36,7 @@ export function useNavItems() {
3436
const currentUser = useAppStore((store) => store.currentUser);
3537
const [navItems, setNavItems] = useState<NavItem[][]>([[], []]);
3638
const { resolvedLanguage, t } = useTranslation();
39+
const setupState = useSetupState();
3740

3841
useEffect(() => {
3942
const globalItems: NavItem[] = [];
@@ -51,7 +54,11 @@ export function useNavItems() {
5154
url: '/datahub'
5255
});
5356
}
54-
if (currentUser?.ability.can('read', 'Subject') && currentUser.ability.can('create', 'InstrumentRecord')) {
57+
if (
58+
currentUser?.ability.can('read', 'Subject') &&
59+
currentUser.ability.can('create', 'InstrumentRecord') &&
60+
setupState.data?.isExperimentalFeaturesEnabled
61+
) {
5562
globalItems.push({
5663
icon: UploadIcon,
5764
label: t(`layout.navLinks.upload`),

apps/web/src/translations/layout.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"fr": "Centre de données"
5252
},
5353
"upload": {
54-
"en": "Upload Data (Beta)",
55-
"fr": "Téléverser les données (Beta)"
54+
"en": "Upload Data",
55+
"fr": "Téléverser les données"
5656
},
5757
"endSession": {
5858
"en": "End Current Session",

0 commit comments

Comments
 (0)