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(ui): non-closeable modal support #236

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

sa-r-ah
Copy link
Contributor

@sa-r-ah sa-r-ah commented Oct 24, 2024

No description provided.

<cvi-ng-icon [name]="'close'" [height]="14"></cvi-ng-icon>
</button>
<ng-template [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="{ $implicit: this, title }"></ng-template>
</div>
<div class="cvi-modal__backdrop" dataAttribute="modal-backdrop" (click)="closeModal()"></div>
<div class="cvi-modal__backdrop" dataAttribute="modal-backdrop" (click)="closeable && closeModal()"></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe move the closeable check into the closeModal() method?

@@ -15,7 +15,7 @@ export const Default = {
<h1>{{ testModalTitle }}</h1>
<p dataAttribute="test-content">Modal content</p>
</ng-template>
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" dataAttribute="test-button">Open modal</cvi-ng-button>
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" closeable="true" dataAttribute="test-button">Open modal</cvi-ng-button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as in confirmation-modal.component.stories.ts, this attribute probably should be turned into a live Storybook control using a closeable arg:

Suggested change
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" closeable="true" dataAttribute="test-button">Open modal</cvi-ng-button>
<cvi-ng-button [cviNgModal]="modal" modalTitle="Some title" [closeable]="closeable" dataAttribute="test-button">Open modal</cvi-ng-button>

@@ -17,6 +17,7 @@ export class ModalComponent implements OnDestroy {
templateRef!: TemplateRef<any>;

title!: string;
closeable!: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the prop have a default value?

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'll put it to true so those that are using it directly wouldn't have to change anything to have same function they have right now

@certainlyakey certainlyakey merged commit dc38053 into e-gov:main Oct 29, 2024
3 checks passed
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