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

fix(pie-modal): DSW-2208 add logging #1608

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nice-steaks-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@justeattakeaway/pie-modal": minor
---

[Changed] - SSR testing
18 changes: 17 additions & 1 deletion packages/components/pie-modal/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
public isOpen = defaultProps.isOpen;

@property({ type: Object })
public leadingAction!: ActionProps;
public leadingAction: ModalProps['leadingAction'];

@property()
@validPropertyValues(componentSelector, positions, defaultProps.position)
Expand All @@ -111,6 +111,14 @@
// Renders a `CSSResult` generated from SCSS by Vite
static styles = unsafeCSS(styles);

constructor () {
super();
console.log('isOpen in constructor', this.isOpen);

Check warning on line 116 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('leadingAction in constructor', this.leadingAction);

Check warning on line 117 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('position in constructor', this.position);

Check warning on line 118 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('size in constructor', this.size);

Check warning on line 119 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
}

connectedCallback () : void {
super.connectedCallback();
this.addEventListener('click', (event) => this._handleDialogLightDismiss(event));
Expand All @@ -127,6 +135,10 @@
}

async firstUpdated (changedProperties: PropertyValues<this>) : Promise<void> {
console.log('isOpen in firstUpdated', this.isOpen);

Check warning on line 138 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('leadingAction in firstUpdated', this.leadingAction);

Check warning on line 139 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('position in firstUpdated', this.position);

Check warning on line 140 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
console.log('size in firstUpdated', this.size);

Check warning on line 141 in packages/components/pie-modal/src/index.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected console statement
super.firstUpdated(changedProperties);

if (this._dialog) {
Expand Down Expand Up @@ -300,6 +312,10 @@
* @private
*/
private renderLeadingAction () : TemplateResult | typeof nothing {
if (!this.leadingAction) {
return nothing;
}

const { text, variant = 'primary', ariaLabel } = this.leadingAction;

if (!text) {
Expand Down
Loading