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

Dialog JS API #900

Merged
merged 20 commits into from Aug 19, 2022
Merged

Dialog JS API #900

merged 20 commits into from Aug 19, 2022

Conversation

joepavitt
Copy link
Contributor

@joepavitt joepavitt commented Aug 17, 2022

Closes #830

JS API
Includes additional JS api to open Dialogs. I've overridden the initial dialogs where appropriate, mostly in "Delete" use cases, e.g.:

Dialog.show({
        header: '<header title>',
        kind: (optional) 'danger',
        text: 'show this message in the dialog',
        html: 'instead of "text", you can provide html for more custom appearance and content',
        confirmLabel: '<confirm-label>'
}, async () => {
        // callback goes here
})

Architecture
The core dialog service lives in ./frontend/src/services/dialog.js. The key .show() function is used across the app in order to show and act upon confirmation of any dialogs.

The bind function is called from ./frontend/src/layouts/Platform.vue. There is an instance of ff-dialog here that is driven by the bind function. When show() is called, the dialog being modified/shown is this instance.

Testing
Given that we now have E2E testing up and running, I've also used this as an opportunity to include a bunch of E2E tests that then cover a lot of primary use cases that use these Dialogs. I haven't gone for 100% coverage on this, but it's a significant dent into a backlog of technical testing debt too.

@joepavitt joepavitt marked this pull request as ready for review August 18, 2022 11:14
Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

All viewed, ran locally, all good :)

@Steve-Mcl
Copy link
Contributor

All issues resolved, ready to merge @joepavitt 👍

@joepavitt joepavitt merged commit 6f20209 into main Aug 19, 2022
@joepavitt joepavitt deleted the dialog-api branch August 19, 2022 09:19
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.

Reduce number of (almost identical) duplicate dialog components
2 participants