mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
AAE-36580 bootstrap as standalone app (#4667)
This commit is contained in:
@@ -25,13 +25,15 @@
|
|||||||
import { Component, ViewEncapsulation } from '@angular/core';
|
import { Component, ViewEncapsulation } from '@angular/core';
|
||||||
import { AppService } from '@alfresco/aca-shared';
|
import { AppService } from '@alfresco/aca-shared';
|
||||||
import { MatIconRegistry } from '@angular/material/icon';
|
import { MatIconRegistry } from '@angular/material/icon';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.scss'],
|
styleUrls: ['./app.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
standalone: false
|
standalone: true,
|
||||||
|
imports: [RouterOutlet]
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -22,8 +22,7 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { importProvidersFrom, ApplicationConfig } from '@angular/core';
|
||||||
import { importProvidersFrom, NgModule } from '@angular/core';
|
|
||||||
import { provideNoopAnimations, provideAnimations } from '@angular/platform-browser/animations';
|
import { provideNoopAnimations, provideAnimations } from '@angular/platform-browser/animations';
|
||||||
import { AuthGuard, CoreModule, AuthModule, provideTranslations } from '@alfresco/adf-core';
|
import { AuthGuard, CoreModule, AuthModule, provideTranslations } from '@alfresco/adf-core';
|
||||||
import { AppService } from '@alfresco/aca-shared';
|
import { AppService } from '@alfresco/aca-shared';
|
||||||
@@ -46,12 +45,10 @@ import localePl from '@angular/common/locales/pl';
|
|||||||
import localeFi from '@angular/common/locales/fi';
|
import localeFi from '@angular/common/locales/fi';
|
||||||
import localeDa from '@angular/common/locales/da';
|
import localeDa from '@angular/common/locales/da';
|
||||||
import localeSv from '@angular/common/locales/sv';
|
import localeSv from '@angular/common/locales/sv';
|
||||||
import { RouterModule } from '@angular/router';
|
import { provideRouter, withHashLocation } from '@angular/router';
|
||||||
import { AppComponent } from './app.components';
|
import { CONTENT_LAYOUT_ROUTES, ContentServiceExtensionModule, ContentUrlService, provideExtensions } from '@alfresco/aca-content';
|
||||||
import { CONTENT_LAYOUT_ROUTES, ContentServiceExtensionModule, ContentUrlService, CoreExtensionsModule } from '@alfresco/aca-content';
|
|
||||||
import { ContentVersionService } from '@alfresco/adf-content-services';
|
import { ContentVersionService } from '@alfresco/adf-content-services';
|
||||||
import { SHELL_APP_SERVICE, SHELL_AUTH_TOKEN, provideShellRoutes } from '@alfresco/adf-core/shell';
|
import { SHELL_APP_SERVICE, SHELL_AUTH_TOKEN, provideShellRoutes } from '@alfresco/adf-core/shell';
|
||||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
||||||
import { APP_ROUTES } from './app.routes';
|
import { APP_ROUTES } from './app.routes';
|
||||||
|
|
||||||
registerLocaleData(localeFr);
|
registerLocaleData(localeFr);
|
||||||
@@ -71,20 +68,11 @@ registerLocaleData(localeFi);
|
|||||||
registerLocaleData(localeDa);
|
registerLocaleData(localeDa);
|
||||||
registerLocaleData(localeSv);
|
registerLocaleData(localeSv);
|
||||||
|
|
||||||
@NgModule({
|
export const AppConfig: ApplicationConfig = {
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
CoreModule.forRoot(),
|
|
||||||
CoreExtensionsModule.forRoot(),
|
|
||||||
!environment.production ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [],
|
|
||||||
RouterModule.forRoot(APP_ROUTES, {
|
|
||||||
useHash: true,
|
|
||||||
enableTracing: false // enable for debug only
|
|
||||||
}),
|
|
||||||
AppExtensionsModule,
|
|
||||||
ContentServiceExtensionModule
|
|
||||||
],
|
|
||||||
providers: [
|
providers: [
|
||||||
|
importProvidersFrom(CoreModule.forRoot(), AppExtensionsModule, ContentServiceExtensionModule),
|
||||||
|
provideExtensions(),
|
||||||
|
provideRouter(APP_ROUTES, withHashLocation()),
|
||||||
environment.e2e ? provideNoopAnimations() : provideAnimations(),
|
environment.e2e ? provideNoopAnimations() : provideAnimations(),
|
||||||
provideShellRoutes(CONTENT_LAYOUT_ROUTES),
|
provideShellRoutes(CONTENT_LAYOUT_ROUTES),
|
||||||
{ provide: ContentVersionService, useClass: ContentUrlService },
|
{ provide: ContentVersionService, useClass: ContentUrlService },
|
||||||
@@ -98,8 +86,5 @@ registerLocaleData(localeSv);
|
|||||||
},
|
},
|
||||||
provideTranslations('app', 'assets'),
|
provideTranslations('app', 'assets'),
|
||||||
importProvidersFrom(AuthModule.forRoot({ useHash: true }))
|
importProvidersFrom(AuthModule.forRoot({ useHash: true }))
|
||||||
],
|
]
|
||||||
declarations: [AppComponent],
|
};
|
||||||
bootstrap: [AppComponent]
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
@@ -23,13 +23,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
|
||||||
import { environment } from './environments/environment';
|
import { environment } from './environments/environment';
|
||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { AppComponent } from './app/app.components';
|
||||||
|
import { AppConfig } from './app/app.config';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void platformBrowserDynamic().bootstrapModule(AppModule);
|
void (async () => {
|
||||||
|
await bootstrapApplication(AppComponent, AppConfig);
|
||||||
|
})();
|
||||||
|
@@ -27,54 +27,47 @@ See the official [Nx Angular library](https://nx.dev/nx-api/angular/generators/l
|
|||||||
Next to validate the changed verify the following:
|
Next to validate the changed verify the following:
|
||||||
|
|
||||||
- Check in `tsconfig.base.json` that an import path exists and points to the correct entry point:
|
- Check in `tsconfig.base.json` that an import path exists and points to the correct entry point:
|
||||||
|
-
|
||||||
```json
|
```json
|
||||||
"@myorg/my-extension": ["extensions/my-extension/src/index.ts"],
|
{
|
||||||
|
"paths" : {
|
||||||
|
"@myorg/my-extension": [
|
||||||
|
"extensions/my-extension/src/index.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- Test if npm i is working:
|
- Test if npm i is working:
|
||||||
|
|
||||||
# Developing the basics of the ACA extension
|
# Developing the basics of the ACA extension
|
||||||
|
|
||||||
Now that the `my-extension` is created, let's add the proper configuration to the extension module. For this purpose, edit the `extensions/my-extension/src/lib/my-extension.module.ts` file changing what is described below.
|
Now that the `my-extension` is created, let's add the proper configuration to the extension module.
|
||||||
|
For this purpose, edit the `extensions/my-extension/src/lib/my-extension.module.ts` file changing what is described below:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
|
|
||||||
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
||||||
import { CoreModule, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
|
import { provideTranslations } from '@alfresco/adf-core';
|
||||||
|
|
||||||
import { MyExtensionComponent } from './my-extension.component';
|
import { MyExtensionComponent } from './my-extension.component';
|
||||||
import { MyExtensionService } from './my-extension.service';
|
import { MyExtensionService } from './my-extension.service';
|
||||||
|
|
||||||
export function components() {
|
|
||||||
return [MyExtensionComponent];
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CoreModule, BrowserModule, FormsModule],
|
imports: [MyExtensionComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
provideTranslations('my-extension', 'assets/my-extension'),
|
||||||
provide: TRANSLATION_PROVIDER,
|
MyExtensionService,
|
||||||
multi: true,
|
provideExtensionConfig(['my-extension.json']),
|
||||||
useValue: {
|
]
|
||||||
name: 'my-extension',
|
|
||||||
source: 'assets/my-extension',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
MyExtensionService,
|
|
||||||
provideExtensionConfig(['my-extension.json']),
|
|
||||||
],
|
|
||||||
declarations: components(),
|
|
||||||
exports: components(),
|
|
||||||
})
|
})
|
||||||
export class MyExtensionModule {
|
export class MyExtensionModule {
|
||||||
constructor(extensions: ExtensionService) {
|
constructor(extensions: ExtensionService) {
|
||||||
extensions.setComponents({
|
extensions.setComponents({
|
||||||
'my-extension.main.component' : MyExtensionComponent,
|
'my-extension.main.component': MyExtensionComponent,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -133,16 +126,13 @@ This is a very basic example, adding a “My Extension” item to the existing l
|
|||||||
Now that the ACA extension is developed in its initial version, let's add the extension module to the list of the ones used by the application. To complete the task, edit the `src/app/extensions.module.ts` file as described below.
|
Now that the ACA extension is developed in its initial version, let's add the extension module to the list of the ones used by the application. To complete the task, edit the `src/app/extensions.module.ts` file as described below.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// Add the following import to the page.
|
// Add the following import to the page.
|
||||||
import { MyExtensionModule } from 'my-extension';
|
import { MyExtensionModule } from 'my-extension';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [MyExtensionModule]
|
||||||
...,
|
})
|
||||||
MyExtensionModule
|
export class AppExtensionsModule {}
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppExtensionsModule {}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition, edit the `src/assets/app.extensions.json` file on the `$references` array. Below how it should look like.
|
In addition, edit the `src/assets/app.extensions.json` file on the `$references` array. Below how it should look like.
|
||||||
|
@@ -27,7 +27,6 @@ import { AboutComponent } from './about.component';
|
|||||||
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [AboutComponent],
|
|
||||||
providers: [provideExtensionConfig(['about.plugin.json'])]
|
providers: [provideExtensionConfig(['about.plugin.json'])]
|
||||||
})
|
})
|
||||||
export class AcaAboutModule {
|
export class AcaAboutModule {
|
||||||
|
@@ -22,24 +22,12 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { provideTranslations } from '@alfresco/adf-core';
|
||||||
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import * as rules from './folder-rules.rules';
|
import * as rules from './folder-rules.rules';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { provideRouter, Routes } from '@angular/router';
|
||||||
import { EditRuleDialogUiComponent } from './rule-details/edit-rule-dialog.ui-component';
|
|
||||||
import { ManageRulesSmartComponent } from './manage-rules/manage-rules.smart-component';
|
import { ManageRulesSmartComponent } from './manage-rules/manage-rules.smart-component';
|
||||||
import { RuleCompositeConditionUiComponent } from './rule-details/conditions/rule-composite-condition.ui-component';
|
|
||||||
import { RuleDetailsUiComponent } from './rule-details/rule-details.ui-component';
|
|
||||||
import { RuleSimpleConditionUiComponent } from './rule-details/conditions/rule-simple-condition.ui-component';
|
|
||||||
import { RuleListItemUiComponent } from './rule-list/rule-list-item/rule-list-item.ui-component';
|
|
||||||
import { RuleListGroupingUiComponent } from './rule-list/rule-list-grouping/rule-list-grouping.ui-component';
|
|
||||||
import { RuleTriggersUiComponent } from './rule-details/triggers/rule-triggers.ui-component';
|
|
||||||
import { RuleOptionsUiComponent } from './rule-details/options/rule-options.ui-component';
|
|
||||||
import { RuleActionListUiComponent } from './rule-details/actions/rule-action-list.ui-component';
|
|
||||||
import { RuleActionUiComponent } from './rule-details/actions/rule-action.ui-component';
|
|
||||||
import { RuleListUiComponent } from './rule-list/rule-list/rule-list.ui-component';
|
|
||||||
import { RuleSetPickerSmartComponent } from './rule-set-picker/rule-set-picker.smart-component';
|
|
||||||
import { PluginEnabledGuard } from '@alfresco/aca-shared';
|
import { PluginEnabledGuard } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
@@ -54,28 +42,10 @@ const routes: Routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [provideExtensionConfig(['folder-rules.plugin.json'])],
|
providers: [provideTranslations('folder-rules', 'assets/folder-rules'), provideExtensionConfig(['folder-rules.plugin.json']), provideRouter(routes)]
|
||||||
imports: [
|
|
||||||
RouterModule.forChild(routes),
|
|
||||||
RuleListItemUiComponent,
|
|
||||||
RuleListGroupingUiComponent,
|
|
||||||
RuleListUiComponent,
|
|
||||||
ManageRulesSmartComponent,
|
|
||||||
RuleSetPickerSmartComponent,
|
|
||||||
RuleActionListUiComponent,
|
|
||||||
RuleActionUiComponent,
|
|
||||||
RuleCompositeConditionUiComponent,
|
|
||||||
RuleSimpleConditionUiComponent,
|
|
||||||
RuleOptionsUiComponent,
|
|
||||||
RuleTriggersUiComponent,
|
|
||||||
RuleDetailsUiComponent,
|
|
||||||
EditRuleDialogUiComponent
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AcaFolderRulesModule {
|
export class AcaFolderRulesModule {
|
||||||
constructor(translation: TranslationService, extensions: ExtensionService) {
|
constructor(extensions: ExtensionService) {
|
||||||
translation.addTranslationFolder('folder-rules', 'assets/folder-rules');
|
|
||||||
|
|
||||||
extensions.setEvaluators({
|
extensions.setEvaluators({
|
||||||
'rules.isFolderRulesEnabled': rules.isFolderRulesEnabled
|
'rules.isFolderRulesEnabled': rules.isFolderRulesEnabled
|
||||||
});
|
});
|
||||||
|
@@ -26,16 +26,15 @@ import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensio
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
import { AosEffects } from './effects/aos.effects';
|
import { AosEffects } from './effects/aos.effects';
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { provideTranslations } from '@alfresco/adf-core';
|
||||||
import { canOpenWithOffice } from '@alfresco/aca-shared/rules';
|
import { canOpenWithOffice } from '@alfresco/aca-shared/rules';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [EffectsModule.forFeature([AosEffects])],
|
imports: [EffectsModule.forFeature([AosEffects])],
|
||||||
providers: [provideExtensionConfig(['aos.plugin.json'])]
|
providers: [provideExtensionConfig(['aos.plugin.json']), provideTranslations('ms-office', 'assets/ms-office')]
|
||||||
})
|
})
|
||||||
export class AosExtensionModule {
|
export class AosExtensionModule {
|
||||||
constructor(extensions: ExtensionService, translation: TranslationService) {
|
constructor(extensions: ExtensionService) {
|
||||||
translation.addTranslationFolder('ms-office', 'assets/ms-office');
|
|
||||||
extensions.setEvaluators({
|
extensions.setEvaluators({
|
||||||
'aos.canOpenWithOffice': canOpenWithOffice
|
'aos.canOpenWithOffice': canOpenWithOffice
|
||||||
});
|
});
|
||||||
|
@@ -34,17 +34,15 @@ import {
|
|||||||
LibraryStatusColumnComponent,
|
LibraryStatusColumnComponent,
|
||||||
TrashcanNameColumnComponent
|
TrashcanNameColumnComponent
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
import { DocumentBasePageService, ExtensionsDataLoaderGuard, OpenInAppComponent } from '@alfresco/aca-shared';
|
import { DocumentBasePageService, ExtensionsDataLoaderGuard } from '@alfresco/aca-shared';
|
||||||
import * as rules from '@alfresco/aca-shared/rules';
|
import * as rules from '@alfresco/aca-shared/rules';
|
||||||
import { AppStoreModule } from './store/app-store.module';
|
import { AppStoreModule } from './store/app-store.module';
|
||||||
import { CoreExtensionsModule } from './extensions/core.extensions.module';
|
import { CoreExtensionsModule } from './extensions/core.extensions.module';
|
||||||
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
|
|
||||||
import { ExtensionService, ExtensionsModule } from '@alfresco/adf-extensions';
|
import { ExtensionService, ExtensionsModule } from '@alfresco/adf-extensions';
|
||||||
import { APP_TOOLBAR_DIRECTIVES } from './components/toolbar';
|
import { APP_TOOLBAR_DIRECTIVES } from './components/toolbar';
|
||||||
import { APP_SIDENAV_DIRECTIVES } from './components/sidenav';
|
import { APP_SIDENAV_DIRECTIVES } from './components/sidenav';
|
||||||
import { APP_COMMON_DIRECTIVES } from './components/common';
|
import { APP_COMMON_DIRECTIVES } from './components/common';
|
||||||
import { APP_SEARCH_DIRECTIVES } from './components/search';
|
import { APP_SEARCH_DIRECTIVES } from './components/search';
|
||||||
import { CreateFromTemplateDialogComponent } from './dialogs/node-template/create-from-template.dialog';
|
|
||||||
import { ContentUrlService } from './services/content-url.service';
|
import { ContentUrlService } from './services/content-url.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { LocationLinkComponent } from './components/common/location-link/location-link.component';
|
import { LocationLinkComponent } from './components/common/location-link/location-link.component';
|
||||||
@@ -95,12 +93,8 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side
|
|||||||
...APP_SIDENAV_DIRECTIVES,
|
...APP_SIDENAV_DIRECTIVES,
|
||||||
...APP_SEARCH_DIRECTIVES,
|
...APP_SEARCH_DIRECTIVES,
|
||||||
ContextMenuComponent,
|
ContextMenuComponent,
|
||||||
AppInfoDrawerModule,
|
|
||||||
HammerModule,
|
HammerModule,
|
||||||
AcaFolderRulesModule,
|
AcaFolderRulesModule
|
||||||
CreateFromTemplateDialogComponent,
|
|
||||||
OpenInAppComponent,
|
|
||||||
UploadFilesDialogComponent
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: ContentVersionService, useClass: ContentUrlService },
|
{ provide: ContentVersionService, useClass: ContentUrlService },
|
||||||
|
@@ -24,12 +24,12 @@
|
|||||||
|
|
||||||
import { CommentsTabComponent } from './comments-tab.component';
|
import { CommentsTabComponent } from './comments-tab.component';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
|
||||||
import { NodePermissionService } from '@alfresco/aca-shared';
|
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService, NoopTranslateModule } from '@alfresco/adf-core';
|
||||||
import { ExternalNodePermissionCommentsTabService } from '@alfresco/aca-content';
|
import { ExternalNodePermissionCommentsTabService } from '@alfresco/aca-content';
|
||||||
|
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
describe('CommentsTabComponent', () => {
|
describe('CommentsTabComponent', () => {
|
||||||
let component: CommentsTabComponent;
|
let component: CommentsTabComponent;
|
||||||
@@ -40,8 +40,9 @@ describe('CommentsTabComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AppTestingModule, CommentsTabComponent],
|
imports: [NoopTranslateModule, CommentsTabComponent],
|
||||||
providers: [
|
providers: [
|
||||||
|
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||||
{ provide: ExternalNodePermissionCommentsTabService, useValue: { canAddComments: () => canAddComment } },
|
{ provide: ExternalNodePermissionCommentsTabService, useValue: { canAddComments: () => canAddComment } },
|
||||||
{ provide: AuthenticationService, useValue: { onLogout: of({}) } }
|
{ provide: AuthenticationService, useValue: { onLogout: of({}) } }
|
||||||
]
|
]
|
||||||
|
@@ -26,13 +26,13 @@ import { Component, Input, OnInit, Optional, ViewEncapsulation } from '@angular/
|
|||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { isLocked, NodePermissionService } from '@alfresco/aca-shared';
|
import { isLocked, NodePermissionService } from '@alfresco/aca-shared';
|
||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
import { NodeCommentsModule } from '@alfresco/adf-content-services';
|
import { NodeCommentsComponent } from '@alfresco/adf-content-services';
|
||||||
import { ExternalNodePermissionCommentsTabService } from './external-node-permission-comments-tab.service';
|
import { ExternalNodePermissionCommentsTabService } from './external-node-permission-comments-tab.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
imports: [MatCardModule, NodeCommentsModule],
|
imports: [MatCardModule, NodeCommentsComponent],
|
||||||
selector: 'app-comments-tab',
|
selector: 'app-comments-tab',
|
||||||
template: `<mat-card class="adf-comments-tab-container" appearance="raised"
|
template: ` <mat-card class="adf-comments-tab-container" appearance="raised"
|
||||||
><adf-node-comments [readOnly]="!canUpdateNode" [nodeId]="node?.id"
|
><adf-node-comments [readOnly]="!canUpdateNode" [nodeId]="node?.id"
|
||||||
/></mat-card>`,
|
/></mat-card>`,
|
||||||
styles: ['app-comments-tab mat-card { padding: 16px }'],
|
styles: ['app-comments-tab mat-card { padding: 16px }'],
|
||||||
|
@@ -1,51 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
||||||
*
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommentsTabComponent } from './comments-tab/comments-tab.component';
|
|
||||||
import { MetadataTabComponent } from './metadata-tab/metadata-tab.component';
|
|
||||||
import { LibraryMetadataTabComponent } from './library-metadata-tab/library-metadata-tab.component';
|
|
||||||
import { LibraryMetadataFormComponent } from './library-metadata-tab/library-metadata-form.component';
|
|
||||||
import { VersionsTabComponent } from './versions-tab/versions-tab.component';
|
|
||||||
import { InfoDrawerComponent } from '@alfresco/aca-shared';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
InfoDrawerComponent,
|
|
||||||
CommentsTabComponent,
|
|
||||||
LibraryMetadataFormComponent,
|
|
||||||
LibraryMetadataTabComponent,
|
|
||||||
MetadataTabComponent,
|
|
||||||
VersionsTabComponent
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
InfoDrawerComponent,
|
|
||||||
CommentsTabComponent,
|
|
||||||
LibraryMetadataFormComponent,
|
|
||||||
LibraryMetadataTabComponent,
|
|
||||||
MetadataTabComponent,
|
|
||||||
VersionsTabComponent
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppInfoDrawerModule {}
|
|
@@ -1,4 +1,5 @@
|
|||||||
<mat-card appearance="raised" *ngIf="node">
|
@if (node) {
|
||||||
|
<mat-card appearance="raised">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<form [formGroup]="form" autocomplete="off">
|
<form [formGroup]="form" autocomplete="off">
|
||||||
<mat-form-field floatLabel="auto" data-automation-id="library-name-properties-wrapper" class="app-library-metadata-form-field">
|
<mat-form-field floatLabel="auto" data-automation-id="library-name-properties-wrapper" class="app-library-metadata-form-field">
|
||||||
@@ -12,7 +13,9 @@
|
|||||||
formControlName="title"
|
formControlName="title"
|
||||||
[errorStateMatcher]="matcher"
|
[errorStateMatcher]="matcher"
|
||||||
/>
|
/>
|
||||||
<mat-hint *ngIf="libraryTitleExists">{{ 'LIBRARY.HINTS.SITE_TITLE_EXISTS' | translate }}</mat-hint>
|
@if (libraryTitleExists) {
|
||||||
|
<mat-hint>{{ 'LIBRARY.HINTS.SITE_TITLE_EXISTS' | translate }}</mat-hint>
|
||||||
|
}
|
||||||
<mat-error>
|
<mat-error>
|
||||||
{{ titleErrorTranslationKey | translate }}
|
{{ titleErrorTranslationKey | translate }}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
@@ -48,17 +51,21 @@
|
|||||||
</form>
|
</form>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
<mat-card-actions align="end" *ngIf="canUpdateLibrary">
|
@if (canUpdateLibrary) {
|
||||||
<ng-container *ngIf="form.enabled">
|
<mat-card-actions align="end">
|
||||||
<button mat-button (click)="cancel()">
|
@if (form.enabled) {
|
||||||
{{ 'LIBRARY.DIALOG.CANCEL' | translate }}
|
<button mat-button (click)="cancel()">
|
||||||
</button>
|
{{ 'LIBRARY.DIALOG.CANCEL' | translate }}
|
||||||
<button mat-button color="primary" [disabled]="form.invalid || form.pristine" (click)="update()">
|
</button>
|
||||||
{{ 'LIBRARY.DIALOG.UPDATE' | translate }}
|
<button mat-button color="primary" [disabled]="form.invalid || form.pristine" (click)="update()">
|
||||||
</button>
|
{{ 'LIBRARY.DIALOG.UPDATE' | translate }}
|
||||||
</ng-container>
|
</button>
|
||||||
<button mat-button color="primary" (click)="toggleEdit()" *ngIf="form.disabled">
|
} @else {
|
||||||
|
<button mat-button color="primary" (click)="toggleEdit()">
|
||||||
{{ 'LIBRARY.DIALOG.EDIT' | translate }}
|
{{ 'LIBRARY.DIALOG.EDIT' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
}
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
|
}
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
}
|
||||||
|
@@ -42,7 +42,6 @@ import { debounceTime, mergeMap } from 'rxjs/operators';
|
|||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { ErrorStateMatcher, MatOptionModule } from '@angular/material/core';
|
import { ErrorStateMatcher, MatOptionModule } from '@angular/material/core';
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
import { TranslatePipe } from '@ngx-translate/core';
|
import { TranslatePipe } from '@ngx-translate/core';
|
||||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
@@ -51,6 +50,7 @@ import { MatInputModule } from '@angular/material/input';
|
|||||||
import { A11yModule } from '@angular/cdk/a11y';
|
import { A11yModule } from '@angular/cdk/a11y';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
import { NgForOf } from '@angular/common';
|
||||||
|
|
||||||
export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
||||||
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
||||||
@@ -61,7 +61,6 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
TranslatePipe,
|
TranslatePipe,
|
||||||
MatFormFieldModule,
|
MatFormFieldModule,
|
||||||
@@ -71,7 +70,8 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
|||||||
MatOptionModule,
|
MatOptionModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
A11yModule,
|
A11yModule,
|
||||||
MatButtonModule
|
MatButtonModule,
|
||||||
|
NgForOf
|
||||||
],
|
],
|
||||||
selector: 'app-library-metadata-form',
|
selector: 'app-library-metadata-form',
|
||||||
templateUrl: './library-metadata-form.component.html',
|
templateUrl: './library-metadata-form.component.html',
|
||||||
|
@@ -36,14 +36,14 @@ import {
|
|||||||
TagService
|
TagService
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
import { filter, map } from 'rxjs/operators';
|
import { filter, map } from 'rxjs/operators';
|
||||||
import { CommonModule } from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import { Actions, ofType } from '@ngrx/effects';
|
import { Actions, ofType } from '@ngrx/effects';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { ExtensionService } from '@alfresco/adf-extensions';
|
import { ExtensionService } from '@alfresco/adf-extensions';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
imports: [CommonModule, ContentMetadataComponent],
|
imports: [ContentMetadataComponent, AsyncPipe],
|
||||||
selector: 'app-metadata-tab',
|
selector: 'app-metadata-tab',
|
||||||
template: `
|
template: `
|
||||||
<adf-content-metadata
|
<adf-content-metadata
|
||||||
|
@@ -32,10 +32,10 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|||||||
import { MatInputModule } from '@angular/material/input';
|
import { MatInputModule } from '@angular/material/input';
|
||||||
import { A11yModule } from '@angular/cdk/a11y';
|
import { A11yModule } from '@angular/cdk/a11y';
|
||||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
import { FormControl, FormGroup, FormsModule, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { CoreModule, NotificationService } from '@alfresco/adf-core';
|
import { NotificationService } from '@alfresco/adf-core';
|
||||||
import { AutoFocusDirective, forbidOnlySpaces, SavedSearchesService } from '@alfresco/adf-content-services';
|
import { AutoFocusDirective, forbidOnlySpaces, SavedSearchesService } from '@alfresco/adf-content-services';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { UniqueSearchNameValidator } from './unique-search-name-validator';
|
import { UniqueSearchNameValidator } from './unique-search-name-validator';
|
||||||
import { SavedSearchForm } from './saved-search-form.interface';
|
import { SavedSearchForm } from './saved-search-form.interface';
|
||||||
@@ -52,8 +52,9 @@ import { SavedSearchForm } from './saved-search-form.interface';
|
|||||||
A11yModule,
|
A11yModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
CoreModule,
|
AutoFocusDirective,
|
||||||
AutoFocusDirective
|
ReactiveFormsModule,
|
||||||
|
MatDialogModule
|
||||||
],
|
],
|
||||||
selector: 'aca-save-search-dialog',
|
selector: 'aca-save-search-dialog',
|
||||||
templateUrl: './save-search-dialog.component.html',
|
templateUrl: './save-search-dialog.component.html',
|
||||||
|
@@ -1 +1,3 @@
|
|||||||
<app-expand-menu *ngIf="item" [item]="item" (actionClicked)="onActionClick($event)" />
|
@if (item) {
|
||||||
|
<app-expand-menu [item]="item" (actionClicked)="onActionClick($event)" />
|
||||||
|
}
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { SavedSearch, SavedSearchesService } from '@alfresco/adf-content-services';
|
import { SavedSearch, SavedSearchesService } from '@alfresco/adf-content-services';
|
||||||
import { CoreModule, TranslationService, UserPreferencesService, UserPreferenceValues } from '@alfresco/adf-core';
|
import { TranslationService, UserPreferencesService, UserPreferenceValues } from '@alfresco/adf-core';
|
||||||
import { NavBarLinkRef } from '@alfresco/adf-extensions';
|
import { NavBarLinkRef } from '@alfresco/adf-extensions';
|
||||||
import { ExpandMenuComponent } from '../../../sidenav/components/expand-menu.component';
|
import { ExpandMenuComponent } from '../../../sidenav/components/expand-menu.component';
|
||||||
import { AppService } from '@alfresco/aca-shared';
|
import { AppService } from '@alfresco/aca-shared';
|
||||||
@@ -33,7 +33,7 @@ import { delay } from 'rxjs/operators';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-save-search-sidenav',
|
selector: 'aca-save-search-sidenav',
|
||||||
imports: [CoreModule, ExpandMenuComponent],
|
imports: [ExpandMenuComponent],
|
||||||
templateUrl: './save-search-sidenav.component.html',
|
templateUrl: './save-search-sidenav.component.html',
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
|
@@ -23,24 +23,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { inject, ModuleWithProviders, NgModule, provideAppInitializer } from '@angular/core';
|
import { inject, ModuleWithProviders, NgModule, provideAppInitializer } from '@angular/core';
|
||||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
|
||||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
export function setupExtensions(service: AppExtensionService): () => void {
|
/** @deprecated use provideExtensions() api instead */
|
||||||
return () => service.load();
|
@NgModule()
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [ExtensionsModule]
|
|
||||||
})
|
|
||||||
export class CoreExtensionsModule {
|
export class CoreExtensionsModule {
|
||||||
static forRoot(): ModuleWithProviders<CoreExtensionsModule> {
|
static forRoot(): ModuleWithProviders<CoreExtensionsModule> {
|
||||||
return {
|
return {
|
||||||
ngModule: CoreExtensionsModule,
|
ngModule: CoreExtensionsModule,
|
||||||
providers: [
|
providers: [
|
||||||
provideAppInitializer(() => {
|
provideAppInitializer(() => {
|
||||||
const initializerFn = setupExtensions(inject(AppExtensionService));
|
const service = inject(AppExtensionService);
|
||||||
return initializerFn();
|
return service.load();
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@@ -22,16 +22,14 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { EnvironmentProviders, inject, provideAppInitializer, Provider } from '@angular/core';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
|
||||||
import { MatDialogModule } from '@angular/material/dialog';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { ContextActionsDirective } from '../directives/contextmenu/contextmenu.directive';
|
|
||||||
|
|
||||||
// @deprecated
|
export function provideExtensions(): (Provider | EnvironmentProviders)[] {
|
||||||
@NgModule({
|
return [
|
||||||
imports: [MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, ContextActionsDirective],
|
provideAppInitializer(() => {
|
||||||
exports: [MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, ContextActionsDirective]
|
const service = inject(AppExtensionService);
|
||||||
})
|
return service.load();
|
||||||
export class SharedModule {}
|
})
|
||||||
|
];
|
||||||
|
}
|
@@ -34,3 +34,4 @@ export * from './lib/services/content-url.service';
|
|||||||
export * from './lib/services/content-management.service';
|
export * from './lib/services/content-management.service';
|
||||||
export * from './lib/components/info-drawer/comments-tab/external-node-permission-comments-tab.service';
|
export * from './lib/components/info-drawer/comments-tab/external-node-permission-comments-tab.service';
|
||||||
export * from './lib/utils/aca-search-utils';
|
export * from './lib/utils/aca-search-utils';
|
||||||
|
export * from './lib/extensions/provide-extensions';
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
||||||
*
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { ToolbarButtonComponent } from '../components/toolbar/toolbar-button/toolbar-button.component';
|
|
||||||
import { ToolbarActionComponent } from '../components/toolbar/toolbar-action/toolbar-action.component';
|
|
||||||
import { ToolbarMenuItemComponent } from '../components/toolbar/toolbar-menu-item/toolbar-menu-item.component';
|
|
||||||
import { ToolbarMenuComponent } from '../components/toolbar/toolbar-menu/toolbar-menu.component';
|
|
||||||
|
|
||||||
// @deprecated
|
|
||||||
@NgModule({
|
|
||||||
imports: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent],
|
|
||||||
exports: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent]
|
|
||||||
})
|
|
||||||
export class SharedToolbarModule {}
|
|
@@ -62,6 +62,3 @@ export * from './lib/services/navigation-history.service';
|
|||||||
|
|
||||||
export * from './lib/utils/node.utils';
|
export * from './lib/utils/node.utils';
|
||||||
export * from './lib/testing/lib-testing-module';
|
export * from './lib/testing/lib-testing-module';
|
||||||
|
|
||||||
export * from './lib/deprecated/shared.module';
|
|
||||||
export * from './lib/deprecated/shared-toolbar.module';
|
|
||||||
|
Reference in New Issue
Block a user