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

feat: allow to set mute duration and notifications mute option #2665

Merged
merged 6 commits into from
Mar 9, 2024

Conversation

shuuji3
Copy link
Member

@shuuji3 shuuji3 commented Mar 9, 2024

resolve #2301

This PR adds the two mute options in the confirm dialog for muting.

I set the default duration setting as 1 hour (this can be changed if the other value is better), and the mute notifications enabled, which is the current default.

Screenshots

Default

Screenshot from 2024-03-09 15-20-15

Setting example

Screenshot from 2024-03-09 15-03-25

Invalid duration

Screenshot from 2024-03-09 16-39-41

disables the "Mute" button

Implementation notes

To implement this feature, I adjusted the existing ConfirmDialog component to be able to show mute-related options and return selected information. (4276b50 cca244a)

Also, I implemented the DurationPicker component (ee0742e), where we can select minutes with 5 minutes step. I chose a 5-minute step for the minutes input to make it easier to select, but users can input any minute value type by directly typing.

Another adjustment is CommonCheckbox (bbb15dc). Previously, it could only show its checkbox at the end of the right side like on the settings page. This change allows us to put the checkbox before the label and accept the checkbox color change too.

Copy link

stackblitz bot commented Mar 9, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 54981d7
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/65ec13db41aa3f0008a98109

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 54981d7
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/65ec13db5faafc00086bf828
😎 Deploy Preview https://deploy-preview-2665--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

This is great! A step closer to feature parity 🙌🏼

I think we should merge this one now, and later on we could iterate and refactor it if we end up with more extra options. It is probably better that the confirm dialog will have a slot where you could inject extra options, and have each of these dialogs as a separate component.

@patak-dev patak-dev added this pull request to the merge queue Mar 9, 2024
Merged via the queue into elk-zone:main with commit 3448335 Mar 9, 2024
18 checks passed
@shuuji3 shuuji3 deleted the feat/specify-mute-duration branch March 9, 2024 11:59
@shuuji3
Copy link
Member Author

shuuji3 commented Mar 9, 2024

@patak-dev Thanks for a good suggestion! Right, it was a better choice to use slot inject extra options, instead of adding up pieces only needed for the mute functionality in this case.

I think I can refactor it later. Since I actually haven't had so much experience composing a component using the slot, that'll be a good exercise for me too 🙂

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.

Add mute duration
2 participants