Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ A collection of Angular components for generic use.
| [Json Cell component](core/components/json-cell.component.md) | Shows a JSON-formatted value inside a datatable component. | [Source](../lib/core/src/lib/datatable/components/json-cell/json-cell.component.ts) |
| [Language Menu component](core/components/language-menu.component.md) | Displays all the languages that are present in "app.config.json" and the default (EN). | [Source](../lib/core/src/lib/language-menu/language-menu.component.ts) |
| [Login Dialog Panel component](core/components/login-dialog-panel.component.md) | Shows and manages a login dialog. | [Source](../lib/core/src/lib/login/components/login-dialog-panel.component.ts) |
| [Login Dialog component](core/components/login-dialog.component.md) | Allows a user to perform a login via a dialog. | [Source](../lib/core/src/lib/login/components/login-dialog.component.ts) |
| [Login component](core/components/login.component.md) | Authenticates to Alfresco Content Services and Alfresco Process Services. | [Source](../lib/core/src/lib/login/components/login.component.ts) |
| [Notification History component](core/components/notification-history.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | This component is in the current status just an experimental component. The main purpose of the Notification history component is list all the notification received in the current session. They will disappear from the list after the refresh. | [Source](../lib/core/src/lib/notifications/components/notification-history.component.ts) | |
| [Pagination Component](core/components/pagination.component.md) | Adds pagination to the component it is used with. | [Source](../lib/core/src/lib/pagination/pagination.component.ts) |
Expand Down Expand Up @@ -221,6 +222,7 @@ A collection of Angular components for generic use.
| [Identity user service](core/services/identity-user.service.md) | Gets OAuth2 personal details and roles for users and performs CRUD operations on identity users. | [Source](../lib/process-services-cloud/src/lib/people/services/identity-user.service.ts) |
| [JWT helper service](core/services/jwt-helper.service.md) | Decodes a JSON Web Token (JWT) to a JavaScript object. | [Source](../lib/core/src/lib/auth/services/jwt-helper.service.ts) |
| [Log Service](core/services/log.service.md) | Provides log functionality. | [Source](../lib/core/src/lib/common/services/log.service.ts) |
| [Login Dialog service](core/services/login-dialog.service.md) | Manages login dialogs. | [Source](../lib/core/src/lib/services/login-dialog.service.ts) |
| [Nodes Api service](core/services/nodes-api.service.md) | Accesses and manipulates ACS document nodes using their node IDs. | [Source](../lib/content-services/src/lib/common/services/nodes-api.service.ts) |
| [Notification Service](core/services/notification.service.md) | Shows a notification message with optional feedback. | [Source](../lib/core/src/lib/notifications/services/notification.service.ts) |
| [Page Title service](core/services/page-title.service.md) | Sets the page title. | [Source](../lib/core/src/lib/common/services/page-title.service.ts) |
Expand Down Expand Up @@ -470,10 +472,12 @@ for more information about installing and using the source code.

| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [App List Cloud Component](process-services-cloud/components/app-list-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows all deployed cloud application instances. | [Source](../lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts) |
| [Edit Process Filter Cloud component](process-services-cloud/components/edit-process-filter-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows/edits process filter details. | [Source](../lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts) |
| [Edit Task Filter Cloud component](process-services-cloud/components/edit-task-filter-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Edits task filter details. | [Source](../lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.ts) |
| [Form cloud custom outcomes component](process-services-cloud/components/form-cloud-custom-outcome.component.md) | Supplies custom outcome buttons to be included in Form cloud component. | [Source](../lib/process-services-cloud/src/lib/form/components/form-cloud-custom-outcomes.component.ts) |
| [Form cloud component](process-services-cloud/components/form-cloud.component.md) | Shows a form from Process Services. | [Source](../lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts) |
| [Form Definition Selector Cloud](process-services-cloud/components/form-definition-selector-cloud.component.md) | Allows one form to be selected from a dropdown list. For forms to be displayed in this component they will need to be compatible with standAlone tasks. | [Source](../lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts) |
| [Group Cloud component](process-services-cloud/components/group-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Searches Groups. | [Source](../lib/process-services-cloud/src/lib/group/components/group-cloud.component.ts) |
| [](process-services-cloud/components/people-cloud.component.md) | Title: People Cloud Component | |

Expand Down
9 changes: 9 additions & 0 deletions docs/core/components/login-dialog-panel.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ Shows and manages a login dialog.
| Name | Type | Description |
| ---- | ---- | ----------- |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`LoginSuccessEvent`](../../../lib/core/src/lib/login/models/login-success.event.ts)`>` | Emitted when the login succeeds. |

## Details

This component has similar features to the [Login Dialog component](login-dialog.component.md)
but it also creates and manages the dialog for you.

## See also

- [Login Dialog component](login-dialog.component.md)
89 changes: 89 additions & 0 deletions docs/core/components/login-dialog.component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
Title: Login Dialog component
Added: v2.6.0
Status: Active
Last reviewed: 2018-10-02
---

# [Login Dialog component](../../../lib/core/src/lib/login/components/login-dialog.component.ts "Defined in login-dialog.component.ts")

Allows a user to perform a login via a dialog.

## Details

The [Login Dialog component](login-dialog.component.md) allows you to perform a login via a dialog.

### Showing the dialog

Unlike most components, the [Login Dialog Component](login-dialog.component.md) is typically shown in a dialog box
rather than the main page and you are responsible for opening the dialog yourself. You can use the
[Angular Material Dialog](https://material.angular.io/components/dialog/overview) for this,
as shown in the usage example. ADF provides the [`LoginDialogComponentData`](../../../lib/core/src/lib/login/components/login-dialog-component-data.interface.ts) interface
to work with the Dialog's
[data option](https://material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component-):

```ts
export interface LoginDialogComponentData {
title: string;
actionName?: string;
logged: Subject<any>;
}
```

The properties are described in the table below:

| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| title | `string` | "" | Dialog title |
| actionName | `string` | "" | Text to appear on the dialog's main action button ("Login", "Access", etc) |
| logged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | | Event emitted when the login succeeds. |

If you don't want to manage the dialog yourself then it is easier to use the
[Login Dialog Panel component](login-dialog-panel.component.md), or the
methods of the [Login Dialog service](../services/login-dialog.service.md), which create
the dialog for you.

### Usage example

```ts
import { MatDialog } from '@angular/material/dialog';
import { LoginDialogComponentData, LoginDialogComponent} from '@adf/core'
import { Subject } from 'rxjs/Subject';
...

constructor(dialog: MatDialog ... ) {}

openLoginDialog() {
data: LoginDialogComponentData = {
title: "Perform a Login",
actionName: "Access",
logged: new Subject<any>()
};

this.dialog.open(
LoginDialogComponent,
{
data, panelClass: 'adf-login-dialog',
width: '630px'
}
);

data.logged.subscribe(() => {
// Action after being logged in...
},
(error)=>{
//your error handling
},
()=>{
//action called when an action or cancel is clicked on the dialog
this.dialog.closeAll();
});
}
```

All the results will be streamed to the logged [subject](http://reactivex.io/rxjs/manual/overview.html#subject) present in the [`LoginDialogComponentData`](../../../lib/core/src/lib/login/components/login-dialog-component-data.interface.ts) object passed to the dialog.
When the dialog action is selected by clicking, the `data.logged` stream will be completed.

## See also

- [Login component](login.component.md)
24 changes: 24 additions & 0 deletions docs/core/services/login-dialog.service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
Title: Login Dialog service
Added: v2.6.0
Status: Active
Last reviewed: 2019-02-08
---

# [Login Dialog service](../../../lib/core/src/lib/services/login-dialog.service.ts "Defined in login-dialog.service.ts")

Manages login dialogs.

## Methods

- **openLogin**(actionName: `string`, title: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<string>`<br/>
Opens a login dialog.
- _actionName:_ `string` - Text to show in the main action button
- _title:_ `string` - Title for the login dialog
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<string>` - Confirmation of login from the dialog
- **close**(): `<void>`<br/>
Closes the currently open login dialog.

## See also

- [Login component](../components/login.component.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
Title: App List Cloud Component
Added: v3.0.0
Status: Experimental
Last reviewed: 2025-01-03
---

# App List Cloud Component

`standalone`, `component`

Shows all deployed cloud application instances.

## Basic Usage

```html
<adf-cloud-app-list [layoutType]="'GRID'" />
```

### [Transclusions](../../user-guide/transclusion.md)

You can show custom content when there are no apps available by supplying an
`<adf-custom-empty-content>` section:

```html
<adf-cloud-app-list [layoutType]="'GRID'">
<adf-custom-empty-content>
No Apps present
</adf-custom-empty-content>
</adf-cloud-app-list>
```

## Activiti 7

If you are generating a project for Activiti 7, you must add the list of apps you want to use in **app.config.json** .

For example :

```json
{
"alfresco-deployed-apps": [
{
"name": "simple-app"
}
]
}
```

## Class members

### Properties

| Name | Type | Default value | Description |
|------------|----------|---------------|--------------------------------------------------------------------------------------------------|
| layoutType | `string` | LAYOUT_GRID | (**required**) Defines the layout of the apps. There are two possible values, "GRID" and "LIST". |

### Events

| Name | Type | Description |
|----------|------------------------------------------|---------------------------------------|
| appClick | `EventEmitter<ApplicationInstanceModel>` | Emitted when an app entry is clicked. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
Title: Form Definition Selector Cloud
Added: v3.3.0
Status: Active
---

# [Form Definition Selector Cloud](../../../lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts "Defined in form-definition-selector-cloud.component.ts")

Allows one form to be selected from a dropdown list. For forms to be displayed in this component they will need to be compatible with standAlone tasks.

## Basic Usage

```html
<adf-cloud-form-definition-selector
[appName]="'simple-app'"
(selectForm)="onFormSelect($event)">
</adf-cloud-form-definition-selector>
```

## Class members

### Properties

| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | "" | Name of the application. If specified, this shows the users who have access to the app. |

### Events

| Name | Type | Description |
| ---- | ---- | ----------- |
| selectForm | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string>` | Emitted when a form is selected. |
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ For example :
```json
"alfresco-deployed-apps" : [{"name": "simple-app"}]
```

## See also

- [App list cloud component](../components/app-list-cloud.component.md)
2 changes: 2 additions & 0 deletions docs/versionIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ backend services have been tested with each released version of ADF.
<!--v260 start-->

- [Login dialog panel component](core/components/login-dialog-panel.component.md)
- [Login dialog component](core/components/login-dialog.component.md)
- [Login dialog service](core/services/login-dialog.service.md)

<!--v260 end-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</mat-chip-grid>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)" id="adf-search-chip-autocomplete"
(optionActivated)="activeAnyOption = true" (closed)="activeAnyOption = false">
<ng-container *ngIf="optionInput.value.length > 0">
<mat-option
*ngFor="let option of filteredOptions"
[value]="option"
Expand All @@ -45,5 +46,6 @@
>
{{ option.fullPath || option.value }}
</mat-option>
</ng-container>
</mat-autocomplete>
</mat-form-field>
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,5 @@ describe('SearchChipAutocompleteInputComponent', () => {
component.selectedOptions = [option];
expect(component.isOptionSelected(option)).toBeTrue();
});

it('should clear filteredOptions after input is cleared', async () => {
enterNewInputValue('option');
await fixture.whenStable();
fixture.detectChanges();
expect(component.filteredOptions.length).toBe(component.autocompleteOptions.length);

enterNewInputValue('');
await fixture.whenStable();
fixture.detectChanges();
expect(component.filteredOptions.length).toBe(component.autocompleteOptions.length);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { ENTER } from '@angular/cdk/keycodes';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MatChipInputEvent, MatChipsModule } from '@angular/material/chips';
import { Observable, timer } from 'rxjs';
import { EMPTY, Observable, timer } from 'rxjs';
import { debounce, startWith, tap } from 'rxjs/operators';
import { AutocompleteOption } from '../../models/autocomplete-option.interface';
import { CommonModule } from '@angular/common';
Expand Down Expand Up @@ -77,7 +77,7 @@ export class SearchChipAutocompleteInputComponent implements OnInit, OnChanges {
@Input()
filter = (options: AutocompleteOption[], value: string): AutocompleteOption[] => {
const filterValue = value.toLowerCase();
return options?.filter((option) => option.value.toLowerCase().includes(filterValue)).slice(0, 15) ?? [];
return options.filter((option) => option.value.toLowerCase().includes(filterValue)).slice(0, 15);
};

@Output()
Expand All @@ -104,11 +104,11 @@ export class SearchChipAutocompleteInputComponent implements OnInit, OnChanges {
.pipe(
startWith(''),
tap(() => (this.activeAnyOption = false)),
debounce(() => timer(300)),
debounce((value: string) => (value ? timer(300) : EMPTY)),
takeUntilDestroyed(this.destroyRef)
)
.subscribe((value: string) => {
this.filteredOptions = this.filter(this.autocompleteOptions, value);
this.filteredOptions = value ? this.filter(this.autocompleteOptions, value) : [];
this.inputChanged.emit(value);
});
this.onReset$?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.reset());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { AutocompleteField } from '../../models/autocomplete-option.interface';
import { TagService } from '../../../tag/services/tag.service';
import { SitesService } from '../../../common/services/sites.service';
import { SitePaging } from '@alfresco/js-api';
import { CategoryService } from '../../../category';

describe('SearchFilterAutocompleteChipsComponent', () => {
let component: SearchFilterAutocompleteChipsComponent;
Expand Down Expand Up @@ -212,31 +211,4 @@ describe('SearchFilterAutocompleteChipsComponent', () => {
done();
});
});

it('should still call sitesService.getSites when input is empty for LOCATION field', () => {
component.settings.field = AutocompleteField.LOCATION;
const getSitesSpy = spyOn(sitesService, 'getSites').and.returnValue(
of({
list: { entries: [], pagination: {} }
})
);

component.onInputChange('');

expect(getSitesSpy).toHaveBeenCalled();
});

it('should still call categoryService.searchCategories when input is empty for CATEGORIES field', () => {
component.settings.field = AutocompleteField.CATEGORIES;
const categoryService = TestBed.inject(CategoryService);
const searchSpy = spyOn(categoryService, 'searchCategories').and.returnValue(
of({
list: { entries: [], pagination: {} }
})
);

component.onInputChange('');

expect(searchSpy).toHaveBeenCalledWith('', 0, 15);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ export class SearchFilterAutocompleteChipsComponent implements SearchWidget, OnI
}

onInputChange(value: string) {
if (this.settings.field === AutocompleteField.CATEGORIES) {
this.searchForExistingCategories(value);
} else if (this.settings.field === AutocompleteField.LOCATION) {
this.populateSitesOptions();
if (value) {
if (this.settings.field === AutocompleteField.CATEGORIES) {
this.searchForExistingCategories(value);
} else if (this.settings.field === AutocompleteField.LOCATION) {
this.populateSitesOptions();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</section>

<section class="adf-upload-dialog__content"
[class.adf-upload-dialog--padding]="isConfirmation" aria-live="polite">
[class.adf-upload-dialog--padding]="isConfirmation">
<adf-file-uploading-list
class="adf-file-uploading-list"
[class.adf-upload-dialog--hide]="isConfirmation"
Expand Down
Loading
Loading