mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -69,6 +69,7 @@
|
|||||||
"DATATABLE": "Datatable",
|
"DATATABLE": "Datatable",
|
||||||
"DATATABLE_LAZY": "Datatable (Lazy)",
|
"DATATABLE_LAZY": "Datatable (Lazy)",
|
||||||
"DOCUMENT_LIST": "Document List",
|
"DOCUMENT_LIST": "Document List",
|
||||||
|
"TEMPLATE": "Template",
|
||||||
"FORM": "Form",
|
"FORM": "Form",
|
||||||
"FORM_LIST": "Form List",
|
"FORM_LIST": "Form List",
|
||||||
"FORM_LOADING": "Form Loading",
|
"FORM_LOADING": "Form Loading",
|
||||||
|
@@ -75,7 +75,7 @@ import { CloudBreadcrumbsComponent } from './components/app-layout/cloud/cloud-b
|
|||||||
import { TasksCloudDemoComponent } from './components/app-layout/cloud/tasks-cloud-demo.component';
|
import { TasksCloudDemoComponent } from './components/app-layout/cloud/tasks-cloud-demo.component';
|
||||||
import { CloudFiltersDemoComponent } from './components/app-layout/cloud/cloud-filters-demo.component';
|
import { CloudFiltersDemoComponent } from './components/app-layout/cloud/cloud-filters-demo.component';
|
||||||
import { StartProcessCloudDemoComponent } from './components/app-layout/cloud/start-process-cloud-demo.component';
|
import { StartProcessCloudDemoComponent } from './components/app-layout/cloud/start-process-cloud-demo.component';
|
||||||
import { DocumentListDemoComponent } from './components/document-list/document-list-demo.component';
|
import { TemplateDemoComponent } from './components/template-list/template-demo.component';
|
||||||
import { PeopleGroupCloudDemoComponent } from './components/app-layout/cloud/people-groups-cloud-demo.component';
|
import { PeopleGroupCloudDemoComponent } from './components/app-layout/cloud/people-groups-cloud-demo.component';
|
||||||
import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-settings.component';
|
import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-settings.component';
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-sett
|
|||||||
StartProcessCloudDemoComponent,
|
StartProcessCloudDemoComponent,
|
||||||
CloudBreadcrumbsComponent,
|
CloudBreadcrumbsComponent,
|
||||||
CloudFiltersDemoComponent,
|
CloudFiltersDemoComponent,
|
||||||
DocumentListDemoComponent,
|
TemplateDemoComponent,
|
||||||
PeopleGroupCloudDemoComponent,
|
PeopleGroupCloudDemoComponent,
|
||||||
CloudSettingsComponent
|
CloudSettingsComponent
|
||||||
],
|
],
|
||||||
|
@@ -46,7 +46,7 @@ import { AppsCloudDemoComponent } from './components/app-layout/cloud/apps-cloud
|
|||||||
import { TasksCloudDemoComponent } from './components/app-layout/cloud/tasks-cloud-demo.component';
|
import { TasksCloudDemoComponent } from './components/app-layout/cloud/tasks-cloud-demo.component';
|
||||||
import { StartTaskCloudDemoComponent } from './components/app-layout/cloud/start-task-cloud-demo.component';
|
import { StartTaskCloudDemoComponent } from './components/app-layout/cloud/start-task-cloud-demo.component';
|
||||||
import { StartProcessCloudDemoComponent } from './components/app-layout/cloud/start-process-cloud-demo.component';
|
import { StartProcessCloudDemoComponent } from './components/app-layout/cloud/start-process-cloud-demo.component';
|
||||||
import { DocumentListDemoComponent } from './components/document-list/document-list-demo.component';
|
import { TemplateDemoComponent } from './components/template-list/template-demo.component';
|
||||||
import { PeopleGroupCloudDemoComponent } from './components/app-layout/cloud/people-groups-cloud-demo.component';
|
import { PeopleGroupCloudDemoComponent } from './components/app-layout/cloud/people-groups-cloud-demo.component';
|
||||||
|
|
||||||
export const appRoutes: Routes = [
|
export const appRoutes: Routes = [
|
||||||
@@ -341,8 +341,8 @@ export const appRoutes: Routes = [
|
|||||||
loadChildren: 'app/components/lazy-loading/lazy-loading.module#LazyLoadingModule'
|
loadChildren: 'app/components/lazy-loading/lazy-loading.module#LazyLoadingModule'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'document-list',
|
path: 'template-list',
|
||||||
component: DocumentListDemoComponent
|
component: TemplateDemoComponent
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'task-list',
|
path: 'task-list',
|
||||||
|
@@ -48,7 +48,7 @@ export class AppLayoutComponent implements OnInit {
|
|||||||
{ href: '/dl-custom-sources', icon: 'extension', title: 'APP_LAYOUT.CUSTOM_SOURCES' },
|
{ href: '/dl-custom-sources', icon: 'extension', title: 'APP_LAYOUT.CUSTOM_SOURCES' },
|
||||||
{ href: '/datatable', icon: 'view_module', title: 'APP_LAYOUT.DATATABLE' },
|
{ href: '/datatable', icon: 'view_module', title: 'APP_LAYOUT.DATATABLE' },
|
||||||
{ href: '/datatable-lazy', icon: 'view_module', title: 'APP_LAYOUT.DATATABLE_LAZY' },
|
{ href: '/datatable-lazy', icon: 'view_module', title: 'APP_LAYOUT.DATATABLE_LAZY' },
|
||||||
{ href: '/document-list', icon: 'list_alt', title: 'APP_LAYOUT.DOCUMENT_LIST' },
|
{ href: '/template-list', icon: 'list_alt', title: 'APP_LAYOUT.TEMPLATE' },
|
||||||
{ href: '/form', icon: 'poll', title: 'APP_LAYOUT.FORM' },
|
{ href: '/form', icon: 'poll', title: 'APP_LAYOUT.FORM' },
|
||||||
{ href: '/form-list', icon: 'library_books', title: 'APP_LAYOUT.FORM_LIST' },
|
{ href: '/form-list', icon: 'library_books', title: 'APP_LAYOUT.FORM_LIST' },
|
||||||
{ href: '/form-loading', icon: 'cached', title: 'APP_LAYOUT.FORM_LOADING' },
|
{ href: '/form-loading', icon: 'cached', title: 'APP_LAYOUT.FORM_LOADING' },
|
||||||
|
@@ -20,10 +20,10 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
|||||||
import { ObjectDataTableAdapter } from '@alfresco/adf-core';
|
import { ObjectDataTableAdapter } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-document-list',
|
selector: 'app-template-list',
|
||||||
templateUrl: './document-list-demo.component.html'
|
templateUrl: './template-demo.component.html'
|
||||||
})
|
})
|
||||||
export class DocumentListDemoComponent implements AfterViewChecked {
|
export class TemplateDemoComponent implements AfterViewChecked {
|
||||||
|
|
||||||
@ViewChild('defaultDocumentList')
|
@ViewChild('defaultDocumentList')
|
||||||
defaultDocumentListComponent: DocumentListComponent;
|
defaultDocumentListComponent: DocumentListComponent;
|
@@ -3,7 +3,7 @@
|
|||||||
*ngIf="data" class="adf-full-width"
|
*ngIf="data" class="adf-full-width"
|
||||||
[class.adf-data-table-card]="display === 'gallery'"
|
[class.adf-data-table-card]="display === 'gallery'"
|
||||||
[class.adf-data-table]="display === 'list'"
|
[class.adf-data-table]="display === 'list'"
|
||||||
[class.adf-data-table--empty]="isEmpty()">
|
[class.adf-data-table--empty]="!isHeaderVisible()">
|
||||||
<div *ngIf="isHeaderVisible()" class="adf-datatable-header" role="rowgroup">
|
<div *ngIf="isHeaderVisible()" class="adf-datatable-header" role="rowgroup">
|
||||||
<div class="adf-datatable-row" *ngIf="display === 'list'" role="row">
|
<div class="adf-datatable-row" *ngIf="display === 'list'" role="row">
|
||||||
<!-- Actions (left) -->
|
<!-- Actions (left) -->
|
||||||
@@ -214,7 +214,7 @@
|
|||||||
<div *ngIf="loading"
|
<div *ngIf="loading"
|
||||||
[class.adf-datatable-row]="display === 'list'"
|
[class.adf-datatable-row]="display === 'list'"
|
||||||
[class.adf-data-table-card-loading]="display === 'gallery'">
|
[class.adf-data-table-card-loading]="display === 'gallery'">
|
||||||
<div class="adf-datatable-table-cell">
|
<div class="adf-no-content-container adf-datatable-table-cell">
|
||||||
<ng-template *ngIf="loadingTemplate"
|
<ng-template *ngIf="loadingTemplate"
|
||||||
ngFor [ngForOf]="[data]"
|
ngFor [ngForOf]="[data]"
|
||||||
[ngForTemplate]="loadingTemplate">
|
[ngForTemplate]="loadingTemplate">
|
||||||
@@ -222,4 +222,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -176,6 +176,22 @@ describe('DataTable', () => {
|
|||||||
expect(element.querySelector('.adf-datatable-header')).toBe(null);
|
expect(element.querySelector('.adf-datatable-header')).toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should hide the header if noPermission is true', () => {
|
||||||
|
let newData = new ObjectDataTableAdapter(
|
||||||
|
);
|
||||||
|
|
||||||
|
dataTable.noPermission = true;
|
||||||
|
dataTable.loading = false;
|
||||||
|
|
||||||
|
dataTable.ngOnChanges({
|
||||||
|
data: new SimpleChange(null, newData, false)
|
||||||
|
});
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(element.querySelector('.adf-datatable-header')).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
it('should show the header if showHeader is true', () => {
|
it('should show the header if showHeader is true', () => {
|
||||||
let newData = new ObjectDataTableAdapter(
|
let newData = new ObjectDataTableAdapter(
|
||||||
[
|
[
|
||||||
|
@@ -641,7 +641,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
|||||||
}
|
}
|
||||||
|
|
||||||
isHeaderVisible() {
|
isHeaderVisible() {
|
||||||
return this.showHeader && !this.loading && !this.isEmpty();
|
return this.showHeader && !this.loading && !this.isEmpty() && !this.noPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
private emitRowSelectionEvent(name: string, row: DataRow) {
|
private emitRowSelectionEvent(name: string, row: DataRow) {
|
||||||
|
Reference in New Issue
Block a user