From fdb7382eb0f641da0b9d27eb167f9248d4e7a67f Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 11 Dec 2023 12:32:33 +0100 Subject: [PATCH] Merge pull request #25152 from Marklb/marklb/update-ng-cli-templates Angular: Update Angular cli templates (cherry picked from commit 986f86be62f935393b32f6ebe4f0fa5b3d5a91b7) --- code/e2e-tests/json-files.spec.ts | 2 +- code/frameworks/angular/template/cli/User.ts | 2 -- .../angular/template/cli/button.component.ts | 3 ++- .../{Button.stories.ts => button.stories.ts} | 11 ++++---- .../angular/template/cli/header.component.ts | 12 ++++++--- .../{Header.stories.ts => header.stories.ts} | 18 +++---------- .../angular/template/cli/page.component.ts | 9 +++++-- .../cli/{Page.stories.ts => page.stories.ts} | 27 ++++--------------- code/frameworks/angular/template/cli/user.ts | 3 +++ 9 files changed, 36 insertions(+), 51 deletions(-) delete mode 100644 code/frameworks/angular/template/cli/User.ts rename code/frameworks/angular/template/cli/{Button.stories.ts => button.stories.ts} (79%) rename code/frameworks/angular/template/cli/{Header.stories.ts => header.stories.ts} (56%) rename code/frameworks/angular/template/cli/{Page.stories.ts => page.stories.ts} (61%) create mode 100644 code/frameworks/angular/template/cli/user.ts diff --git a/code/e2e-tests/json-files.spec.ts b/code/e2e-tests/json-files.spec.ts index d2026a7872b2..f205de3299ed 100644 --- a/code/e2e-tests/json-files.spec.ts +++ b/code/e2e-tests/json-files.spec.ts @@ -23,7 +23,7 @@ test.describe('JSON files', () => { entries: expect.objectContaining({ 'example-button--primary': expect.objectContaining({ id: 'example-button--primary', - importPath: expect.stringContaining('Button.stories'), + importPath: expect.stringMatching(/button\.stories/i), name: 'Primary', title: 'Example/Button', type: 'story', diff --git a/code/frameworks/angular/template/cli/User.ts b/code/frameworks/angular/template/cli/User.ts deleted file mode 100644 index 2f7fcecb5d74..000000000000 --- a/code/frameworks/angular/template/cli/User.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface User {} diff --git a/code/frameworks/angular/template/cli/button.component.ts b/code/frameworks/angular/template/cli/button.component.ts index 28dcc97e5526..badc6bad7f19 100644 --- a/code/frameworks/angular/template/cli/button.component.ts +++ b/code/frameworks/angular/template/cli/button.component.ts @@ -3,6 +3,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'storybook-button', + standalone: true, imports: [CommonModule], template: `