-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
</div> | ||
<p> | ||
<Tag colour={isDraft ? 'green' : 'blue'}>{`${ | ||
isDraft ? 'Ready' : 'Published' |
There was a problem hiding this comment.
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'
{dataSetVersion?.notes | ||
? dataSetVersion.notes |
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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`} |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?? |
There was a problem hiding this comment.
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.
- URL is now REST compliant (i.e. with `dataSetVersionId` in URL) - Validation error messages have been simplified
Adds the changelog page, including public guidance notes form, in the API data sets admin.