mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-7422] APS1 attachment module as standalone components (#9718)
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AppsListComponent } from './apps-list.component';
|
||||
import { SelectAppsDialogComponent } from './select-apps-dialog.component';
|
||||
|
||||
/**
|
||||
* @deprecated this Module is deprecated and should no longer be used.
|
||||
* Consider importing components directly instead.
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [AppsListComponent, SelectAppsDialogComponent],
|
||||
exports: [AppsListComponent, SelectAppsDialogComponent]
|
||||
})
|
||||
export class AppsListModule {}
|
@@ -15,9 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './apps-list.component';
|
||||
export * from './select-apps-dialog.component';
|
||||
import { AppsListComponent } from './apps-list.component';
|
||||
import { SelectAppsDialogComponent } from './select-apps-dialog/select-apps-dialog.component';
|
||||
|
||||
export * from './apps-list.component';
|
||||
export * from './select-apps-dialog/select-apps-dialog.component';
|
||||
export * from './services/apps-process.service';
|
||||
|
||||
export * from './apps-list.module';
|
||||
export const APPS_LIST_DIRECTIVES = [AppsListComponent, SelectAppsDialogComponent] as const;
|
||||
|
@@ -19,11 +19,11 @@ import { Component } from '@angular/core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||
import { AppsProcessService } from './services/apps-process.service';
|
||||
import { deployedApps } from '../mock/apps-list.mock';
|
||||
import { AppsProcessService } from '../services/apps-process.service';
|
||||
import { deployedApps } from '../../mock/apps-list.mock';
|
||||
import { of } from 'rxjs';
|
||||
import { SelectAppsDialogComponent } from './select-apps-dialog.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-dialog-test',
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, Inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AppsProcessService } from './services/apps-process.service';
|
||||
import { AppsProcessService } from '../services/apps-process.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
@@ -1,47 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
|
||||
import { TaskAttachmentListComponent } from './task-attachment-list.component';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||
import { AttachmentComponent } from './create-task-attachment.component';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreModule,
|
||||
MaterialModule
|
||||
],
|
||||
declarations: [
|
||||
TaskAttachmentListComponent,
|
||||
ProcessAttachmentListComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
AttachmentComponent
|
||||
],
|
||||
exports: [
|
||||
TaskAttachmentListComponent,
|
||||
ProcessAttachmentListComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
AttachmentComponent
|
||||
]
|
||||
})
|
||||
export class AttachmentModule {}
|
@@ -18,7 +18,7 @@
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('CreateProcessAttachmentComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessTestingModule]
|
||||
imports: [ProcessTestingModule, CreateProcessAttachmentComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(CreateProcessAttachmentComponent);
|
||||
component = fixture.componentInstance;
|
@@ -15,16 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { UploadDirective } from '@alfresco/adf-core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-process-attachment',
|
||||
standalone: true,
|
||||
imports: [CommonModule, UploadDirective, MatButtonModule, MatIconModule],
|
||||
styleUrls: ['./create-process-attachment.component.css'],
|
||||
templateUrl: './create-process-attachment.component.html'
|
||||
})
|
||||
export class CreateProcessAttachmentComponent implements OnChanges {
|
||||
private processContentService = inject(ProcessContentService);
|
||||
|
||||
/** (required) The ID of the process instance to display. */
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
@@ -43,8 +51,6 @@ export class CreateProcessAttachmentComponent implements OnChanges {
|
||||
@Output()
|
||||
success = new EventEmitter<RelatedContentRepresentation>();
|
||||
|
||||
constructor(private processContentService: ProcessContentService) {}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['processInstanceId']?.currentValue) {
|
||||
this.processInstanceId = changes['processInstanceId'].currentValue;
|
@@ -19,8 +19,8 @@ import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { AttachmentComponent } from './create-task-attachment.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
|
||||
describe('AttachmentComponent', () => {
|
||||
let service: ProcessContentService;
|
||||
@@ -30,7 +30,7 @@ describe('AttachmentComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessTestingModule]
|
||||
imports: [ProcessTestingModule, AttachmentComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AttachmentComponent);
|
||||
component = fixture.componentInstance;
|
@@ -15,15 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { UploadDirective } from '@alfresco/adf-core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-task-attachment',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatButtonModule, UploadDirective, MatIconModule],
|
||||
styleUrls: ['./create-task-attachment.component.scss'],
|
||||
templateUrl: './create-task-attachment.component.html'
|
||||
})
|
||||
export class AttachmentComponent implements OnChanges {
|
||||
private processContentService = inject(ProcessContentService);
|
||||
|
||||
/** (required) The numeric ID of the task to display. */
|
||||
@Input()
|
||||
taskId: string;
|
||||
@@ -40,9 +49,7 @@ export class AttachmentComponent implements OnChanges {
|
||||
* from within the component.
|
||||
*/
|
||||
@Output()
|
||||
success = new EventEmitter<any>();
|
||||
|
||||
constructor(private processContentService: ProcessContentService) {}
|
||||
success = new EventEmitter<RelatedContentRepresentation>();
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['taskId']?.currentValue) {
|
@@ -20,9 +20,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { mockEmittedProcessAttachments, mockProcessAttachments } from '../mock/process/process-attachments.mock';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { mockEmittedProcessAttachments, mockProcessAttachments } from '../../mock/process/process-attachments.mock';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatMenuHarness } from '@angular/material/menu/testing';
|
||||
@@ -36,7 +36,7 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessTestingModule]
|
||||
imports: [ProcessTestingModule, ProcessAttachmentListComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(ProcessAttachmentListComponent);
|
||||
component = fixture.componentInstance;
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DownloadService, EmptyListComponent, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { DataTableModule, DownloadService, EmptyListComponent, ThumbnailService } from '@alfresco/adf-core';
|
||||
import {
|
||||
AfterContentInit,
|
||||
ContentChild,
|
||||
@@ -28,10 +28,15 @@ import {
|
||||
SimpleChanges,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-attachment-list',
|
||||
standalone: true,
|
||||
imports: [CommonModule, DataTableModule, TranslateModule, MatProgressSpinnerModule],
|
||||
styleUrls: ['./process-attachment-list.component.scss'],
|
||||
templateUrl: './process-attachment-list.component.html',
|
||||
encapsulation: ViewEncapsulation.None
|
@@ -15,9 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './task-attachment-list.component';
|
||||
export * from './process-attachment-list.component';
|
||||
export * from './create-process-attachment.component';
|
||||
export * from './create-task-attachment.component';
|
||||
import { TaskAttachmentListComponent } from './task-attachment-list/task-attachment-list.component';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list/process-attachment-list.component';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment/create-process-attachment.component';
|
||||
import { AttachmentComponent } from './create-task-attachment/create-task-attachment.component';
|
||||
|
||||
export * from './attachment.module';
|
||||
export * from './task-attachment-list/task-attachment-list.component';
|
||||
export * from './process-attachment-list/process-attachment-list.component';
|
||||
export * from './create-process-attachment/create-process-attachment.component';
|
||||
export * from './create-task-attachment/create-task-attachment.component';
|
||||
|
||||
export const ATTACHMENT_DIRECTIVES = [
|
||||
TaskAttachmentListComponent,
|
||||
ProcessAttachmentListComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
AttachmentComponent
|
||||
] as const;
|
||||
|
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SimpleChange, Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { SimpleChange, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { TaskAttachmentListComponent } from './task-attachment-list.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { mockEmittedTaskAttachments, mockTaskAttachments } from '../mock/task/task-attachments.mock';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { mockEmittedTaskAttachments, mockTaskAttachments } from '../../mock/task/task-attachments.mock';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||
@@ -40,8 +40,7 @@ describe('TaskAttachmentList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessTestingModule],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
imports: [ProcessTestingModule, TaskAttachmentListComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TaskAttachmentListComponent);
|
||||
component = fixture.componentInstance;
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ThumbnailService, EmptyListComponent, DownloadService } from '@alfresco/adf-core';
|
||||
import { ThumbnailService, EmptyListComponent, DownloadService, DataTableModule } from '@alfresco/adf-core';
|
||||
import {
|
||||
AfterContentInit,
|
||||
ContentChild,
|
||||
@@ -28,10 +28,15 @@ import {
|
||||
SimpleChanges,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { ProcessContentService } from '../form/services/process-content.service';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-task-attachment-list',
|
||||
standalone: true,
|
||||
imports: [CommonModule, DataTableModule, TranslateModule, MatProgressSpinnerModule],
|
||||
styleUrls: ['./task-attachment-list.component.scss'],
|
||||
templateUrl: './task-attachment-list.component.html',
|
||||
encapsulation: ViewEncapsulation.None
|
@@ -24,14 +24,14 @@ import { MaterialModule } from './material.module';
|
||||
|
||||
import { ProcessListModule } from './process-list/process-list.module';
|
||||
import { TaskListModule } from './task-list/task-list.module';
|
||||
import { AppsListModule } from './app-list/apps-list.module';
|
||||
import { ProcessCommentsModule } from './process-comments/process-comments.module';
|
||||
import { AttachmentModule } from './attachment/attachment.module';
|
||||
import { PeopleModule } from './people/people.module';
|
||||
import { FormModule } from './form/form.module';
|
||||
import { ProcessFormRenderingService } from './form/process-form-rendering.service';
|
||||
import { TaskCommentsModule } from './task-comments/task-comments.module';
|
||||
import { ProcessUserInfoModule } from './process-user-info/process-user-info.module';
|
||||
import { ATTACHMENT_DIRECTIVES } from './attachment';
|
||||
import { APPS_LIST_DIRECTIVES } from './app-list';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -44,9 +44,9 @@ import { ProcessUserInfoModule } from './process-user-info/process-user-info.mod
|
||||
ProcessListModule,
|
||||
TaskListModule,
|
||||
TaskCommentsModule,
|
||||
AppsListModule,
|
||||
...APPS_LIST_DIRECTIVES,
|
||||
ProcessUserInfoModule,
|
||||
AttachmentModule,
|
||||
...ATTACHMENT_DIRECTIVES,
|
||||
PeopleModule,
|
||||
FormModule,
|
||||
EmptyContentComponent
|
||||
@@ -60,9 +60,9 @@ import { ProcessUserInfoModule } from './process-user-info/process-user-info.mod
|
||||
ProcessListModule,
|
||||
TaskListModule,
|
||||
TaskCommentsModule,
|
||||
AppsListModule,
|
||||
...APPS_LIST_DIRECTIVES,
|
||||
ProcessUserInfoModule,
|
||||
AttachmentModule,
|
||||
...ATTACHMENT_DIRECTIVES,
|
||||
PeopleModule,
|
||||
FormModule
|
||||
]
|
||||
|
Reference in New Issue
Block a user