mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
renmove gropu and container as form field to review
fix most of the content cycle deps Signed-off-by: eromano <eugenioromano16@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-aspect-list-dialog',
|
selector: 'adf-aspect-list-dialog',
|
||||||
templateUrl: './aspect-list-dialog.component.html',
|
templateUrl: './aspect-list-dialog.component.html',
|
||||||
|
@@ -19,7 +19,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsul
|
|||||||
import { NodesApiService } from '@alfresco/adf-core';
|
import { NodesApiService } from '@alfresco/adf-core';
|
||||||
import { Observable, Subject, zip } from 'rxjs';
|
import { Observable, Subject, zip } from 'rxjs';
|
||||||
import { concatMap, map, takeUntil, tap } from 'rxjs/operators';
|
import { concatMap, map, takeUntil, tap } from 'rxjs/operators';
|
||||||
import { AspectListService } from './aspect-list.service';
|
import { AspectListService } from './services/aspect-list.service';
|
||||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||||
import { AspectEntry } from '@alfresco/js-api';
|
import { AspectEntry } from '@alfresco/js-api';
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -17,8 +17,9 @@
|
|||||||
|
|
||||||
export * from './aspect-list.component';
|
export * from './aspect-list.component';
|
||||||
export * from './aspect-list-dialog.component';
|
export * from './aspect-list-dialog.component';
|
||||||
export * from './aspect-list.service';
|
export * from './services/aspect-list.service';
|
||||||
export * from './node-aspect.service';
|
export * from './services/node-aspect.service';
|
||||||
|
export * from './services/dialog-aspect-list.service';
|
||||||
|
|
||||||
export * from './aspect-list-dialog-data.interface';
|
export * from './aspect-list-dialog-data.interface';
|
||||||
|
|
||||||
|
@@ -16,11 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||||
import { from, Observable, of, Subject, zip } from 'rxjs';
|
import { from, Observable, of, zip } from 'rxjs';
|
||||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
|
||||||
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
|
import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@@ -37,7 +34,6 @@ export class AspectListService {
|
|||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||||
private appConfigService: AppConfigService,
|
private appConfigService: AppConfigService,
|
||||||
private dialog: MatDialog,
|
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,34 +97,4 @@ export class AspectListService {
|
|||||||
return visibleAspectList;
|
return visibleAspectList;
|
||||||
}
|
}
|
||||||
|
|
||||||
openAspectListDialog(nodeId?: string): Observable<string[]> {
|
|
||||||
const select = new Subject<string[]>();
|
|
||||||
select.subscribe({
|
|
||||||
complete: this.close.bind(this)
|
|
||||||
});
|
|
||||||
|
|
||||||
const data: AspectListDialogComponentData = {
|
|
||||||
title: 'ADF-ASPECT-LIST.DIALOG.TITLE',
|
|
||||||
description: 'ADF-ASPECT-LIST.DIALOG.DESCRIPTION',
|
|
||||||
overTableMessage: 'ADF-ASPECT-LIST.DIALOG.OVER-TABLE-MESSAGE',
|
|
||||||
select,
|
|
||||||
nodeId
|
|
||||||
};
|
|
||||||
|
|
||||||
this.openDialog(data, 'adf-aspect-list-dialog', '750px');
|
|
||||||
return select;
|
|
||||||
}
|
|
||||||
|
|
||||||
private openDialog(data: AspectListDialogComponentData, panelClass: string, width: string) {
|
|
||||||
this.dialog.open(AspectListDialogComponent, {
|
|
||||||
data,
|
|
||||||
panelClass,
|
|
||||||
width,
|
|
||||||
disableClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.dialog.closeAll();
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -0,0 +1,62 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* 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 { Injectable } from '@angular/core';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
import { Observable, Subject } from 'rxjs';
|
||||||
|
import { AspectListDialogComponentData } from '../aspect-list-dialog-data.interface';
|
||||||
|
import { AspectListDialogComponent } from '../aspect-list-dialog.component';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class DialogAspectListService {
|
||||||
|
|
||||||
|
constructor(private dialog: MatDialog) {
|
||||||
|
}
|
||||||
|
|
||||||
|
openAspectListDialog(nodeId?: string): Observable<string[]> {
|
||||||
|
const select = new Subject<string[]>();
|
||||||
|
select.subscribe({
|
||||||
|
complete: this.close.bind(this)
|
||||||
|
});
|
||||||
|
|
||||||
|
const data: AspectListDialogComponentData = {
|
||||||
|
title: 'ADF-ASPECT-LIST.DIALOG.TITLE',
|
||||||
|
description: 'ADF-ASPECT-LIST.DIALOG.DESCRIPTION',
|
||||||
|
overTableMessage: 'ADF-ASPECT-LIST.DIALOG.OVER-TABLE-MESSAGE',
|
||||||
|
select,
|
||||||
|
nodeId
|
||||||
|
};
|
||||||
|
|
||||||
|
this.openDialog(data, 'adf-aspect-list-dialog', '750px');
|
||||||
|
return select;
|
||||||
|
}
|
||||||
|
|
||||||
|
private openDialog(data: AspectListDialogComponentData, panelClass: string, width: string) {
|
||||||
|
this.dialog.open(AspectListDialogComponent, {
|
||||||
|
data,
|
||||||
|
panelClass,
|
||||||
|
width,
|
||||||
|
disableClose: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.dialog.closeAll();
|
||||||
|
}
|
||||||
|
}
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, CardViewUpdateService, NodesApiService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, CardViewUpdateService, NodesApiService } from '@alfresco/adf-core';
|
||||||
import { AspectListService } from './aspect-list.service';
|
import { DialogAspectListService } from './dialog-aspect-list.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -26,12 +26,12 @@ export class NodeAspectService {
|
|||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||||
private nodesApiService: NodesApiService,
|
private nodesApiService: NodesApiService,
|
||||||
private aspectListService: AspectListService,
|
private dialogAspectListService: DialogAspectListService,
|
||||||
private cardViewUpdateService: CardViewUpdateService) {
|
private cardViewUpdateService: CardViewUpdateService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateNodeAspects(nodeId: string) {
|
updateNodeAspects(nodeId: string) {
|
||||||
this.aspectListService.openAspectListDialog(nodeId).subscribe((aspectList) => {
|
this.dialogAspectListService.openAspectListDialog(nodeId).subscribe((aspectList) => {
|
||||||
this.nodesApiService.updateNode(nodeId, { aspectNames: [...aspectList] }).subscribe((updatedNode) => {
|
this.nodesApiService.updateNode(nodeId, { aspectNames: [...aspectList] }).subscribe((updatedNode) => {
|
||||||
this.alfrescoApiService.nodeUpdated.next(updatedNode);
|
this.alfrescoApiService.nodeUpdated.next(updatedNode);
|
||||||
this.cardViewUpdateService.updateNodeAspect(updatedNode);
|
this.cardViewUpdateService.updateNodeAspect(updatedNode);
|
@@ -28,7 +28,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { MatSelect } from '@angular/material/select';
|
import { MatSelect } from '@angular/material/select';
|
||||||
import { Node, PathElementEntity } from '@alfresco/js-api';
|
import { Node, PathElementEntity } from '@alfresco/js-api';
|
||||||
import { DocumentListComponent } from '../document-list';
|
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { ContentService, AllowableOperationsEnum, VersionCompatibilityService } from '@alfresco/adf-core';
|
import { ContentService, AllowableOperationsEnum, VersionCompatibilityService } from '@alfresco/adf-core';
|
||||||
import { NodeAspectService } from '../../../aspect-list/node-aspect.service';
|
import { NodeAspectService } from '../../../aspect-list/services/node-aspect.service';
|
||||||
import { PresetConfig } from '../../interfaces/content-metadata.interfaces';
|
import { PresetConfig } from '../../interfaces/content-metadata.interfaces';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-content-metadata-card',
|
selector: 'adf-content-metadata-card',
|
||||||
|
@@ -47,11 +47,12 @@ import { RowFilter } from '../document-list/data/row-filter.model';
|
|||||||
import { ImageResolver } from '../document-list/data/image-resolver.model';
|
import { ImageResolver } from '../document-list/data/image-resolver.model';
|
||||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
import { CustomResourcesService } from '../document-list/services/custom-resources.service';
|
import { CustomResourcesService } from '../document-list/services/custom-resources.service';
|
||||||
import { NodeEntryEvent, ShareDataRow } from '../document-list';
|
import { ShareDataRow } from '../document-list/data/share-data-row.model';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { SEARCH_QUERY_SERVICE_TOKEN } from '../search/search-query-service.token';
|
import { SEARCH_QUERY_SERVICE_TOKEN } from '../search/search-query-service.token';
|
||||||
import { SearchQueryBuilderService } from '../search/services/search-query-builder.service';
|
import { SearchQueryBuilderService } from '../search/services/search-query-builder.service';
|
||||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||||
|
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||||
|
|
||||||
export type ValidationFunction = (entry: Node) => boolean;
|
export type ValidationFunction = (entry: Node) => boolean;
|
||||||
|
|
||||||
|
@@ -19,33 +19,35 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||||||
import { RoleModel } from '../../models/role.model';
|
import { RoleModel } from '../../models/role.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-user-role-column',
|
selector: 'adf-user-role-column',
|
||||||
template: `
|
template: `
|
||||||
<mat-form-field floatLabel="never" class="adf-role-selector-field" *ngIf="!readonly">
|
<mat-form-field floatLabel="never" class="adf-role-selector-field" *ngIf="!readonly">
|
||||||
<mat-select
|
<mat-select
|
||||||
(click)="$event.stopPropagation()"
|
(click)="$event.stopPropagation()"
|
||||||
[placeholder]="placeholder | translate"
|
[placeholder]="placeholder | translate"
|
||||||
[value]="value"
|
[value]="value"
|
||||||
(selectionChange)="onRoleChanged($event.value)">
|
(selectionChange)="onRoleChanged($event.value)">
|
||||||
<mat-option *ngFor="let role of roles" [value]="role.role">
|
<mat-option *ngFor="let role of roles" [value]="role.role">
|
||||||
{{ role.label | adfLocalizedRole }}
|
{{ role.label | adfLocalizedRole }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<span class="adf-datatable-cell-value adf-readonly-role" [title]="value | adfLocalizedRole" *ngIf="readonly">
|
<span class="adf-datatable-cell-value adf-readonly-role" [title]="value | adfLocalizedRole" *ngIf="readonly">
|
||||||
{{value | adfLocalizedRole}}
|
{{value | adfLocalizedRole}}
|
||||||
</span>
|
</span>
|
||||||
`,
|
`,
|
||||||
host: { class: 'adf-user-role-column adf-datatable-content-cell adf-expand-cell-4' },
|
host: { class: 'adf-user-role-column adf-datatable-content-cell adf-expand-cell-4' },
|
||||||
styles: [
|
styles: [
|
||||||
`.adf-role-selector-field {
|
`.adf-role-selector-field {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.mat-form-field {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 200px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adf-role-selector-field .mat-form-field {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
.adf-readonly-role {
|
.adf-readonly-role {
|
||||||
padding-left: 0 !important;
|
padding-left: 0 !important;
|
||||||
}
|
}
|
||||||
|
@@ -15,8 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ContainerWidgetComponent } from './container/container.widget';
|
|
||||||
import { TabsWidgetComponent } from './tabs/tabs.widget';
|
|
||||||
import { UnknownWidgetComponent } from './unknown/unknown.widget';
|
import { UnknownWidgetComponent } from './unknown/unknown.widget';
|
||||||
|
|
||||||
import { AmountWidgetComponent } from './amount/amount.widget';
|
import { AmountWidgetComponent } from './amount/amount.widget';
|
||||||
@@ -53,10 +51,6 @@ import { FileViewerWidgetComponent } from './file-viewer/file-viewer.widget';
|
|||||||
export * from './widget.component';
|
export * from './widget.component';
|
||||||
export * from './core/index';
|
export * from './core/index';
|
||||||
|
|
||||||
// containers
|
|
||||||
export * from './tabs/tabs.widget';
|
|
||||||
export * from './container/container.widget';
|
|
||||||
|
|
||||||
// primitives
|
// primitives
|
||||||
export * from './unknown/unknown.widget';
|
export * from './unknown/unknown.widget';
|
||||||
export * from './text/text.widget';
|
export * from './text/text.widget';
|
||||||
@@ -94,8 +88,6 @@ export * from './text/text-mask.component';
|
|||||||
|
|
||||||
export const WIDGET_DIRECTIVES: any[] = [
|
export const WIDGET_DIRECTIVES: any[] = [
|
||||||
UnknownWidgetComponent,
|
UnknownWidgetComponent,
|
||||||
TabsWidgetComponent,
|
|
||||||
ContainerWidgetComponent,
|
|
||||||
TextWidgetComponent,
|
TextWidgetComponent,
|
||||||
NumberWidgetComponent,
|
NumberWidgetComponent,
|
||||||
CheckboxWidgetComponent,
|
CheckboxWidgetComponent,
|
||||||
|
@@ -40,6 +40,8 @@ import { EditJsonDialogModule } from '../dialogs/edit-json/edit-json.dialog.modu
|
|||||||
import { A11yModule } from '@angular/cdk/a11y';
|
import { A11yModule } from '@angular/cdk/a11y';
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
import { ViewerModule } from '../viewer/viewer.module';
|
import { ViewerModule } from '../viewer/viewer.module';
|
||||||
|
import { TabsWidgetComponent } from './components/widgets/tabs/tabs.widget';
|
||||||
|
import { ContainerWidgetComponent } from './components/widgets/container/container.widget';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -67,7 +69,8 @@ import { ViewerModule } from '../viewer/viewer.module';
|
|||||||
StartFormCustomButtonDirective,
|
StartFormCustomButtonDirective,
|
||||||
...WIDGET_DIRECTIVES,
|
...WIDGET_DIRECTIVES,
|
||||||
...MASK_DIRECTIVE,
|
...MASK_DIRECTIVE,
|
||||||
WidgetComponent
|
WidgetComponent,
|
||||||
|
TabsWidgetComponent
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
ContentWidgetComponent,
|
ContentWidgetComponent,
|
||||||
|
@@ -44,8 +44,6 @@ export class FormRenderingService extends DynamicComponentMapper {
|
|||||||
people: DynamicComponentResolver.fromType(widgets.PeopleWidgetComponent),
|
people: DynamicComponentResolver.fromType(widgets.PeopleWidgetComponent),
|
||||||
'functional-group': DynamicComponentResolver.fromType(widgets.FunctionalGroupWidgetComponent),
|
'functional-group': DynamicComponentResolver.fromType(widgets.FunctionalGroupWidgetComponent),
|
||||||
'dynamic-table': DynamicComponentResolver.fromType(widgets.DynamicTableWidgetComponent),
|
'dynamic-table': DynamicComponentResolver.fromType(widgets.DynamicTableWidgetComponent),
|
||||||
container: DynamicComponentResolver.fromType(widgets.ContainerWidgetComponent),
|
|
||||||
group: DynamicComponentResolver.fromType(widgets.ContainerWidgetComponent),
|
|
||||||
document: DynamicComponentResolver.fromType(widgets.DocumentWidgetComponent),
|
document: DynamicComponentResolver.fromType(widgets.DocumentWidgetComponent),
|
||||||
upload: DynamicComponentResolver.fromType(widgets.UploadWidgetComponent),
|
upload: DynamicComponentResolver.fromType(widgets.UploadWidgetComponent),
|
||||||
datetime: DynamicComponentResolver.fromType(widgets.DateTimeWidgetComponent),
|
datetime: DynamicComponentResolver.fromType(widgets.DateTimeWidgetComponent),
|
||||||
|
Reference in New Issue
Block a user