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

Display confirmation dialog and toasts on toggling file to public #198

Merged
merged 1 commit into from
May 16, 2024

Conversation

norrisng-bc
Copy link
Contributor

Description

Setting the "set to public" switch to "on" (in both the object table and file permissions modal) now opens an additional modal that asks the user to confirm before doing so:

Screenshot 2024-05-15 at 4 10 24 PM

(this dialog is only displayed when toggling a file from private to public)

A toast is then displayed:

Screenshot 2024-05-15 at 4 39 19 PM

A toast is also displayed when toggling a file from public to private:

Screenshot 2024-05-15 at 4 38 50 PM

https://apps.nrs.gov.bc.ca/int/jira/browse/SHOWCASE-3667

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

N/A

Toasts are also displayed when toggling file to private
Copy link

Coverage Report (Application)

Totals Coverage
Statements: 70.67% ( 53 / 75 )
Methods: 62.5% ( 5 / 8 )
Lines: 81.63% ( 40 / 49 )
Branches: 44.44% ( 8 / 18 )

Copy link

codeclimate bot commented May 15, 2024

Code Climate has analyzed commit f6485a5 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 0.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 24.6% (0.0% change).

View more on Code Climate.

Copy link

Coverage Report (Frontend)

Totals Coverage
Statements: 19.43% ( 706 / 3633 )
Methods: 18.64% ( 134 / 719 )
Lines: 23.29% ( 491 / 2108 )
Branches: 10.05% ( 81 / 806 )

acceptLabel: 'Confirm',
rejectLabel: 'Cancel',
accept: () => {
objectStore
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a show stopper, just for future reference. Consider moving logic into a separate function, which can be called in multiple places.

@@ -66,6 +66,7 @@ onBeforeMount(() => {
class="ml-4"
:bucket-id="object.bucketId"
:object-id="object.id"
:object-name="object.name"
:object-public="object.public"
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess we could just pass the whole object in one binding (:object="object") instead of 4 separate ones, and break it down in the child component, and i think we've found some other ways since adopting this pattern early on.. but this is fine for now.

@TimCsaky TimCsaky merged commit 39dbec7 into master May 16, 2024
18 of 19 checks passed
@TimCsaky TimCsaky deleted the feature/confirm-toggle-public branch May 17, 2024 20:46
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.

3 participants