mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACA-4262] Content node selector - show 2 tabs only in cloud attach file widget (#6578)
This commit is contained in:
@@ -4,7 +4,10 @@
|
|||||||
<h2>{{title}}</h2>
|
<h2>{{title}}</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<mat-tab-group class="adf-content-node-selector-dialog-content" (selectedIndexChange)="onTabSelectionChange($event)" mat-align-tabs="start">
|
<mat-tab-group class="adf-content-node-selector-dialog-content"
|
||||||
|
mat-align-tabs="start"
|
||||||
|
(selectedIndexChange)="onTabSelectionChange($event)"
|
||||||
|
[class.adf-content-node-selector-headless-tabs]="!canPerformLocalUpload()">
|
||||||
<mat-tab label="{{ 'NODE_SELECTOR.FILE_SERVER' | translate }}">
|
<mat-tab label="{{ 'NODE_SELECTOR.FILE_SERVER' | translate }}">
|
||||||
<adf-content-node-selector-panel
|
<adf-content-node-selector-panel
|
||||||
[currentFolderId]="data?.currentFolderId"
|
[currentFolderId]="data?.currentFolderId"
|
||||||
@@ -29,15 +32,15 @@
|
|||||||
(navigationChange)="onNavigationChange($event)">
|
(navigationChange)="onNavigationChange($event)">
|
||||||
</adf-content-node-selector-panel>
|
</adf-content-node-selector-panel>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab *ngIf="data?.showLocalUploadButton"
|
<mat-tab *ngIf="canPerformLocalUpload()"
|
||||||
label="{{ 'NODE_SELECTOR.UPLOAD_FROM_DEVICE' | translate }}"
|
label="{{ 'NODE_SELECTOR.UPLOAD_FROM_DEVICE' | translate }}"
|
||||||
[disabled]="isNotAllowedToUpload()">
|
[disabled]="isNotAllowedToUpload()">
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
|
||||||
<mat-dialog-actions>
|
<mat-dialog-actions>
|
||||||
<div *ngIf="isLocalUploadTabSelected()">
|
<div>
|
||||||
<ng-container *ngIf="data?.showLocalUploadButton">
|
<ng-container *ngIf="isUploadEnabled()">
|
||||||
<adf-upload-button
|
<adf-upload-button
|
||||||
[staticTitle]="'FORM.FIELD.UPLOAD' | translate "
|
[staticTitle]="'FORM.FIELD.UPLOAD' | translate "
|
||||||
[multipleFiles]="isMultipleSelection()"
|
[multipleFiles]="isMultipleSelection()"
|
||||||
|
@@ -3,6 +3,14 @@
|
|||||||
$foreground: map-get($theme, foreground);
|
$foreground: map-get($theme, foreground);
|
||||||
$background: map-get($theme, background);
|
$background: map-get($theme, background);
|
||||||
|
|
||||||
|
adf-content-node-selector {
|
||||||
|
.adf-content-node-selector-headless-tabs {
|
||||||
|
.mat-tab-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.adf-content-node-selector-dialog {
|
.adf-content-node-selector-dialog {
|
||||||
&-content {
|
&-content {
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
|
@@ -371,5 +371,21 @@ describe('ContentNodeSelectorComponent', () => {
|
|||||||
|
|
||||||
expect(component.isLocalUploadTabSelected()).toEqual(true);
|
expect(component.isLocalUploadTabSelected()).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should tabs be headless when local upload is not enabled', () => {
|
||||||
|
component.data.showLocalUploadButton = false;
|
||||||
|
fixture.detectChanges();
|
||||||
|
const tabGroup = fixture.debugElement.queryAll(By.css('.adf-content-node-selector-headless-tabs'))[0];
|
||||||
|
|
||||||
|
expect(tabGroup).not.toBe(undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should tabs show headers when local upload is enabled', () => {
|
||||||
|
component.data.showLocalUploadButton = true;
|
||||||
|
fixture.detectChanges();
|
||||||
|
const tabGroup = fixture.debugElement.queryAll(By.css('.adf-content-node-selector-headless-tabs'))[0];
|
||||||
|
|
||||||
|
expect(tabGroup).toBe(undefined);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -137,4 +137,13 @@ export class ContentNodeSelectorComponent implements OnInit {
|
|||||||
isLocalUploadTabSelected (): boolean {
|
isLocalUploadTabSelected (): boolean {
|
||||||
return this.selectedTabIndex === 1;
|
return this.selectedTabIndex === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUploadEnabled(): boolean {
|
||||||
|
return this.canPerformLocalUpload() && this.isLocalUploadTabSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
canPerformLocalUpload(): boolean {
|
||||||
|
return this.data?.showLocalUploadButton;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user