-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow records to be updated without inserting new attachments #3130
Conversation
…rds easier. Fixes #3079
…ent when altering a record with an existing attachment. Need to write tests.
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.
Sorry I realized too late it was on draft 😬
src/components/record/RecordForm.tsx
Outdated
} = collection; | ||
const attachmentConfig = { | ||
enabled: attachment?.enabled, | ||
required: attachment?.required && !record?.data?.attachment |
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.
Shall we add a comment here making it explicit that this allows records to be edited without attachments to be reuploaded?
} | ||
}} />); | ||
expect(result.queryByLabelText("TestTitle").disabled).toBe(true); | ||
expect(result.queryByLabelText("TestContent").disabled).toBe(true); |
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.
No expectation about file form?
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.
In that scenario we weren't rendering the file form, but I can switch it so we are and check it too.
"publish-to-gh-pages": "cross-env ASSET_PATH=/kinto-admin/ npm run build && gh-pages --add --dist build/", | ||
"publish-to-gh-pages": "ASSET_PATH=/kinto-admin/ npm run build && gh-pages --add --dist build/", |
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.
Do we still need cross-env
? I guess only for running this command on Windows?
But also, maybe this is something we should migrate to a Github Actions https://github.com/actions/deploy-pages
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.
Started working on migrating this to a github action in another draft PR. I don't think we should bother with cross-env.
Fixes #3128 by allowing records to be updated (via JSON or normal form) without requiring attachments to be updated.
Logic changes
Test changes
RecordForm
, as we only had basic testing throughRecordAttributes_test
before.JSONRecordForm
returns the previous attachment data when saving.Note: This is forked from #3127 .