Skip to content

Commit

Permalink
[ACS-7421] process: break app list dependency on material bundle (#9640)
Browse files Browse the repository at this point in the history
* chore: break apps list dependency on material module bundle
  • Loading branch information
DenysVuika authored May 6, 2024
1 parent 7080408 commit 6f0bbe4
Show file tree
Hide file tree
Showing 33 changed files with 153 additions and 585 deletions.
14 changes: 4 additions & 10 deletions demo-shell/src/app/components/task-list-demo/task-list.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { NgModule } from '@angular/core';
import { TaskListDemoComponent } from './task-list-demo.component';
import { Routes, RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { CoreModule, LocalizedDatePipe } from '@alfresco/adf-core';
import { CoreModule, FullNamePipe, LocalizedDatePipe } from '@alfresco/adf-core';
import { ProcessModule } from '@alfresco/adf-process-services';

const routes: Routes = [
{
path: '',
component: TaskListDemoComponent
path: '',
component: TaskListDemoComponent
},
{
path: ':id',
Expand All @@ -34,13 +34,7 @@ const routes: Routes = [
];

@NgModule({
imports: [
CommonModule,
RouterModule.forChild(routes),
CoreModule,
ProcessModule.forChild(),
LocalizedDatePipe
],
imports: [CommonModule, RouterModule.forChild(routes), CoreModule, ProcessModule.forChild(), LocalizedDatePipe, FullNamePipe],
declarations: [TaskListDemoComponent]
})
export class AppTaskListModule {}
6 changes: 0 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,6 @@ for more information about installing and using the source code.
| [Task Audit Directive](process-services/directives/task-audit.directive.md) | Fetches the Task Audit information in PDF or JSON format. | [Source](../lib/process-services/src/lib/task-list/components/task-audit.directive.ts) |
| [Unclaim Task Directive](process-services/directives/unclaim-task.directive.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Unclaims a task | [Source](../lib/process-services/src/lib/task-list/components/task-form/unclaim-task.directive.ts) |

### Pipes

| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Process name pipe](process-services/pipes/process-name.pipe.md) | When an identifier is specified, the input will be transformed replacing the identifiers with the values of the selected process definition provided. | [Source](../lib/process-services/src/lib/pipes/process-name.pipe.ts) |

### Services

| Name | Description | Source link |
Expand Down
49 changes: 0 additions & 49 deletions docs/process-services/pipes/process-name.pipe.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ContentUserInfoComponent } from './content-user-info.component';
import { TranslateModule } from '@ngx-translate/core';
import { PipeModule } from '@alfresco/adf-core';
import { FullNamePipe, InitialUsernamePipe, PipeModule } from '@alfresco/adf-core';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
import { MatTabsModule } from '@angular/material/tabs';
Expand All @@ -34,7 +34,9 @@ import { MatCardModule } from '@angular/material/card';
MatTabsModule,
MatCardModule,
TranslateModule,
PipeModule
PipeModule,
InitialUsernamePipe,
FullNamePipe
],
exports: [ContentUserInfoComponent]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { CoreModule, PipeModule } from '@alfresco/adf-core';
import { CoreModule, InitialUsernamePipe, PipeModule } from '@alfresco/adf-core';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
Expand All @@ -34,15 +34,7 @@ import { PopOverDirective } from './components/pop-over.directive';
import { PermissionContainerComponent } from './components/permission-container/permission-container.component';

@NgModule({
imports: [
CoreModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
SearchModule,
PipeModule
],
imports: [CoreModule, CommonModule, FormsModule, ReactiveFormsModule, MaterialModule, SearchModule, PipeModule, InitialUsernamePipe],
declarations: [
PermissionListComponent,
AddPermissionPanelComponent,
Expand Down
4 changes: 2 additions & 2 deletions lib/core/src/lib/icon/icon.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ng-container *ngIf="isCustom; else: default">
<ng-container *ngIf="isCustom; else: defaultIcon">
<mat-icon [color]="color" [svgIcon]="value" aria-hidden="true"></mat-icon>
</ng-container>

<ng-template #default>
<ng-template #defaultIcon>
<mat-icon [fontSet]="fontSet" [color]="color" aria-hidden="true">{{ value }}</mat-icon>
</ng-template>
11 changes: 5 additions & 6 deletions lib/core/src/lib/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
* limitations under the License.
*/

import {
Component,
Input,
ViewEncapsulation,
ChangeDetectionStrategy
} from '@angular/core';
import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
import { MatIconModule } from '@angular/material/icon';
import { NgIf } from '@angular/common';

@Component({
selector: 'adf-icon',
standalone: true,
imports: [MatIconModule, NgIf],
templateUrl: './icon.component.html',
styleUrls: ['./icon.component.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
18 changes: 6 additions & 12 deletions lib/core/src/lib/icon/icon.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@

import { NgModule } from '@angular/core';
import { IconComponent } from './icon.component';
import { MatIconModule } from '@angular/material/icon';
import { CommonModule } from '@angular/common';

/**
* @deprecated this Module is deprecated and should no longer be used.
* Consider importing components directly instead.
*/
@NgModule({
imports: [
CommonModule,
MatIconModule
],
declarations: [
IconComponent
],
exports: [
IconComponent
]
imports: [IconComponent],
exports: [IconComponent]
})
export class IconModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { MatMenuModule } from '@angular/material/menu';
import { MatTabsModule } from '@angular/material/tabs';
import { TranslateModule } from '@ngx-translate/core';
import { PipeModule } from '../pipes/pipe.module';
import { FullNamePipe, InitialUsernamePipe } from '../pipes';

@NgModule({
declarations: [IdentityUserInfoComponent],
Expand All @@ -34,7 +35,9 @@ import { PipeModule } from '../pipes/pipe.module';
MatTabsModule,
MatCardModule,
TranslateModule,
PipeModule
PipeModule,
InitialUsernamePipe,
FullNamePipe
],
exports: [IdentityUserInfoComponent]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@
*/

import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { IconComponent } from '../../icon';

@Component({
selector: 'adf-empty-content',
standalone: true,
imports: [TranslateModule, IconComponent],
templateUrl: './empty-content.component.html',
styleUrls: ['./empty-content.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-empty-content' }
})
export class EmptyContentComponent {

/** Material Icon to use. */
@Input()
icon = 'cake';
Expand All @@ -38,5 +41,4 @@ export class EmptyContentComponent {
/** String or Resource Key for the subtitle. */
@Input()
subtitle = '';

}
28 changes: 10 additions & 18 deletions lib/core/src/lib/templates/error-content/error-content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,26 @@
* limitations under the License.
*/

import {
Component,
ChangeDetectionStrategy,
Input,
ViewEncapsulation,
OnInit
} from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, ViewEncapsulation, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { TranslationService } from '../../translation/translation.service';
import { Observable } from 'rxjs';
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { map } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';

@Component({
selector: 'adf-error-content',
standalone: true,
imports: [CommonModule, TranslateModule],
templateUrl: './error-content.component.html',
styleUrls: ['./error-content.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-error-content' }
})
export class ErrorContentComponent implements OnInit {

static UNKNOWN_ERROR = 'UNKNOWN';

/** Error code associated with this error. */
Expand All @@ -47,27 +44,22 @@ export class ErrorContentComponent implements OnInit {
errorCodeTranslated: string;
isSmallScreen$: Observable<boolean>;

constructor(private route: ActivatedRoute,
private translateService: TranslationService,
private breakpointObserver: BreakpointObserver
) {
}
constructor(private route: ActivatedRoute, private translateService: TranslationService, private breakpointObserver: BreakpointObserver) {}

ngOnInit() {
if (this.route) {
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
const code = params['id'] || this.errorCode;
const errorHasTranslation = this.checkErrorExists(code);
this.errorCodeTranslated = errorHasTranslation ? code : ErrorContentComponent.UNKNOWN_ERROR;
this.errorCodeTranslated = errorHasTranslation ? code : ErrorContentComponent.UNKNOWN_ERROR;
});
}

this.isSmallScreen$ = this.breakpointObserver.observe([Breakpoints.XSmall, Breakpoints.Small]).pipe(map(({ matches }) => matches));
}

checkErrorExists(errorCode: string ) {
checkErrorExists(errorCode: string) {
const errorMessage = this.translateService.instant('ERROR_CONTENT.' + errorCode);
return errorMessage !== ('ERROR_CONTENT.' + errorCode);
return errorMessage !== 'ERROR_CONTENT.' + errorCode;
}

}
13 changes: 6 additions & 7 deletions lib/core/src/lib/templates/template.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
* limitations under the License.
*/

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { ErrorContentComponent } from './error-content/error-content.component';
import { EmptyContentComponent } from './empty-content/empty-content.component';
import { IconModule } from '../icon/icon.module';
import { MatButtonModule } from '@angular/material/button';

/**
* @deprecated this Module is deprecated and should no longer be used.
* Consider importing components directly instead.
*/
@NgModule({
imports: [CommonModule, TranslateModule, IconModule],
declarations: [ErrorContentComponent, EmptyContentComponent],
exports: [ErrorContentComponent, EmptyContentComponent, MatButtonModule]
imports: [ErrorContentComponent, EmptyContentComponent],
exports: [ErrorContentComponent, EmptyContentComponent]
})
export class TemplateModule {}
8 changes: 4 additions & 4 deletions lib/process-services-cloud/src/lib/form/form-cloud.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule, ToolbarModule } from '@alfresco/adf-core';
import { CoreModule, FormatSpacePipe, ToolbarModule } from '@alfresco/adf-core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MaterialModule } from '../material.module';
import { FormCloudComponent } from './components/form-cloud.component';
Expand Down Expand Up @@ -58,7 +58,8 @@ import { A11yModule } from '@angular/cdk/a11y';
AlfrescoViewerModule,
RichTextEditorModule,
ToolbarModule,
A11yModule
A11yModule,
FormatSpacePipe
],
declarations: [
FormCloudComponent,
Expand Down Expand Up @@ -93,5 +94,4 @@ import { A11yModule } from '@angular/cdk/a11y';
DisplayRichTextWidgetComponent
]
})
export class FormCloudModule {
}
export class FormCloudModule {}
21 changes: 5 additions & 16 deletions lib/process-services-cloud/src/lib/people/people-cloud.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,15 @@ import { NgModule } from '@angular/core';
import { PeopleCloudComponent } from './components/people-cloud.component';
import { CommonModule } from '@angular/common';
import { MaterialModule } from '../material.module';
import { CoreModule } from '@alfresco/adf-core';
import { CoreModule, FullNamePipe, InitialUsernamePipe } from '@alfresco/adf-core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { IdentityUserService } from './services/identity-user.service';
import { IDENTITY_USER_SERVICE_TOKEN } from './services/identity-user-service.token';

@NgModule({
imports: [
CommonModule,
MaterialModule,
FormsModule,
ReactiveFormsModule,
CoreModule
],
imports: [CommonModule, MaterialModule, FormsModule, ReactiveFormsModule, CoreModule, FullNamePipe, InitialUsernamePipe],
declarations: [PeopleCloudComponent],
exports: [
PeopleCloudComponent
],
providers: [
{ provide: IDENTITY_USER_SERVICE_TOKEN, useExisting: IdentityUserService }
]
exports: [PeopleCloudComponent],
providers: [{ provide: IDENTITY_USER_SERVICE_TOKEN, useExisting: IdentityUserService }]
})
export class PeopleCloudModule {
}
export class PeopleCloudModule {}
Loading

0 comments on commit 6f0bbe4

Please sign in to comment.