Skip to content

Commit

Permalink
[AAE-11496] Publish aca-viewer and aca-preview (#2945)
Browse files Browse the repository at this point in the history
* [AAE-11496] Publish aca-viewer and aca-preview

* fix tests
  • Loading branch information
BSekula committed Jan 31, 2023
1 parent d901479 commit c8e8619
Show file tree
Hide file tree
Showing 37 changed files with 832 additions and 74 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,21 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm test aca-folder-rules -- --browsers=ChromeHeadless --watch=false $TEST_OPTS

test-aca-preview:
needs: [lint, build]
name: 'test: aca-preview'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test aca-preview -- --browsers=ChromeHeadless --watch=false $TEST_OPTS
86 changes: 86 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,92 @@
}
}
}
},
"aca-viewer": {
"projectType": "library",
"root": "projects/aca-viewer",
"sourceRoot": "projects/aca-viewer/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/aca-viewer/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/aca-viewer/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/aca-viewer/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/aca-viewer/src/test.ts",
"tsConfig": "projects/aca-viewer/tsconfig.spec.json",
"karmaConfig": "projects/aca-viewer/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/aca-viewer/**/*.ts",
"projects/aca-viewer/**/*.html"
],
"cache": true,
"cacheLocation": ".eslintcache",
"ignorePath": ".eslintignore"
}
}
}
},
"aca-preview": {
"projectType": "library",
"root": "projects/aca-preview",
"sourceRoot": "projects/aca-preview/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/aca-preview/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/aca-preview/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/aca-preview/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/aca-preview/src/test.ts",
"tsConfig": "projects/aca-preview/tsconfig.spec.json",
"karmaConfig": "projects/aca-preview/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/aca-preview/**/*.ts",
"projects/aca-preview/**/*.html"
],
"cache": true,
"cacheLocation": ".eslintcache",
"ignorePath": ".eslintignore"
}
}
}
}
},
"schematics": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prebuild": "mkdir -p ./app/.tmp && cp ./app/src/app.config.json.tpl ./app/.tmp/app.config.json",
"build": "ng build content-ce",
"build.release": "npm run build -- --configuration=production,release",
"build-libs": "ng build aca-shared && ng build adf-office-services-ext && ng build aca-settings && ng build aca-about ",
"build-libs": "ng build aca-shared && ng build adf-office-services-ext && ng build aca-settings && ng build aca-about && ng build aca-viewer && ng build aca-preview",
"test": "ng test",
"test:ci": "ng test adf-office-services-ext && ng test content-ce --code-coverage",
"lint": "NODE_OPTIONS=--max_old_space_size=4096 ng lint && npm run spellcheck && npm run e2e.typecheck",
Expand Down
2 changes: 1 addition & 1 deletion projects/aca-content/src/lib/aca-content.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { CommentsTabComponent } from './components/info-drawer/comments-tab/comm
import { LibraryMetadataTabComponent } from './components/info-drawer/library-metadata-tab/library-metadata-tab.component';
import { MetadataTabComponent } from './components/info-drawer/metadata-tab/metadata-tab.component';
import { VersionsTabComponent } from './components/info-drawer/versions-tab/versions-tab.component';
import { PreviewComponent } from './components/preview/preview.component';
import { PreviewComponent } from '@alfresco/aca-preview';
import { DocumentDisplayModeComponent } from './components/toolbar/document-display-mode/document-display-mode.component';
import { ToggleEditOfflineComponent } from './components/toolbar/toggle-edit-offline/toggle-edit-offline.component';
import { ToggleFavoriteLibraryComponent } from './components/toolbar/toggle-favorite-library/toggle-favorite-library.component';
Expand Down
57 changes: 30 additions & 27 deletions projects/aca-content/src/lib/aca-content.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const CONTENT_ROUTES: ExtensionRoute[] = [
children: [
{
path: '',
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand Down Expand Up @@ -123,7 +123,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'personal-files'
}
Expand All @@ -137,7 +137,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'personal-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -150,7 +150,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'personal-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -176,22 +176,22 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'personal-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'personal-files'
}
},
// deprecated, backwards compatibility with ACA 1.8
{
path: ':folderId/preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'personal-files'
}
Expand All @@ -205,7 +205,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'personal-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand Down Expand Up @@ -238,7 +238,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'libraries'
}
Expand All @@ -252,9 +252,12 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'libraries'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
],
data: {
navigateSource: 'libraries'
}
},
{
path: 'view/:nodeId/:versionId',
Expand All @@ -265,7 +268,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'libraries'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand Down Expand Up @@ -309,7 +312,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'libraries'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -322,7 +325,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'libraries'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -347,7 +350,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'favorites'
}
Expand All @@ -361,7 +364,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'favorites'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -374,7 +377,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'favorites'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -398,7 +401,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'recent-files'
}
Expand All @@ -412,7 +415,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'recent-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -425,7 +428,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'recent-files'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -447,7 +450,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'shared'
}
Expand All @@ -461,7 +464,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'shared'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -474,7 +477,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'shared'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -499,7 +502,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
// deprecated, backwards compatibility with ACA 1.8
{
path: 'preview/:nodeId',
loadChildren: () => import('./components/preview/preview.module').then((m) => m.PreviewModule),
loadChildren: () => import('@alfresco/aca-preview').then((m) => m.PreviewModule),
data: {
navigateSource: 'search'
}
Expand All @@ -513,7 +516,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'search'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
},
Expand All @@ -526,7 +529,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'search'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand All @@ -551,7 +554,7 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
data: {
navigateSource: 'search'
},
loadChildren: () => import('./components/viewer/viewer.module').then((m) => m.AppViewerModule)
loadChildren: () => import('@alfresco/aca-viewer').then((m) => m.AcaViewerModule)
}
]
}
Expand Down

0 comments on commit c8e8619

Please sign in to comment.