Upgrading NX and start fixing styles

This commit is contained in:
Vito Albano
2023-11-14 01:10:57 +00:00
committed by VitoAlbano
parent 3e3794ac6c
commit cd49d1d730
50 changed files with 1429 additions and 232 deletions

View File

@@ -5,5 +5,5 @@ module.exports = {
core: { ...rootMain.core, builder: 'webpack5' },
stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: [...rootMain.staticDirs, { from: __dirname + '/../src/lib/i18n', to: 'assets/adf-content-services/i18n' }],
addons: [...rootMain.addons]
addons: ['@storybook/addon-essentials', ...rootMain.addons]
};

View File

@@ -0,0 +1,111 @@
{
"name": "content-services",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "lib/content-services/src",
"projectType": "library",
"prefix": "adf",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "lib/content-services/tsconfig.lib.json",
"project": "lib/content-services/ng-package.json"
},
"configurations": {
"production": {
"project": "lib/content-services/ng-package.json",
"tsConfig": "lib/content-services/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@angular-devkit/build-angular:karma",
"options": {
"main": "lib/content-services/src/test.ts",
"tsConfig": "lib/content-services/tsconfig.spec.json",
"karmaConfig": "lib/content-services/karma.conf.js",
"sourceMap": true,
"codeCoverage": true,
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"]
}
},
"storybook": {
"executor": "@storybook/angular:start-storybook",
"options": {
"port": 4400,
"browserTarget": "content-services:storybook",
"configDir": "lib/content-services/.storybook",
"compodoc": false,
"styles": [
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"build-storybook": {
"executor": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "content-services:build-storybook",
"configDir": "lib/content-services/.storybook",
"outputDir": "dist/storybook/content-services",
"compodoc": false,
"styles": [
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"stylelint": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npx stylelint lib/content-services/**/*.scss --config stylelint-config.json"
}
]
}
},
"npm-publish": {
"executor": "nx:run-commands",
"dependsOn": ["build"],
"options": {
"cwd": "dist/libs/content-services",
"commands": [
{
"command": "npm publish --tag {args.tag}",
"forwardAllArgs": true
}
]
}
}
}
}

View File

@@ -21,7 +21,7 @@ import { RoleModel } from '../../models/role.model';
@Component({
selector: 'adf-user-role-column',
template: `
<mat-form-field floatLabel="never" class="adf-role-selector-field" *ngIf="!readonly">
<mat-form-field class="adf-role-selector-field" *ngIf="!readonly">
<mat-select
(click)="$event.stopPropagation()"
[placeholder]="placeholder | translate"
@@ -44,12 +44,12 @@ import { RoleModel } from '../../models/role.model';
`.adf-role-selector-field {
width: 100%;
}
.adf-role-selector-field .mat-mdc-form-field {
width: 100%;
max-width: 200px;
}
.adf-readonly-role {
padding-left: 0 !important;
}

View File

@@ -167,7 +167,7 @@ export class SearchControlComponent implements OnDestroy {
if (this.listResultElement && this.listResultElement.length > 0) {
const firstElement = this.listResultElement.first as MatListItem;
// eslint-disable-next-line no-underscore-dangle
firstElement._getHostElement().focus();
firstElement._hostElement.focus();
}
}

View File

@@ -13,7 +13,6 @@
/>
<button
*ngIf="field.buckets.filterText"
mat-button
matSuffix
mat-icon-button
[attr.title]="'SEARCH.FILTER.BUTTONS.CLEAR' | translate"

View File

@@ -2,9 +2,14 @@
[min]="min"
[max]="max"
[step]="step"
[thumbLabel]="thumbLabel"
class="adf-search-slider"
data-automation-id="slider-range" #ngSlider><input matSliderThumb (change)="onChangedHandler({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value})" #ngSliderThumb="matSliderThumb" [(value)]="value" />
data-automation-id="slider-range" #ngSlider>
<input
matSliderThumb
(change)="onChangedHandler({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value})"
#ngSliderThumb="matSliderThumb"
[(value)]="value" />
<input *ngIf="thumbLabel" matSliderThumb>
</mat-slider>
<div class="adf-facet-buttons" *ngIf="!settings?.hideDefaultAction">

View File

@@ -18,25 +18,12 @@
import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(), {
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
});
declare const pdfjsLib: any;
pdfjsLib.GlobalWorkerOptions.workerSrc = 'base/pdfjs-dist/build/pdf.worker.min.js';
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -11,6 +11,8 @@
"@alfresco/adf-core/*": ["../../../dist/libs/core/*"],
"@alfresco/js-api": ["../../../dist/libs/js-api"],
"@alfresco/js-api/*": ["../../../dist/libs/js-api/*"]
}
},
"target": "ES2022",
"useDefineForClassFields": false
}
}

View File

@@ -1,7 +1,9 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
"declarationMap": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"

View File

@@ -1,7 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc"
"outDir": "../../dist/out-tsc",
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/test.ts"],
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]