Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(website): fix data use terms not updating when edited #1606

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ const InnerEditDataUseTermsButton: FC<EditDataUseTermsButtonProps> = ({
position: 'top-center',
autoClose: false,
}),
onSuccess: () =>
toast.success('The use terms for this sequence will be updated within a few minutes.', {
position: 'top-center',
autoClose: false,
}),
onSuccess: () => location.reload(),
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const groupId = tableData.find((entry) => entry.name === 'groupId')!.value as nu
dataUseTermsHistory.sort((a, b) => (a.changeDate > b.changeDate ? -1 : 1));
const currentDataUseTerms = dataUseTermsHistory[0].dataUseTerms;

const dataUseTermsIndex = tableData.findIndex((entry) => entry.name === 'dataUseTerms');
if (dataUseTermsIndex !== -1) {
tableData[dataUseTermsIndex].value = currentDataUseTerms.type;
}

const isRestricted = currentDataUseTerms.type === 'RESTRICTED';

const runtimeConfig = getRuntimeConfig();
Expand Down
Loading