Skip to content

Commit

Permalink
[ACS-7422] APS1 attachment module as standalone components (#9718)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysVuika authored May 23, 2024
1 parent 5f00aca commit b916fd5
Show file tree
Hide file tree
Showing 31 changed files with 90 additions and 133 deletions.
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,25 +415,25 @@ for more information about installing and using the source code.
| [Apps List Component](process-services/components/apps-list.component.md) | Shows all available apps. | [Source](../lib/process-services/src/lib/app-list/apps-list.component.ts) |
| [Attach Form component](process-services/components/attach-form.component.md) | This component can be used when there is no form attached to a task and you want to add one. | [Source](../lib/process-services/src/lib/task-list/components/attach-form.component.ts) |
| [Checklist Component](process-services/components/checklist.component.md) | Shows the checklist task functionality. | [Source](../lib/process-services/src/lib/task-list/components/checklist.component.ts) |
| [Create Process Attachment component](process-services/components/create-process-attachment.component.md) | Displays an Upload Component (Drag and Click) to upload the attachment to a specified process instance. | [Source](../lib/process-services/src/lib/attachment/create-process-attachment.component.ts) |
| [Create Task Attachment Component](process-services/components/create-task-attachment.component.md) | Displays an Upload Component (Drag and Click) to upload the attachment to a specified task. | [Source](../lib/process-services/src/lib/attachment/create-task-attachment.component.ts) |
| [Create Process Attachment component](process-services/components/create-process-attachment.component.md) | Displays an Upload Component (Drag and Click) to upload the attachment to a specified process instance. | [Source](../lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts) |
| [Create Task Attachment Component](process-services/components/create-task-attachment.component.md) | Displays an Upload Component (Drag and Click) to upload the attachment to a specified task. | [Source](../lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts) |
| [Form custom outcomes component](process-services/components/form-custom-outcome.component.md) | Supplies custom outcome buttons to be included in Form component. | [Source](../lib/process-services/src/lib/form/form-custom-outcomes.component.ts) |
| [Form component](process-services/components/form.component.md) | Shows a Form from APS | [Source](../lib/process-services/src/lib/form/form.component.ts) |
| [People list component](process-services/components/people-list.component.md) | Shows a list of users (people). | [Source](../lib/process-services/src/lib/people/components/people-list/people-list.component.ts) |
| [People Search component](process-services/components/people-search.component.md) | Searches users/people. | [Source](../lib/process-services/src/lib/people/components/people-search/people-search.component.ts) |
| [People Component](process-services/components/people.component.md) | Displays users involved with a specified task | [Source](../lib/process-services/src/lib/people/components/people/people.component.ts) |
| [Process Attachment List component](process-services/components/process-attachment-list.component.md) | Displays documents attached to a specified process instance. | [Source](../lib/process-services/src/lib/attachment/process-attachment-list.component.ts) |
| [Process Attachment List component](process-services/components/process-attachment-list.component.md) | Displays documents attached to a specified process instance. | [Source](../lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts) |
| [Process Instance Comments component](process-services/components/process-comments.component.md) | Displays comments associated with a particular process instance and allows the user to add new comments. | [Source](../lib/process-services/src/lib/process-comments/process-comments.component.ts) |
| [Process Filters Component](process-services/components/process-filters.component.md) | Collection of criteria used to filter process instances, which may be customized by users. | [Source](../lib/process-services/src/lib/process-list/components/process-filters.component.ts) |
| [Process Details component](process-services/components/process-instance-details.component.md) | Displays detailed information about a specified process instance | [Source](../lib/process-services/src/lib/process-list/components/process-instance-details.component.ts) |
| [Process Instance Details Header component](process-services/components/process-instance-header.component.md) | Sub-component of the process details component, which renders some general information about the selected process. | [Source](../lib/process-services/src/lib/process-list/components/process-instance-header.component.ts) |
| [Process Instance Tasks component](process-services/components/process-instance-tasks.component.md) | Lists both the active and completed tasks associated with a particular process instance | [Source](../lib/process-services/src/lib/process-list/components/process-instance-tasks.component.ts) |
| [Process Instance List](process-services/components/process-list.component.md) | Renders a list containing all the process instances matched by the parameters specified. | [Source](../lib/process-services/src/lib/process-list/components/process-list.component.ts) |
| [Process User Info component](process-services/components/process-user-info.component.md) | Shows user information for PROCESS and ALL mode. | [Source](../lib/process-services/src/lib/process-user-info/process-user-info.component.ts) |
| [Select App Component](process-services/components/select-apps-dialog.component.md) | Shows all available apps and returns the selected app. | [Source](../lib/process-services/src/lib/app-list/select-apps-dialog.component.ts) |
| [Select App Component](process-services/components/select-apps-dialog.component.md) | Shows all available apps and returns the selected app. | [Source](../lib/process-services/src/lib/app-list/select-apps-dialog/select-apps-dialog.component.ts) |
| [Start Process component](process-services/components/start-process.component.md) | Starts a process. | [Source](../lib/process-services/src/lib/process-list/components/start-process.component.ts) |
| [Start Task Component](process-services/components/start-task.component.md) | Creates/Starts a new task for the specified app. | [Source](../lib/process-services/src/lib/task-list/components/start-task.component.ts) |
| [Task Attachment List Component](process-services/components/task-attachment-list.component.md) | Displays documents attached to a specified task. | [Source](../lib/process-services/src/lib/attachment/task-attachment-list.component.ts) |
| [Task Attachment List Component](process-services/components/task-attachment-list.component.md) | Displays documents attached to a specified task. | [Source](../lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts) |
| [Task Comments Component](process-services/components/task-comments.component.md) | Displays comments from users involved in a specified task and allows an involved user to add a comment to a task. | [Source](../lib/process-services/src/lib/task-comments/task-comments.component.ts) |
| [Task Details component](process-services/components/task-details.component.md) | Shows the details of the task ID passed in as input. | [Source](../lib/process-services/src/lib/task-list/components/task-details.component.ts) |
| [Task Filters component](process-services/components/task-filters.component.md) | Shows all available filters. | [Source](../lib/process-services/src/lib/task-list/components/task-filters.component.ts) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---

# [Create Process Attachment component](../../../lib/process-services/src/lib/attachment/create-process-attachment.component.ts "Defined in create-process-attachment.component.ts")
# [Create Process Attachment component](../../../lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts "Defined in create-process-attachment.component.ts")

Displays an Upload Component (Drag and Click) to upload the attachment to a specified process instance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---

# [Create Task Attachment Component](../../../lib/process-services/src/lib/attachment/create-task-attachment.component.ts "Defined in create-task-attachment.component.ts")
# [Create Task Attachment Component](../../../lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts "Defined in create-task-attachment.component.ts")

Displays an Upload Component (Drag and Click) to upload the attachment to a specified task.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---

# [Process Attachment List component](../../../lib/process-services/src/lib/attachment/process-attachment-list.component.ts "Defined in process-attachment-list.component.ts")
# [Process Attachment List component](../../../lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts "Defined in process-attachment-list.component.ts")

Displays documents attached to a specified process instance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---

# [Select App Component](../../../lib/process-services/src/lib/app-list/select-apps-dialog.component.ts "Defined in select-apps-dialog.component.ts")
# [Select App Component](../../../lib/process-services/src/lib/app-list/select-apps-dialog/select-apps-dialog.component.ts "Defined in select-apps-dialog.component.ts")

Shows all available apps and returns the selected app.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---

# [Task Attachment List Component](../../../lib/process-services/src/lib/attachment/task-attachment-list.component.ts "Defined in task-attachment-list.component.ts")
# [Task Attachment List Component](../../../lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts "Defined in task-attachment-list.component.ts")

Displays documents attached to a specified task.

Expand Down
30 changes: 0 additions & 30 deletions lib/process-services/src/lib/app-list/apps-list.module.ts

This file was deleted.

8 changes: 5 additions & 3 deletions lib/process-services/src/lib/app-list/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
47 changes: 0 additions & 47 deletions lib/process-services/src/lib/attachment/attachment.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -47,7 +47,7 @@ describe('CreateProcessAttachmentComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ProcessTestingModule]
imports: [ProcessTestingModule, CreateProcessAttachmentComponent]
});
fixture = TestBed.createComponent(CreateProcessAttachmentComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +30,7 @@ describe('AttachmentComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ProcessTestingModule]
imports: [ProcessTestingModule, AttachmentComponent]
});
fixture = TestBed.createComponent(AttachmentComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
Loading

0 comments on commit b916fd5

Please sign in to comment.