Skip to content

Commit

Permalink
chore: rm concept-catalog-frontend toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Oct 31, 2023
1 parent 94bf2ba commit 6f0c3f5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/components/breadcrumbs/breadcrumbs.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Breadcrumb = ({ item }) => {
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{config.enableConceptCatalogFrontend && matchUrl.match('^/\\d+$') ? (
{matchUrl.match('^/\\d+$') ? (
<a href={`${config.conceptCatalogFrontendBaseUri}${matchUrl}`}>
{label}
</a>
Expand Down
3 changes: 0 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ const config = {
host: env.CATALOG_COMMENTS_SERVICE_HOST
},
conceptCatalogFrontendBaseUri: env.CONCEPT_CATALOG_FRONTEND_BASE_URI,
enableConceptCatalogFrontend: ['staging', 'demo'].some(environment =>
window.location.hostname.includes(environment)
),
catalogAdminServiceBaseUri: env.CATALOG_ADMIN_SERVICE_BASE_URI,
useDemoLogo: env.USE_DEMO_LOGO
};
Expand Down
6 changes: 1 addition & 5 deletions src/pages/concept-registration-page/form-concept/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,7 @@ export const FormConceptPure: FC<Props> = ({
}

if (deleteCalled) {
if (config.enableConceptCatalogFrontend) {
window.location.href = `${config.conceptCatalogFrontendBaseUri}/${catalogId}`;
} else {
history.push(`/${catalogId}`);
}
window.location.href = `${config.conceptCatalogFrontendBaseUri}/${catalogId}`;
}
// since this is not dirty, don't do anything
return () => {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import {
OptionProps,
SelectField
} from '../../../../components/fields/field-select/field-select.component';
import { getConfig } from '../../../../config';

interface Props {
languages: Language[];
}

const config = getConfig();

export const UseOfTerm = ({ languages }: Props): JSX.Element => {
const { values }: any = useFormikContext();
const { catalogFields } = useAppSelector(state => state.catalogFields);
Expand Down Expand Up @@ -61,29 +58,27 @@ export const UseOfTerm = ({ languages }: Props): JSX.Element => {

return (
<div>
{config.enableConceptCatalogFrontend && (
<div className='form-group'>
<HelpText
title={localization.statusTitle}
helpTextAbstract={localization.statusAbstract}
<div className='form-group'>
<HelpText
title={localization.statusTitle}
helpTextAbstract={localization.statusAbstract}
/>
{statusOptions && (
<Field
className='col-sm-5'
name='statusURI'
component={SelectField}
options={statusOptions}
onClear={form => handleClearConceptStatus(form)}
defaultValue={statusOptions.find(
option => option.value === values.statusURI
)}
onChange={(form, _thisFieldName, option) =>
handleChangeConceptStatus(form, option)
}
/>
{statusOptions && (
<Field
className='col-sm-5'
name='statusURI'
component={SelectField}
options={statusOptions}
onClear={form => handleClearConceptStatus(form)}
defaultValue={statusOptions.find(
option => option.value === values.statusURI
)}
onChange={(form, _thisFieldName, option) =>
handleChangeConceptStatus(form, option)
}
/>
)}
</div>
)}
)}
</div>
<div className='form-group'>
<HelpText
title={localization.eksempelTitle}
Expand Down

0 comments on commit 6f0c3f5

Please sign in to comment.