-
Notifications
You must be signed in to change notification settings - Fork 32
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
ME: duplicate local record #942
Conversation
Affected libs:
|
📷 Screenshots are here! |
2ada540
to
86315aa
Compare
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.
Looking and working great, thanks! I made a few suggestions in the code, especially when generating the XML of the duplicated record.
Also it looks like this PR is rebased on another one, but I'm not sure which. Should we wait for another PR to be merged before merging this one?
return [record, converter] as [CatalogRecord, BaseConverter<string>] | ||
}), | ||
switchMap(async ([record, converter]) => { |
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.
you can probably leave that aside and have everything in the same switchMap
:)
switchMap(async ([record, converter]) => { | ||
record.uniqueIdentifier = `TEMP-ID-${Date.now()}` | ||
record.title = `${record.title} (Copy)` | ||
const xml = await converter.writeRecord(record) |
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 original XML document should be provided to writeRecord
so that only the affected parts of the XML are changed, otherwise an completely new XML doc will be generated from scratch.
const xml = await converter.writeRecord(record) | |
const xml = await converter.writeRecord(record, xml) |
<gn-ui-interactive-table-column> | ||
<ng-template #header> </ng-template> | ||
<ng-template #cell let-item> | ||
<button |
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 you think you could use a gn-ui-button there? to have some hover/focus effects (the stop propagation part will also be handled that way)
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 had tried, but I'll try again.
Opening the menu didn't seem to work with a gn-ui-button, maybe because of the stop propagation indeed.
86315aa
to
2899383
Compare
2899383
to
6a2ba38
Compare
Description
This PR introduces the local record duplication feature, from the action menu on each record, in all records tables.
The click interaction on a record to open it has been moved to only the title, to allow a click on the menu.
When clicking on the duplicate action, the app navigates to a new duplicate route, which take an UUID as parameter, to read a local record, save it as a copy draft, then enter edition mode.
Architectural changes
The ui-search results-table component now depends on the MatMenuModule from Angular Material.
Screenshots
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label