-
Notifications
You must be signed in to change notification settings - Fork 62
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
Feature #710: View deleted Entities and restore Entities #1119
Feature #710: View deleted Entities and restore Entities #1119
Conversation
747d373
to
4f18ade
Compare
Verify that duplicate UUID error is handled correctly in bulk Entities upload |
4f18ade
to
bbbcc71
Compare
if (this.confirmDelete) { | ||
this.uuidToDelete = entity.__id; | ||
this.del.show({ label: entity.label }); | ||
this.deleteModal.show({ entity }); |
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.
Passing whole entity object to make it consistent with restore and Submissions deleted/restore
bbbcc71
to
2d3dd3b
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.
Looks great!
src/components/entity/restore.vue
Outdated
const props = defineProps({ | ||
state: Boolean, | ||
checkbox: Boolean, | ||
label: { |
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 think the label
prop isn't used, since the label is grabbed off the entity
prop.
"If the Entity is deleted again, it will be another 30 days before it is removed." | ||
], | ||
"field": { | ||
"noConfirm": "Undelete immediately without confirmation until I leave the page" |
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 think this is the same as the message in SubmissionRestore
. It'd be good to avoid retranslating it:
// @transifexKey component.SubmissionRestore.field.noConfirm
src/components/entity/list.vue
Outdated
const { dataset } = useRequestData(); | ||
const odataEntities = useEntities(); | ||
const { dataset, deletedEntityCount } = useRequestData(); | ||
const { odataEntities } = useEntities(); |
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.
If DatasetEntities
is calling useEntities()
, then I think EntityList
shouldn't, because useEntities()
will always create resources. It will create a new resource even if there is another local resource with the same name. Instead, odataEntities
should be obtained from useRequestData()
.
If useEntities()
is removed from this file, some tests may fail. If there are any tests that mount EntityList
instead of DatasetEntities
, those tests will need to pass useEntities
to testRequestData()
.
<entity-download-button :odata-filter="odataFilter"/> | ||
<entity-download-button :odata-filter="deleted ? null : odataFilter" | ||
:aria-disabled="deleted" | ||
v-tooltip.aria-describedby="deleted ? $t('downloadDisabled') : null"/> |
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.
How about adding a test that the download button is disabled?
Closes getodk/central#710
What has been done to verify that this works as intended?
Added tests and verified manually.
Why is this the best possible solution? Were any other approaches considered?
Followed the existing code pattern.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
None.
Does this change require updates to user documentation? If so, please file an issue here and include the link below.
Added in getodk/docs#1896
Before submitting this PR, please make sure you have:
npm run test
andnpm run lint
and confirmed all checks still pass OR confirm CircleCI build passes