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

EES-5363 api data set admin changelog #5169

Merged
merged 3 commits into from
Aug 22, 2024
Merged

EES-5363 api data set admin changelog #5169

merged 3 commits into from
Aug 22, 2024

Conversation

amyb-hiveit
Copy link
Collaborator

Adds the changelog page, including public guidance notes form, in the API data sets admin.

</div>
<p>
<Tag colour={isDraft ? 'green' : 'blue'}>{`${
isDraft ? 'Ready' : 'Published'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say 'Draft' instead of 'Ready'

Comment on lines 102 to 103
{dataSetVersion?.notes
? dataSetVersion.notes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can simplify to dataSetVersion?.notes ?? '...'

const apiDataSetService = jest.mocked(_apiDataSetService);
const apiDataSetVersionService = jest.mocked(_apiDataSetVersionService);

describe('ReleaseApiDataSetPreviewTokenPage', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ReleaseApiDataSetChangelogPage

<FormFieldTextArea
name="notes"
label="Public guidance notes"
hint="Use the public guidance notes to highlight any extra information to your end users that may not be apparent in the automated changelog below."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hella wordy. Could simplify this to: 'Highlight any extra information that may not be apparent in the automated changelog below.'


<ButtonGroup>
<Button type="submit" ariaDisabled={formState.isSubmitting}>
{`${notes ? 'Update' : 'Add'} public guidance notes`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could simplify to 'Save public guidance notes'?

inline
loading={formState.isSubmitting}
size="sm"
text="Updating notes"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better as 'Saving notes'

@@ -6,12 +6,14 @@ import Button from '@common/components/Button';
import React from 'react';

interface Props {
changelogPath: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make this a configurable prop? The link can just be hard-coded to be generated from releaseApiDataSetChangelogRoute?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question... no idea why I did that, I've changed it now.

onSubmit: (values: ApiDataSetNotesFormValues) => void;
}

export default function ApiDataSetNotesForm({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest naming this ApiDataSetGuidanceNotesForm to be more explicit

<FormProvider initialValues={{ notes }}>
{({ formState }) => {
return (
<Form id="apiDataSetCreateForm" onSubmit={onSubmit}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id doesn't look right. Could change to guidanceNotesForm.

dataSetVersionId: string;
notes: string;
}): Promise<ApiDataSetVersion> {
return client.patch(`/public-data/data-set-versions`, data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not sure what Jack was doing here, but the URL for this isn't correct! I'm going to push a change to fix this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

<>
<h3>Public guidance notes</h3>
<p>
{dataSetVersion?.notes ??
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realised it's possible to set this to an empty string, so it'd be better to go with || so that the fallback shows in this situation.

amyb-hiveit and others added 3 commits August 22, 2024 17:05
- URL is now REST compliant (i.e. with `dataSetVersionId` in URL)
- Validation error messages have been simplified
@ntsim ntsim merged commit 0609ab0 into dev Aug 22, 2024
7 checks passed
@ntsim ntsim deleted the EES-5363 branch August 22, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants