[MNT-21386] about extension ()

* separate project for about extension

* move components to the about project

* remove about from the app

* update travis

* fix lint
This commit is contained in:
Denys Vuika 2020-09-16 08:48:17 +01:00 committed by GitHub
parent e3cbddb465
commit 6612a702c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 344 additions and 76 deletions

@ -54,17 +54,22 @@ jobs:
cache: false
- stage: Quality and Unit tests
name: 'Unit tests aos'
name: 'Unit tests: aos'
script: npm ci && ng test adf-office-services-ext --watch=false
cache: false
- stage: Quality and Unit tests
name: 'Unit tests shared'
name: 'Unit tests: aca-shared'
script: npm ci && ng test aca-shared --watch=false
cache: false
- stage: Quality and Unit tests
name: 'Unit tests ACA'
name: 'Unit tests: aca-about'
script: npm ci && ng test aca-about --watch=false
cache: false
- stage: Quality and Unit tests
name: 'Unit tests: ACA'
script:
- npm ci
- ng test app --code-coverage --watch=false

@ -383,6 +383,46 @@
"sourceRoot": "projects/aca-testing-shared/src",
"projectType": "library",
"prefix": "lib"
},
"aca-about": {
"projectType": "library",
"root": "projects/aca-about",
"sourceRoot": "projects/aca-about/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/aca-about/tsconfig.lib.json",
"project": "projects/aca-about/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/aca-about/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/aca-about/src/test.ts",
"tsConfig": "projects/aca-about/tsconfig.spec.json",
"karmaConfig": "projects/aca-about/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/aca-about/tsconfig.lib.json",
"projects/aca-about/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "app",

@ -0,0 +1,24 @@
# AcaAbout
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.14.
## Code scaffolding
Run `ng generate component component-name --project aca-about` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-about`.
> Note: Don't forget to add `--project aca-about` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build aca-about` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build aca-about`, go to the dist folder `cd dist/aca-about` and run `npm publish`.
## Running unit tests
Run `ng test aca-about` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/aca-about'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

@ -0,0 +1,7 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/aca-about",
"lib": {
"entryFile": "src/public-api.ts"
}
}

@ -0,0 +1,11 @@
{
"name": "@alfresco/aca-about",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^10.0.14",
"@angular/core": "^10.0.14"
},
"dependencies": {
"tslib": "^2.0.0"
}
}

@ -2,21 +2,12 @@
<aca-page-layout-content [scrollable]="true">
<div class="main-content">
<article>
<adf-about-github-link
[application]="'application.name' | adfAppConfig"
[url]="appRepoUrl"
[version]="'application.version' | adfAppConfig"
>
<adf-about-github-link [application]="'application.name' | adfAppConfig" [url]="appRepoUrl" [version]="'application.version' | adfAppConfig">
</adf-about-github-link>
</article>
<article>
<adf-about-github-link
[application]="'ADF'"
[url]="adfRepoUrl"
[version]="adfVersion"
>
</adf-about-github-link>
<adf-about-github-link [application]="'ADF'" [url]="adfRepoUrl" [version]="adfVersion"> </adf-about-github-link>
</article>
<ng-container *ngIf="extensions$ | async as extensions">

@ -24,30 +24,27 @@
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AboutComponent } from './about.component';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { AppLayoutModule } from '../layout/layout.module';
import { MatTableModule } from '@angular/material/table';
import { SharedModule, PageLayoutModule } from '@alfresco/aca-shared';
import { PackageListComponent } from './package-list/package-list.component';
import { ExtensionListComponent } from './extension-list/extension-list.component';
import { StatusListComponent } from './status-list/status-list.component';
import { ModuleListComponent } from './module-list/module-list.component';
import { LicenseListComponent } from './license-list/license-list.component';
const routes: Routes = [
{
path: '',
component: AboutComponent,
data: {
title: 'APP.BROWSE.ABOUT.TITLE'
}
}
];
import { ExtensionService } from '@alfresco/adf-extensions';
@NgModule({
imports: [CommonModule, CoreModule.forChild(), RouterModule.forChild(routes), AppLayoutModule, MatTableModule],
imports: [CommonModule, CoreModule.forChild(), MatTableModule, SharedModule, PageLayoutModule],
declarations: [AboutComponent, PackageListComponent, ExtensionListComponent, StatusListComponent, ModuleListComponent, LicenseListComponent]
})
export class AboutModule {}
export class AcaAboutModule {
constructor(extensions: ExtensionService) {
extensions.setComponents({
'app.about.component': AboutComponent
});
}
}

@ -1,8 +1,5 @@
<mat-table [dataSource]="data">
<ng-container
*ngFor="let column of columns"
[matColumnDef]="column.columnDef"
>
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<mat-header-cell *matHeaderCellDef>
{{ column.header | translate }}
</mat-header-cell>

@ -1,8 +1,5 @@
<mat-table [dataSource]="data">
<ng-container
*ngFor="let column of columns"
[matColumnDef]="column.columnDef"
>
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<mat-header-cell *matHeaderCellDef>
{{ column.header | translate }}
</mat-header-cell>

@ -1,8 +1,5 @@
<mat-table [dataSource]="data">
<ng-container
*ngFor="let column of columns"
[matColumnDef]="column.columnDef"
>
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<mat-header-cell *matHeaderCellDef>
{{ column.header | translate }}
</mat-header-cell>

@ -1,8 +1,5 @@
<mat-table [dataSource]="data">
<ng-container
*ngFor="let column of columns"
[matColumnDef]="column.columnDef"
>
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<mat-header-cell *matHeaderCellDef>
{{ column.header | translate }}
</mat-header-cell>

@ -1,8 +1,5 @@
<mat-table [dataSource]="data">
<ng-container
*ngFor="let column of columns"
[matColumnDef]="column.columnDef"
>
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<mat-header-cell *matHeaderCellDef>
{{ column.header | translate }}
</mat-header-cell>

@ -0,0 +1,32 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
export * from './lib/extension-list/extension-list.component';
export * from './lib/license-list/license-list.component';
export * from './lib/module-list/module-list.component';
export * from './lib/package-list/package-list.component';
export * from './lib/status-list/status-list.component';
export * from './lib/about.component';
export * from './lib/aca-about.module';

@ -0,0 +1,49 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

@ -0,0 +1,24 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}

@ -0,0 +1,7 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

@ -0,0 +1,17 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

@ -0,0 +1,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
["lib", "aca", "app", "adf"],
"camelCase"
],
"component-selector": [
true,
"element",
["lib", "aca", "app", "adf"],
"kebab-case"
]
}
}

@ -431,10 +431,6 @@ export const APP_ROUTES: Routes = [
path: 'trashcan',
loadChildren: () => import('./components/trashcan/trashcan.module').then((m) => m.AppTrashcanModule)
},
{
path: 'about',
loadChildren: () => import('./components/about/about.module').then((m) => m.AboutModule)
},
{
path: 'search',
children: [

@ -25,11 +25,12 @@
import { NgModule } from '@angular/core';
import { AosExtensionModule } from '@alfresco/adf-office-services-ext';
import { AcaAboutModule } from '@alfresco/aca-about';
// Main entry point for external extensions only.
// For any application-specific code use CoreExtensionsModule instead.
@NgModule({
imports: [AosExtensionModule]
imports: [AosExtensionModule, AcaAboutModule]
})
export class AppExtensionsModule {}

@ -7,7 +7,7 @@
"$license": "LGPL-3.0",
"$runtime": "1.7.0",
"$description": "Core application extensions and features",
"$references": ["aos.plugin.json", "app.header.json"],
"$references": ["aos.plugin.json", "app.header.json", "app.about.json"],
"settings": [
{

@ -0,0 +1,46 @@
{
"$schema": "../../../extension.schema.json",
"$id": "app.about",
"$name": "app.about",
"$version": "1.0.0",
"$vendor": "Alfresco Software, Ltd.",
"$license": "LGPL-3.0",
"$description": "Application About Screen",
"actions": [
{
"id": "app.actions.about",
"type": "NAVIGATE_URL",
"payload": "/about"
}
],
"routes": [
{
"id": "app.about",
"path": "about",
"layout": "app.layout.main",
"component": "app.about.component"
}
],
"features": {
"header": [
{
"id": "app.header.more",
"children": [
{
"id": "app.header.about",
"order": 100,
"title": "APP.BROWSE.ABOUT.TITLE",
"description": "APP.BROWSE.ABOUT.TITLE",
"icon": "info",
"actions": {
"click": "app.actions.about"
}
}
]
}
]
}
}

@ -8,14 +8,6 @@
"$runtime": "1.5.0",
"$description": "Sample app header extension",
"actions": [
{
"id": "app.actions.about",
"type": "NAVIGATE_URL",
"payload": "/about"
}
],
"features": {
"userActions": [
{
@ -49,19 +41,7 @@
"type": "menu",
"order": 10000,
"icon": "more_vert",
"title": "APP.ACTIONS.MORE",
"children": [
{
"id": "app.header.about",
"order": 100,
"title": "APP.BROWSE.ABOUT.TITLE",
"description": "APP.BROWSE.ABOUT.TITLE",
"icon": "info",
"actions": {
"click": "app.actions.about"
}
}
]
"title": "APP.ACTIONS.MORE"
}
]
}

@ -24,7 +24,8 @@
"@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public-api.ts"],
"@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public-api.ts"],
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"]
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"]
}
},
"exclude": ["node_modules"],

@ -30,6 +30,12 @@
},
{
"path": "./projects/adf-office-services-ext/tsconfig.spec.json"
},
{
"path": "./projects/aca-about/tsconfig.lib.json"
},
{
"path": "./projects/aca-about/tsconfig.spec.json"
}
]
}