Skip to content

Commit

Permalink
[AAE-11496] Make aca-content buildable (#2859)
Browse files Browse the repository at this point in the history
  • Loading branch information
BSekula committed Jan 31, 2023
1 parent c8e8619 commit 93cc64b
Show file tree
Hide file tree
Showing 42 changed files with 92 additions and 58 deletions.
7 changes: 7 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@
"glob": "**/*",
"input": "projects/aca-folder-rules/assets",
"output": "./assets/aca-folder-rules"
},
{
"glob": "**/*",
"input": "projects/aca-content/assets",
"output": "./assets"
}

],
"styles": [
"app/src/assets/fonts/material-icons/material-icons.css",
Expand Down Expand Up @@ -282,6 +288,7 @@
"assets": [
"app/src/assets",
"app/src/favicon-96x96.png",
"projects/aca-content/assets",
{
"input": "app/.tmp",
"output": "/",
Expand Down
5 changes: 4 additions & 1 deletion app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import { ContentVersionService } from '@alfresco/adf-content-services';
import { STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store';
import { ShellModule, SHELL_APP_SERVICE, SHELL_AUTH_TOKEN } from '@alfresco/adf-core/shell';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { APP_ROUTES } from './app.routes';
import { AppLoginModule } from './components/login/login.module';

registerLocaleData(localeFr);
registerLocaleData(localeDe);
Expand All @@ -89,9 +91,10 @@ registerLocaleData(localeSv);
CoreModule.forRoot(),
SharedModule.forRoot(),
CoreExtensionsModule.forRoot(),
AppLoginModule,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
!environment.production ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [],
RouterModule.forRoot([], {
RouterModule.forRoot(APP_ROUTES, {
useHash: true,
enableTracing: false, // enable for debug only
relativeLinkResolution: 'legacy'
Expand Down
16 changes: 16 additions & 0 deletions app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BlankPageComponent } from '@alfresco/adf-core';
import { LoginComponent } from './components/login/login.component';

export const APP_ROUTES = [
{
path: 'blank',
component: BlankPageComponent
},
{
path: 'login',
component: LoginComponent,
data: {
title: 'APP.SIGN_IN'
}
}
];
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 && ng build aca-viewer && ng build aca-preview",
"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 && ng build aca-folder-rules && ng build aca-content",
"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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
16 changes: 11 additions & 5 deletions projects/aca-content/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/aca-content",
"dest": "../../dist/@alfresco/aca-content",
"lib": {
"styleIncludePaths": [
"projects/aca-content/src/lib/ui"
],
"styleIncludePaths": ["projects/aca-content/src/lib/ui"],
"entryFile": "src/public-api.ts"
}
},
"assets": [
{
"glob": "**/*",
"input": "./src/lib/ui/",
"output": "ui"
},
"assets"
]
}
5 changes: 4 additions & 1 deletion projects/aca-content/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "aca-content",
"name": "@alfresco/aca-content",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^14.1.0",
"@angular/core": "^14.1.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"publishConfig": {
"access": "public"
}
}
10 changes: 7 additions & 3 deletions projects/aca-content/src/lib/aca-content.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import { AppLayoutModule } from './components/layout/layout.module';
import { AppSearchInputModule } from './components/search/search-input.module';
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
import { AppSearchResultsModule } from './components/search/search-results.module';
import { AppLoginModule } from './components/login/login.module';
import { AppHeaderModule } from './components/header/header.module';
import { AppNodeVersionModule } from './components/node-version/node-version.module';
import { FavoritesComponent } from './components/favorites/favorites.component';
Expand Down Expand Up @@ -118,6 +117,9 @@ import { RouterModule } from '@angular/router';
import { UploadFilesDialogComponent } from './components/upload-files-dialog/upload-files-dialog.component';
import { SidenavWrapperComponent } from './components/sidenav/sidenav-wrapper/sidenav-wrapper.component';
import { AppLayoutComponent } from './components/layout/app-layout/app-layout.component';
import { AppTrashcanModule } from './components/trashcan/trashcan.module';
import { AppSharedLinkViewModule } from './components/shared-link-view/shared-link-view.module';
import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules';

registerLocaleData(localeFr);
registerLocaleData(localeDe);
Expand Down Expand Up @@ -149,7 +151,6 @@ registerLocaleData(localeSv);
SharedModule,
MaterialModule,
AppStoreModule,
AppLoginModule,
AppCommonModule,
AppLayoutModule,
DirectivesModule,
Expand All @@ -164,7 +165,10 @@ registerLocaleData(localeSv);
AppHeaderModule,
AppNodeVersionModule,
HammerModule,
ViewProfileModule
ViewProfileModule,
AppTrashcanModule,
AppSharedLinkViewModule,
AcaFolderRulesModule
],
declarations: [
FilesComponent,
Expand Down
37 changes: 22 additions & 15 deletions projects/aca-content/src/lib/aca-content.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,30 @@ import { FavoriteLibrariesComponent } from './components/favorite-libraries/favo
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component';
import { AppSharedRuleGuard, GenericErrorComponent, ExtensionRoute, ExtensionsDataLoaderGuard } from '@alfresco/aca-shared';
import { AuthGuard, BlankPageComponent } from '@alfresco/adf-core';
import { AuthGuard } from '@alfresco/adf-core';
import { FavoritesComponent } from './components/favorites/favorites.component';
import { RecentFilesComponent } from './components/recent-files/recent-files.component';
import { SharedFilesComponent } from './components/shared-files/shared-files.component';
import { DetailsComponent } from './components/details/details.component';
import { HomeComponent } from './components/home/home.component';
import { ViewProfileComponent } from './components/view-profile/view-profile.component';
import { ViewProfileRuleGuard } from './components/view-profile/view-profile.guard';
import { LoginComponent } from './components/login/login.component';
import { Route } from '@angular/router';
import { SharedLinkViewComponent } from './components/shared-link-view/shared-link-view.component';
import { TrashcanComponent } from './components/trashcan/trashcan.component';

export const CONTENT_ROUTES: ExtensionRoute[] = [
{
path: 'blank',
component: BlankPageComponent
},
{
path: 'preview/s/:id',
loadChildren: () => import('./components/shared-link-view/shared-link-view.module').then((m) => m.AppSharedLinkViewModule)
},
{
path: 'login',
component: LoginComponent,
data: {
title: 'APP.SIGN_IN'
}
children: [
{
path: '',
component: SharedLinkViewComponent,
data: {
title: 'APP.PREVIEW.TITLE'
}
}
]
},
{
path: 'view',
Expand Down Expand Up @@ -487,7 +485,16 @@ export const CONTENT_LAYOUT_ROUTES: Route = {
},
{
path: 'trashcan',
loadChildren: () => import('./components/trashcan/trashcan.module').then((m) => m.AppTrashcanModule)
children: [
{
path: '',
component: TrashcanComponent,
data: {
title: 'APP.BROWSE.TRASHCAN.TITLE',
sortingPreferenceKey: 'trashcan'
}
}
]
},
{
path: 'search',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,16 @@ import { NgModule } from '@angular/core';
import { SharedLinkViewComponent } from './shared-link-view.component';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { RouterModule, Routes } from '@angular/router';
import { DirectivesModule } from '../../directives/directives.module';
import { AppCommonModule } from '../common/common.module';
import { AppToolbarModule } from '../toolbar/toolbar.module';
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';

const routes: Routes = [
{
path: '',
component: SharedLinkViewComponent,
data: {
title: 'APP.PREVIEW.TITLE'
}
}
];

@NgModule({
imports: [
CommonModule,
CoreModule.forChild(),
RouterModule.forChild(routes),
DirectivesModule,
AppCommonModule,
AppToolbarModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,17 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import { TrashcanComponent } from './trashcan.component';
import { Routes, RouterModule } from '@angular/router';
import { ContentModule } from '@alfresco/adf-content-services';
import { AppCommonModule } from '../common/common.module';
import { AppToolbarModule } from '../toolbar/toolbar.module';
import { DirectivesModule } from '../../directives/directives.module';
import { ContextMenuModule } from '../context-menu/context-menu.module';
import { AppLayoutModule } from '../layout/layout.module';

const routes: Routes = [
{
path: '',
component: TrashcanComponent,
data: {
title: 'APP.BROWSE.TRASHCAN.TITLE',
sortingPreferenceKey: 'trashcan'
}
}
];

@NgModule({
imports: [
CommonModule,
CoreModule.forChild(),
RouterModule.forChild(routes),
ContentModule.forChild(),
DirectivesModule,
AppCommonModule,
Expand Down
10 changes: 9 additions & 1 deletion projects/aca-content/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
"declarationMap": false,
"paths": {
"@alfresco/aca-shared": ["dist/@alfresco/aca-shared"],
"@alfresco/aca-shared/store": ["dist/@alfresco/aca-shared/store"],
"@alfresco/aca-shared/rules": ["dist/@alfresco/aca-shared/rules"],
"@alfresco/aca-folder-rules": ["dist/@alfresco/aca-folder-rules"],
"@alfresco/aca-viewer": ["dist/@alfresco/aca-viewer"],
"@alfresco/aca-preview": ["dist/@alfresco/aca-preview"]
},
},
"angularCompilerOptions": {
"compilationMode": "partial"
Expand Down
7 changes: 5 additions & 2 deletions projects/aca-folder-rules/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/aca-folder-rules",
"dest": "../../dist/@alfresco/aca-folder-rules",
"lib": {
"entryFile": "src/public-api.ts"
}
},
"assets": [
"assets"
]
}
2 changes: 1 addition & 1 deletion projects/aca-folder-rules/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "aca-folder-rules",
"name": "@alfresco/aca-folder-rules",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^14.1.0",
Expand Down
6 changes: 3 additions & 3 deletions projects/aca-folder-rules/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"compilerOptions": {
"declarationMap": false,
"paths": {
"@alfresco/aca-shared": ["dist/aca-shared"],
"@alfresco/aca-shared/store": ["dist/aca-shared/store"],
"@alfresco/aca-shared/rules": ["dist/aca-shared/rules"]
"@alfresco/aca-shared": ["dist/@alfresco/aca-shared"],
"@alfresco/aca-shared/store": ["dist/@alfresco/aca-shared/store"],
"@alfresco/aca-shared/rules": ["dist/@alfresco/aca-shared/rules"]
}
},
"angularCompilerOptions": {
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/npm/publish-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ echo -e "Branch is '$TRAVIS_BRANCH', therefore publish with '$TAG_NPM' tag\n"

PROJECTS=(
'aca-shared'
'aca-folder-rules'
'adf-office-services-ext'
'aca-settings'
'aca-about'
'aca-preview'
'aca-viewer'
'aca-content'
);

for PROJECT in "${PROJECTS[@]}"
Expand Down

0 comments on commit 93cc64b

Please sign in to comment.