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:
@@ -24,12 +24,12 @@
|
||||
|
||||
import { CommentsTabComponent } from './comments-tab.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { AuthenticationService, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { ExternalNodePermissionCommentsTabService } from '@alfresco/aca-content';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
describe('CommentsTabComponent', () => {
|
||||
let component: CommentsTabComponent;
|
||||
@@ -40,8 +40,9 @@ describe('CommentsTabComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, CommentsTabComponent],
|
||||
imports: [NoopTranslateModule, CommentsTabComponent],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: ExternalNodePermissionCommentsTabService, useValue: { canAddComments: () => canAddComment } },
|
||||
{ provide: AuthenticationService, useValue: { onLogout: of({}) } }
|
||||
]
|
||||
|
@@ -26,13 +26,13 @@ import { Component, Input, OnInit, Optional, ViewEncapsulation } from '@angular/
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { isLocked, NodePermissionService } from '@alfresco/aca-shared';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
imports: [MatCardModule, NodeCommentsModule],
|
||||
imports: [MatCardModule, NodeCommentsComponent],
|
||||
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"
|
||||
/></mat-card>`,
|
||||
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>
|
||||
<form [formGroup]="form" autocomplete="off">
|
||||
<mat-form-field floatLabel="auto" data-automation-id="library-name-properties-wrapper" class="app-library-metadata-form-field">
|
||||
@@ -12,7 +13,9 @@
|
||||
formControlName="title"
|
||||
[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>
|
||||
{{ titleErrorTranslationKey | translate }}
|
||||
</mat-error>
|
||||
@@ -48,17 +51,21 @@
|
||||
</form>
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions align="end" *ngIf="canUpdateLibrary">
|
||||
<ng-container *ngIf="form.enabled">
|
||||
<button mat-button (click)="cancel()">
|
||||
{{ 'LIBRARY.DIALOG.CANCEL' | translate }}
|
||||
</button>
|
||||
<button mat-button color="primary" [disabled]="form.invalid || form.pristine" (click)="update()">
|
||||
{{ 'LIBRARY.DIALOG.UPDATE' | translate }}
|
||||
</button>
|
||||
</ng-container>
|
||||
<button mat-button color="primary" (click)="toggleEdit()" *ngIf="form.disabled">
|
||||
@if (canUpdateLibrary) {
|
||||
<mat-card-actions align="end">
|
||||
@if (form.enabled) {
|
||||
<button mat-button (click)="cancel()">
|
||||
{{ 'LIBRARY.DIALOG.CANCEL' | translate }}
|
||||
</button>
|
||||
<button mat-button color="primary" [disabled]="form.invalid || form.pristine" (click)="update()">
|
||||
{{ 'LIBRARY.DIALOG.UPDATE' | translate }}
|
||||
</button>
|
||||
} @else {
|
||||
<button mat-button color="primary" (click)="toggleEdit()">
|
||||
{{ 'LIBRARY.DIALOG.EDIT' | translate }}
|
||||
</button>
|
||||
}
|
||||
</mat-card-actions>
|
||||
}
|
||||
</mat-card>
|
||||
}
|
||||
|
@@ -42,7 +42,6 @@ import { debounceTime, mergeMap } from 'rxjs/operators';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { ErrorStateMatcher, MatOptionModule } from '@angular/material/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
@@ -51,6 +50,7 @@ import { MatInputModule } from '@angular/material/input';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { NgForOf } from '@angular/common';
|
||||
|
||||
export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
||||
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
||||
@@ -61,7 +61,6 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
||||
|
||||
@Component({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatCardModule,
|
||||
TranslatePipe,
|
||||
MatFormFieldModule,
|
||||
@@ -71,7 +70,8 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
||||
MatOptionModule,
|
||||
MatInputModule,
|
||||
A11yModule,
|
||||
MatButtonModule
|
||||
MatButtonModule,
|
||||
NgForOf
|
||||
],
|
||||
selector: 'app-library-metadata-form',
|
||||
templateUrl: './library-metadata-form.component.html',
|
||||
|
@@ -36,14 +36,14 @@ import {
|
||||
TagService
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { Actions, ofType } from '@ngrx/effects';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { ExtensionService } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
imports: [CommonModule, ContentMetadataComponent],
|
||||
imports: [ContentMetadataComponent, AsyncPipe],
|
||||
selector: 'app-metadata-tab',
|
||||
template: `
|
||||
<adf-content-metadata
|
||||
|
@@ -32,10 +32,10 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { FormControl, FormGroup, FormsModule, Validators } from '@angular/forms';
|
||||
import { CoreModule, NotificationService } from '@alfresco/adf-core';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
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 { UniqueSearchNameValidator } from './unique-search-name-validator';
|
||||
import { SavedSearchForm } from './saved-search-form.interface';
|
||||
@@ -52,8 +52,9 @@ import { SavedSearchForm } from './saved-search-form.interface';
|
||||
A11yModule,
|
||||
MatCheckboxModule,
|
||||
FormsModule,
|
||||
CoreModule,
|
||||
AutoFocusDirective
|
||||
AutoFocusDirective,
|
||||
ReactiveFormsModule,
|
||||
MatDialogModule
|
||||
],
|
||||
selector: 'aca-save-search-dialog',
|
||||
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 { 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 { ExpandMenuComponent } from '../../../sidenav/components/expand-menu.component';
|
||||
import { AppService } from '@alfresco/aca-shared';
|
||||
@@ -33,7 +33,7 @@ import { delay } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-save-search-sidenav',
|
||||
imports: [CoreModule, ExpandMenuComponent],
|
||||
imports: [ExpandMenuComponent],
|
||||
templateUrl: './save-search-sidenav.component.html',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
Reference in New Issue
Block a user