diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index e3088077..4cec7e3c 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -1,5 +1,11 @@ name: Deploy Storybook -on: push +on: + push: + branches: + - '**' + pull_request_target: + branches: + - 'main' jobs: deploy-storybooks: runs-on: ubuntu-latest diff --git a/libs/angular-accelerator/assets/styles.scss b/libs/angular-accelerator/assets/styles.scss index 1f64a1be..3028dca8 100644 --- a/libs/angular-accelerator/assets/styles.scss +++ b/libs/angular-accelerator/assets/styles.scss @@ -1,7 +1,7 @@ /* You can add global styles to this file, and also import other style files */ -@import 'node_modules/primeflex/primeflex.scss'; +@import '/node_modules/primeflex/primeflex.scss'; -@import 'node_modules/@onecx/portal-layout-styles/src/styles/shell/shell.scss'; +@import '/node_modules/@onecx/portal-layout-styles/src/styles/shell/shell.scss'; -@import 'node_modules/@onecx/portal-layout-styles/src/styles/primeng/theme-light.scss'; \ No newline at end of file +@import '/node_modules/@onecx/portal-layout-styles/src/styles/primeng/theme-light.scss'; \ No newline at end of file diff --git a/libs/angular-accelerator/src/lib/directives/src.directive.ts b/libs/angular-accelerator/src/lib/directives/src.directive.ts index 9eb1e6fa..4599294a 100644 --- a/libs/angular-accelerator/src/lib/directives/src.directive.ts +++ b/libs/angular-accelerator/src/lib/directives/src.directive.ts @@ -1,10 +1,13 @@ import { HttpClient } from '@angular/common/http' -import { Directive, ElementRef, Input } from '@angular/core' +import { Directive, ElementRef, EventEmitter, Input, Output } from '@angular/core' @Directive({ selector: '[ocxSrc]' }) export class SrcDirective { private _src: string | undefined + // eslint-disable-next-line @angular-eslint/no-output-native + @Output() error = new EventEmitter() + @Input() get ocxSrc(): string | undefined { return this._src @@ -20,21 +23,27 @@ export class SrcDirective { URL.revokeObjectURL(url) } this.el.nativeElement.src = url + this.el.nativeElement.style.visibility = 'initial' }, error: () => { - this.el.nativeElement.src = 'error' + this.error.emit() + this.el.nativeElement.style.visibility = 'initial' }, }) } else { this.el.nativeElement.src = value + this.el.nativeElement.style.visibility = 'initial' } } catch (error) { console.log('Cannot parse URL ', value, error) this.el.nativeElement.src = value + this.el.nativeElement.style.visibility = 'initial' } this._src = value } } - constructor(private el: ElementRef, private httpClient: HttpClient) {} + constructor(private el: ElementRef, private httpClient: HttpClient) { + this.el.nativeElement.style.visibility = 'hidden' + } } diff --git a/libs/portal-integration-angular/assets/styles.scss b/libs/portal-integration-angular/assets/styles.scss index 41543373..ba4ccf17 100644 --- a/libs/portal-integration-angular/assets/styles.scss +++ b/libs/portal-integration-angular/assets/styles.scss @@ -1,9 +1,8 @@ /* You can add global styles to this file, and also import other style files */ -@import 'node_modules/primeflex/primeflex.scss'; -// @import '../../../node_modules/primeicons/primeicons'; +@import '/node_modules/primeflex/primeflex.scss'; -@import 'node_modules/@onecx/portal-layout-styles/src/styles/shell/shell.scss'; +@import '/node_modules/@onecx/portal-layout-styles/src/styles/shell/shell.scss'; -@import 'node_modules/@onecx/portal-layout-styles/src/styles/primeng/theme-light.scss'; +@import '/node_modules/@onecx/portal-layout-styles/src/styles/primeng/theme-light.scss'; -@import 'node_modules/@onecx/portal-integration-angular/assets/loading-indicator.directive.scss'; \ No newline at end of file +@import '/node_modules/@onecx/portal-integration-angular/assets/loading-indicator.directive.scss'; \ No newline at end of file diff --git a/libs/portal-integration-angular/project.json b/libs/portal-integration-angular/project.json index 9f371811..18c69087 100644 --- a/libs/portal-integration-angular/project.json +++ b/libs/portal-integration-angular/project.json @@ -59,8 +59,15 @@ "libName": "portal-integration-angular" } }, + "copy-additional-styles": { + "executor": "nx:run-commands", + "options": { + "command": "mkdir -p node_modules/@onecx/portal-integration-angular/assets/ && cp libs/portal-integration-angular/src/lib/core/directives/loading-indicator.directive.scss node_modules/@onecx/portal-integration-angular/assets/" + } + }, "storybook": { "executor": "@storybook/angular:start-storybook", + "dependsOn": ["copy-additional-styles"], "options": { "port": 4400, "configDir": "libs/portal-integration-angular/.storybook", @@ -82,6 +89,7 @@ }, "build-storybook": { "executor": "@storybook/angular:build-storybook", + "dependsOn": ["copy-additional-styles"], "outputs": ["{options.outputDir}"], "options": { "outputDir": "dist/storybook/portal-integration-angular", diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.scss b/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.scss index b31da01d..bc2bcfef 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.scss +++ b/libs/portal-integration-angular/src/lib/core/components/portal-page/portal-page.component.scss @@ -1,4 +1,4 @@ -@import '@onecx/styles/shell/_variables.scss'; +@import '@onecx/portal-layout-styles/src/styles/shell/_variables.scss'; :host { display: block; padding: var(--page-padding, 1rem); diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.scss b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.scss index adcf32a0..cdc1d151 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.scss +++ b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.scss @@ -1,4 +1,4 @@ -@import '@onecx/styles/shell/_variables.scss'; +@import '@onecx/portal-layout-styles/src/styles/shell/_variables.scss'; ocx-announcement-banner > div { position: relative; diff --git a/package-lock.json b/package-lock.json index 76e24ca0..ea7ebadb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "4.29.0", + "version": "4.30.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "4.29.0", + "version": "4.30.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -27,7 +27,7 @@ "@ngrx/store-devtools": "^15.3.0", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", - "@onecx/styles": "file:libs/portal-layout-styles/src/styles", + "@onecx/portal-layout-styles": "file:libs/portal-layout-styles/", "axios": "^1.0.0", "chart.js": "^4.4.0", "d3-scale-chromatic": "^3.0.0", @@ -110,7 +110,15 @@ "typescript": "4.9.5" } }, - "libs/portal-layout-styles/src/styles": {}, + "libs/portal-layout-styles": { + "version": "4.30.1", + "peerDependencies": { + "tslib": "^2.5.0" + } + }, + "libs/portal-layout-styles/src/styles": { + "extraneous": true + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "dev": true, @@ -12412,8 +12420,8 @@ "@octokit/openapi-types": "^20.0.0" } }, - "node_modules/@onecx/styles": { - "resolved": "libs/portal-layout-styles/src/styles", + "node_modules/@onecx/portal-layout-styles": { + "resolved": "libs/portal-layout-styles", "link": true }, "node_modules/@open-draft/until": { diff --git a/package.json b/package.json index f8e2a0c8..c69a1e7a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@ngrx/store-devtools": "^15.3.0", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", - "@onecx/styles": "file:libs/portal-layout-styles/src/styles", + "@onecx/portal-layout-styles": "file:libs/portal-layout-styles/", "axios": "^1.0.0", "chart.js": "^4.4.0", "d3-scale-chromatic": "^3.0.0",