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 { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-aspect-list-dialog',
|
||||
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 { Observable, Subject, zip } from 'rxjs';
|
||||
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 { AspectEntry } from '@alfresco/js-api';
|
||||
@Component({
|
||||
|
@@ -17,8 +17,9 @@
|
||||
|
||||
export * from './aspect-list.component';
|
||||
export * from './aspect-list-dialog.component';
|
||||
export * from './aspect-list.service';
|
||||
export * from './node-aspect.service';
|
||||
export * from './services/aspect-list.service';
|
||||
export * from './services/node-aspect.service';
|
||||
export * from './services/dialog-aspect-list.service';
|
||||
|
||||
export * from './aspect-list-dialog-data.interface';
|
||||
|
||||
|
@@ -16,11 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||
import { from, Observable, of, Subject, zip } from 'rxjs';
|
||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
||||
import { from, Observable, of, zip } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
|
||||
|
||||
@@ -37,7 +34,6 @@ export class AspectListService {
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private appConfigService: AppConfigService,
|
||||
private dialog: MatDialog,
|
||||
private logService: LogService) {
|
||||
}
|
||||
|
||||
@@ -101,34 +97,4 @@ export class AspectListService {
|
||||
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 { AlfrescoApiService, CardViewUpdateService, NodesApiService } from '@alfresco/adf-core';
|
||||
import { AspectListService } from './aspect-list.service';
|
||||
import { DialogAspectListService } from './dialog-aspect-list.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -26,12 +26,12 @@ export class NodeAspectService {
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private nodesApiService: NodesApiService,
|
||||
private aspectListService: AspectListService,
|
||||
private dialogAspectListService: DialogAspectListService,
|
||||
private cardViewUpdateService: CardViewUpdateService) {
|
||||
}
|
||||
|
||||
updateNodeAspects(nodeId: string) {
|
||||
this.aspectListService.openAspectListDialog(nodeId).subscribe((aspectList) => {
|
||||
this.dialogAspectListService.openAspectListDialog(nodeId).subscribe((aspectList) => {
|
||||
this.nodesApiService.updateNode(nodeId, { aspectNames: [...aspectList] }).subscribe((updatedNode) => {
|
||||
this.alfrescoApiService.nodeUpdated.next(updatedNode);
|
||||
this.cardViewUpdateService.updateNodeAspect(updatedNode);
|
@@ -28,7 +28,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
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 { takeUntil } from 'rxjs/operators';
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
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';
|
||||
@Component({
|
||||
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 { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
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 { SEARCH_QUERY_SERVICE_TOKEN } from '../search/search-query-service.token';
|
||||
import { SearchQueryBuilderService } from '../search/services/search-query-builder.service';
|
||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||
|
||||
export type ValidationFunction = (entry: Node) => boolean;
|
||||
|
||||
|
@@ -19,33 +19,35 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { RoleModel } from '../../models/role.model';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-user-role-column',
|
||||
template: `
|
||||
<mat-form-field floatLabel="never" class="adf-role-selector-field" *ngIf="!readonly">
|
||||
<mat-select
|
||||
(click)="$event.stopPropagation()"
|
||||
[placeholder]="placeholder | translate"
|
||||
[value]="value"
|
||||
(selectionChange)="onRoleChanged($event.value)">
|
||||
<mat-option *ngFor="let role of roles" [value]="role.role">
|
||||
{{ role.label | adfLocalizedRole }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
selector: 'adf-user-role-column',
|
||||
template: `
|
||||
<mat-form-field floatLabel="never" class="adf-role-selector-field" *ngIf="!readonly">
|
||||
<mat-select
|
||||
(click)="$event.stopPropagation()"
|
||||
[placeholder]="placeholder | translate"
|
||||
[value]="value"
|
||||
(selectionChange)="onRoleChanged($event.value)">
|
||||
<mat-option *ngFor="let role of roles" [value]="role.role">
|
||||
{{ role.label | adfLocalizedRole }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</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}}
|
||||
</span>
|
||||
`,
|
||||
`,
|
||||
host: { class: 'adf-user-role-column adf-datatable-content-cell adf-expand-cell-4' },
|
||||
styles: [
|
||||
`.adf-role-selector-field {
|
||||
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 {
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContainerWidgetComponent } from './container/container.widget';
|
||||
import { TabsWidgetComponent } from './tabs/tabs.widget';
|
||||
import { UnknownWidgetComponent } from './unknown/unknown.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 './core/index';
|
||||
|
||||
// containers
|
||||
export * from './tabs/tabs.widget';
|
||||
export * from './container/container.widget';
|
||||
|
||||
// primitives
|
||||
export * from './unknown/unknown.widget';
|
||||
export * from './text/text.widget';
|
||||
@@ -94,8 +88,6 @@ export * from './text/text-mask.component';
|
||||
|
||||
export const WIDGET_DIRECTIVES: any[] = [
|
||||
UnknownWidgetComponent,
|
||||
TabsWidgetComponent,
|
||||
ContainerWidgetComponent,
|
||||
TextWidgetComponent,
|
||||
NumberWidgetComponent,
|
||||
CheckboxWidgetComponent,
|
||||
|
@@ -40,6 +40,8 @@ import { EditJsonDialogModule } from '../dialogs/edit-json/edit-json.dialog.modu
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ViewerModule } from '../viewer/viewer.module';
|
||||
import { TabsWidgetComponent } from './components/widgets/tabs/tabs.widget';
|
||||
import { ContainerWidgetComponent } from './components/widgets/container/container.widget';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -67,7 +69,8 @@ import { ViewerModule } from '../viewer/viewer.module';
|
||||
StartFormCustomButtonDirective,
|
||||
...WIDGET_DIRECTIVES,
|
||||
...MASK_DIRECTIVE,
|
||||
WidgetComponent
|
||||
WidgetComponent,
|
||||
TabsWidgetComponent
|
||||
],
|
||||
exports: [
|
||||
ContentWidgetComponent,
|
||||
|
@@ -44,8 +44,6 @@ export class FormRenderingService extends DynamicComponentMapper {
|
||||
people: DynamicComponentResolver.fromType(widgets.PeopleWidgetComponent),
|
||||
'functional-group': DynamicComponentResolver.fromType(widgets.FunctionalGroupWidgetComponent),
|
||||
'dynamic-table': DynamicComponentResolver.fromType(widgets.DynamicTableWidgetComponent),
|
||||
container: DynamicComponentResolver.fromType(widgets.ContainerWidgetComponent),
|
||||
group: DynamicComponentResolver.fromType(widgets.ContainerWidgetComponent),
|
||||
document: DynamicComponentResolver.fromType(widgets.DocumentWidgetComponent),
|
||||
upload: DynamicComponentResolver.fromType(widgets.UploadWidgetComponent),
|
||||
datetime: DynamicComponentResolver.fromType(widgets.DateTimeWidgetComponent),
|
||||
|
Reference in New Issue
Block a user