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

Add Story & Storybook Documentation for Dialog Component #507

Merged
merged 17 commits into from Dec 2, 2021

Conversation

guergana
Copy link
Contributor

@guergana guergana commented Nov 30, 2021

Bug: T295875

@guergana guergana changed the title Add Dialog Story Add Story & Storybook Documentation for Dialog Component Nov 30, 2021
@github-actions
Copy link

@guergana guergana marked this pull request as draft November 30, 2021 12:52
ref="simple"
:actions="actions"
style="transform: translate(50%, 50%)"
@action="(_, dialog) => dialog.hide()"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took this from the MMF. should this be the generic action?

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if I understand the question? If you mean to say should the dialog just close on any button click then yes, it should

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right now there is only one action, yes, so both buttons close the window. is this desired = should i just leave it like this? :)

Copy link
Member

Choose a reason for hiding this comment

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

I think so, yes

@guergana guergana marked this pull request as ready for review November 30, 2021 16:10
this.$emit( 'dismissed' );
this.hide();
},
_dispatch( namespace: string ): void {
/**
Copy link
Contributor Author

@guergana guergana Nov 30, 2021

Choose a reason for hiding this comment

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

Prob needs a better explanation. I don't know how to write it because i don't understand how it works 100%.

Copy link
Member

Choose a reason for hiding this comment

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

On it ;)

@sai-san sai-san self-requested a review November 30, 2021 16:56
Copy link
Member

@itamargiv itamargiv left a comment

Choose a reason for hiding this comment

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

Looks good altogether, there are still missing descriptions for each of the props in the controls and docs tab of the story. We can add those as docbloc comments above the definition of each property in the component's vue file.

Additionally, we have an issue with the overly not showing up. Probably due to the changes @Silvan-WMDE and I made by converting the top: 0, left: 0, right: 0, bottom: 0 css positions of the overlay in the vue file to the inset shorthand (which might not work as expected).

vue-components/src/components/Dialog.vue Outdated Show resolved Hide resolved
vue-components/src/components/Dialog.vue Outdated Show resolved Hide resolved
this.$emit( 'dismissed' );
this.hide();
},
_dispatch( namespace: string ): void {
/**
Copy link
Member

Choose a reason for hiding this comment

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

On it ;)

vue-components/src/components/Dialog.vue Outdated Show resolved Hide resolved
vue-components/stories/Dialog.stories.ts Outdated Show resolved Hide resolved
vue-components/stories/Dialog.stories.ts Outdated Show resolved Hide resolved
}
],
visible: true,
dialogText: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Heads-up that this should be replaced by the copy linked from the ticket. See copy in Figma.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but without the line breaks, right? since the <br/> neither the \n are rendered

guergana and others added 10 commits December 1, 2021 18:23
Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com>
Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com>
Co-authored-by: sai <sarai.sanchez@wikimedia.de>
Co-authored-by: sai <sarai.sanchez@wikimedia.de>
Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com>
Co-authored-by: sai <sarai.sanchez@wikimedia.de>
Co-authored-by: sai <sarai.sanchez@wikimedia.de>
Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com>
@sai-san
Copy link
Collaborator

sai-san commented Dec 1, 2021

A couple of issues:

  1. The overllay is still not displayed behind the dialog (it's positioned to the bottom right)

Screenshot 2021-12-01 at 17 26 00

  1. Is there a way to increase the size of the canvas in the Docs page so the Dialog is not displayed on top of the props table? (see screenshot above too)(This was done with the Popover component)

A request for a change that I could apply myself in a separate PR if that sounds better:

  1. The size of the icon in the close button should be large. (This would basically require changing line 41 in the Dialog.vue file to )

Thank you! C'mon we're almost there 🙌

ref="simple"
:actions="actions"
style="transform: translate(50%, 50%)"
@action="(_, dialog) => dialog.hide()"
Copy link
Member

Choose a reason for hiding this comment

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

I think so, yes

}
],
visible: true,
dialogText: `Complex dialogs can display extensive information and contain all kinds of interactive elements
Copy link
Member

Choose a reason for hiding this comment

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

I would maybe change the name of this control to content, to make it a little more storybook-user friendly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes, good point

@guergana
Copy link
Contributor Author

guergana commented Dec 1, 2021

A couple of issues:

1. The **overllay is still not displayed behind** the dialog (it's positioned to the bottom right)

Screenshot 2021-12-01 at 17 26 00

2. Is there a way to **increase the size of the canvas in the Docs page** so the Dialog is not displayed on top of the props table? (see screenshot above too)(This was done with the [Popover component](https://wmde.github.io/wikit/?path=/docs/vue_popover--basic))

A request for a change that I could apply myself in a separate PR if that sounds better:

3. The **size of the icon in the close button** should be `large`. (This would basically require changing line 41 in the Dialog.vue file to )

Thank you! C'mon we're almost there raised_hands

Yes, the canvas can be resized, no problem. The button I would suggest yes making a separate PR for that since that's not part of the story itself, but it's a fix to the the dialog component, right?

@@ -12,7 +12,7 @@ export function complex( args: { title: string, actions: string, dismissButton:
components: { Button, Dialog },
props: Object.keys( args ),
template: `
<div>
<div style="height: 70vh;">
Copy link
Member

Choose a reason for hiding this comment

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

what does this fix?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It increases the height of the canvas section in the Docs page, so the Dialog does not overlap with the props table (see my comment above).

Copy link
Member

Choose a reason for hiding this comment

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

oh, yeah, just saw it now

@itamargiv itamargiv requested review from itamargiv and removed request for sai-san December 1, 2021 17:22
itamargiv
itamargiv previously approved these changes Dec 1, 2021
Copy link
Member

@itamargiv itamargiv left a comment

Choose a reason for hiding this comment

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

Approving for now, as the overlay will be fixed in another PR.

Copy link
Member

@itamargiv itamargiv left a comment

Choose a reason for hiding this comment

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

Approving again with the same comment as before

@guergana guergana merged commit fb437b0 into master Dec 2, 2021
@guergana guergana deleted the add-story-dialog branch December 2, 2021 16:14
@sai-san sai-san mentioned this pull request Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants