From a9a801c34d073e35a1c7e1b8ce275d3d948b866f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Mah=C3=A9?= Date: Thu, 28 May 2020 23:45:32 +0200 Subject: [PATCH] [ADF-5150] Datatable sub-component each in its own folder (#5734) --- docs/README.md | 4 ++-- docs/core/components/empty-list.component.md | 2 +- docs/core/components/json-cell.component.md | 2 +- .../{datatable => }/data-cell.event.ts | 6 +++--- .../{datatable => }/data-row-action.event.ts | 4 ++-- .../datatable-cell.component.spec.ts | 2 +- .../datatable-cell.component.ts | 0 .../datatable-row.component.spec.ts | 0 .../datatable-row.component.ts | 0 .../datatable/datatable.component.ts | 6 +++--- .../date-cell.component.ts | 2 +- .../empty-list.component.html | 0 .../empty-list.component.scss | 0 .../empty-list.component.spec.ts | 0 .../empty-list.component.ts | 0 .../filesize-cell.component.ts | 2 +- .../json-cell.component.scss | 0 .../json-cell.component.spec.ts | 4 ++-- .../json-cell.component.ts | 2 +- .../location-cell.component.spec.ts | 4 ++-- .../location-cell.component.ts | 2 +- lib/core/datatable/datatable.module.ts | 16 ++++++++-------- .../drop-zone.directive.ts | 4 ++-- lib/core/datatable/public-api.ts | 18 +++++++++--------- 24 files changed, 40 insertions(+), 40 deletions(-) rename lib/core/datatable/components/{datatable => }/data-cell.event.ts (87%) rename lib/core/datatable/components/{datatable => }/data-row-action.event.ts (92%) rename lib/core/datatable/components/{datatable => datatable-cell}/datatable-cell.component.spec.ts (97%) rename lib/core/datatable/components/{datatable => datatable-cell}/datatable-cell.component.ts (100%) rename lib/core/datatable/components/{datatable => datatable-row}/datatable-row.component.spec.ts (100%) rename lib/core/datatable/components/{datatable => datatable-row}/datatable-row.component.ts (100%) rename lib/core/datatable/components/{datatable => date-cell}/date-cell.component.ts (97%) rename lib/core/datatable/components/{datatable => empty-list}/empty-list.component.html (100%) rename lib/core/datatable/components/{datatable => empty-list}/empty-list.component.scss (100%) rename lib/core/datatable/components/{datatable => empty-list}/empty-list.component.spec.ts (100%) rename lib/core/datatable/components/{datatable => empty-list}/empty-list.component.ts (100%) rename lib/core/datatable/components/{datatable => filesize-cell}/filesize-cell.component.ts (94%) rename lib/core/datatable/components/{datatable => json-cell}/json-cell.component.scss (100%) rename lib/core/datatable/components/{datatable => json-cell}/json-cell.component.spec.ts (94%) rename lib/core/datatable/components/{datatable => json-cell}/json-cell.component.ts (97%) rename lib/core/datatable/components/{datatable => location-cell}/location-cell.component.spec.ts (96%) rename lib/core/datatable/components/{datatable => location-cell}/location-cell.component.ts (96%) rename lib/core/datatable/{components/datatable => directives}/drop-zone.directive.ts (95%) diff --git a/docs/README.md b/docs/README.md index 0c391aeb6f..57f449e824 100644 --- a/docs/README.md +++ b/docs/README.md @@ -92,7 +92,7 @@ for more information about installing and using the source code. | [Data Column Component](core/components/data-column.component.md) | Defines column properties for DataTable, Tasklist, Document List and other components. | [Source](../lib/core/data-column/data-column.component.ts) | | [DataTable component](core/components/datatable.component.md) | Displays data as a table with customizable columns and presentation. | [Source](../lib/core/datatable/components/datatable/datatable.component.ts) | | [Empty Content Component](core/components/empty-content.component.md) | Provides a generic "Empty Content" placeholder for components. | [Source](../lib/core/templates/empty-content/empty-content.component.ts) | -| [Empty list component](core/components/empty-list.component.md) | Displays a message indicating that a list is empty. | [Source](../lib/core/datatable/components/datatable/empty-list.component.ts) | +| [Empty list component](core/components/empty-list.component.md) | Displays a message indicating that a list is empty. | [Source](../lib/core/datatable/components/empty-list/empty-list.component.ts) | | [Error Content Component](core/components/error-content.component.md) | Displays info about a specific error. | [Source](../lib/core/templates/error-content/error-content.component.ts) | | [Form field component](core/components/form-field.component.md) | Represents a UI field in a form. | [Source](../lib/core/form/components/form-field/form-field.component.ts) | | [Form List Component](core/components/form-list.component.md) | Shows forms as a list. | [Source](../lib/core/form/components/form-list.component.ts) | @@ -103,7 +103,7 @@ for more information about installing and using the source code. | [Info drawer layout component](core/components/info-drawer-layout.component.md) | Displays a sidebar-style information panel. | [Source](../lib/core/info-drawer/info-drawer-layout.component.ts) | | [Info Drawer Tab component](core/components/info-drawer-tab.component.md) | Renders tabs in a Info drawer component. | [Source](../lib/core/info-drawer/info-drawer.component.ts) | | [Info Drawer component](core/components/info-drawer.component.md) | Displays a sidebar-style information panel with tabs. | [Source](../lib/core/info-drawer/info-drawer.component.ts) | -| [Json Cell component](core/components/json-cell.component.md) | Shows a JSON-formatted value inside a datatable component. | [Source](../lib/core/datatable/components/datatable/json-cell.component.ts) | +| [Json Cell component](core/components/json-cell.component.md) | Shows a JSON-formatted value inside a datatable component. | [Source](../lib/core/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/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/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/login/components/login-dialog.component.ts) | diff --git a/docs/core/components/empty-list.component.md b/docs/core/components/empty-list.component.md index 0c4ef86dbf..ac18dd1245 100644 --- a/docs/core/components/empty-list.component.md +++ b/docs/core/components/empty-list.component.md @@ -4,7 +4,7 @@ Added: v2.0.0 Status: Active --- -# [Empty list component](../../../lib/core/datatable/components/datatable/empty-list.component.ts "Defined in empty-list.component.ts") +# [Empty list component](../../../lib/core/datatable/components/empty-list/empty-list.component.ts "Defined in empty-list.component.ts") Displays a message indicating that a list is empty. diff --git a/docs/core/components/json-cell.component.md b/docs/core/components/json-cell.component.md index bef8c7dc62..73a986c2c4 100644 --- a/docs/core/components/json-cell.component.md +++ b/docs/core/components/json-cell.component.md @@ -5,7 +5,7 @@ Status: Active Last reviewed: 2019-04-12 --- -# [Json Cell Component](../../../lib/core/datatable/components/datatable/json-cell.component.ts "Defined in json-cell.component.ts") +# [Json Cell Component](../../../lib/core/datatable/components/json-cell/json-cell.component.ts "Defined in json-cell.component.ts") Shows a JSON-formatted value inside a datatable component. diff --git a/lib/core/datatable/components/datatable/data-cell.event.ts b/lib/core/datatable/components/data-cell.event.ts similarity index 87% rename from lib/core/datatable/components/datatable/data-cell.event.ts rename to lib/core/datatable/components/data-cell.event.ts index 54ec4a7092..82a62692d3 100644 --- a/lib/core/datatable/components/datatable/data-cell.event.ts +++ b/lib/core/datatable/components/data-cell.event.ts @@ -15,9 +15,9 @@ * limitations under the License. */ -import { BaseEvent } from '../../../events'; -import { DataColumn } from '../../data/data-column.model'; -import { DataRow } from '../../data/data-row.model'; +import { BaseEvent } from '../../events'; +import { DataColumn } from '../data/data-column.model'; +import { DataRow } from '../data/data-row.model'; export class DataCellEventModel { diff --git a/lib/core/datatable/components/datatable/data-row-action.event.ts b/lib/core/datatable/components/data-row-action.event.ts similarity index 92% rename from lib/core/datatable/components/datatable/data-row-action.event.ts rename to lib/core/datatable/components/data-row-action.event.ts index 9b548c3537..e9cb0efb3a 100644 --- a/lib/core/datatable/components/datatable/data-row-action.event.ts +++ b/lib/core/datatable/components/data-row-action.event.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import { BaseEvent } from '../../../events'; -import { DataRow } from '../../data/data-row.model'; +import { BaseEvent } from '../../events'; +import { DataRow } from '../data/data-row.model'; export class DataRowActionModel { diff --git a/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts b/lib/core/datatable/components/datatable-cell/datatable-cell.component.spec.ts similarity index 97% rename from lib/core/datatable/components/datatable/datatable-cell.component.spec.ts rename to lib/core/datatable/components/datatable-cell/datatable-cell.component.spec.ts index ed7054395a..11a2eddba6 100644 --- a/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts +++ b/lib/core/datatable/components/datatable-cell/datatable-cell.component.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { DateCellComponent } from './date-cell.component'; +import { DateCellComponent } from '../date-cell/date-cell.component'; import { Subject } from 'rxjs'; import { AlfrescoApiServiceMock, AppConfigService, StorageService } from '@alfresco/adf-core'; import { Node } from '@alfresco/js-api'; diff --git a/lib/core/datatable/components/datatable/datatable-cell.component.ts b/lib/core/datatable/components/datatable-cell/datatable-cell.component.ts similarity index 100% rename from lib/core/datatable/components/datatable/datatable-cell.component.ts rename to lib/core/datatable/components/datatable-cell/datatable-cell.component.ts diff --git a/lib/core/datatable/components/datatable/datatable-row.component.spec.ts b/lib/core/datatable/components/datatable-row/datatable-row.component.spec.ts similarity index 100% rename from lib/core/datatable/components/datatable/datatable-row.component.spec.ts rename to lib/core/datatable/components/datatable-row/datatable-row.component.spec.ts diff --git a/lib/core/datatable/components/datatable/datatable-row.component.ts b/lib/core/datatable/components/datatable-row/datatable-row.component.ts similarity index 100% rename from lib/core/datatable/components/datatable/datatable-row.component.ts rename to lib/core/datatable/components/datatable-row/datatable-row.component.ts diff --git a/lib/core/datatable/components/datatable/datatable.component.ts b/lib/core/datatable/components/datatable/datatable.component.ts index 414248c3e2..2461e7cdc6 100644 --- a/lib/core/datatable/components/datatable/datatable.component.ts +++ b/lib/core/datatable/components/datatable/datatable.component.ts @@ -29,12 +29,12 @@ import { DataRowEvent } from '../../data/data-row-event.model'; import { DataRow } from '../../data/data-row.model'; import { DataSorting } from '../../data/data-sorting.model'; import { DataTableAdapter } from '../../data/datatable-adapter'; -import { DataTableRowComponent } from './datatable-row.component'; +import { DataTableRowComponent } from '../datatable-row/datatable-row.component'; import { ObjectDataRow } from '../../data/object-datarow.model'; import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter'; -import { DataCellEvent } from './data-cell.event'; -import { DataRowActionEvent } from './data-row-action.event'; +import { DataCellEvent } from '../data-cell.event'; +import { DataRowActionEvent } from '../data-row-action.event'; import { share, buffer, map, filter, debounceTime } from 'rxjs/operators'; export enum DisplayMode { diff --git a/lib/core/datatable/components/datatable/date-cell.component.ts b/lib/core/datatable/components/date-cell/date-cell.component.ts similarity index 97% rename from lib/core/datatable/components/datatable/date-cell.component.ts rename to lib/core/datatable/components/date-cell/date-cell.component.ts index 091671cdaf..2d7a08da21 100644 --- a/lib/core/datatable/components/datatable/date-cell.component.ts +++ b/lib/core/datatable/components/date-cell/date-cell.component.ts @@ -16,7 +16,7 @@ */ import { Component, ViewEncapsulation } from '@angular/core'; -import { DataTableCellComponent } from './datatable-cell.component'; +import { DataTableCellComponent } from '../datatable-cell/datatable-cell.component'; import { UserPreferencesService, UserPreferenceValues diff --git a/lib/core/datatable/components/datatable/empty-list.component.html b/lib/core/datatable/components/empty-list/empty-list.component.html similarity index 100% rename from lib/core/datatable/components/datatable/empty-list.component.html rename to lib/core/datatable/components/empty-list/empty-list.component.html diff --git a/lib/core/datatable/components/datatable/empty-list.component.scss b/lib/core/datatable/components/empty-list/empty-list.component.scss similarity index 100% rename from lib/core/datatable/components/datatable/empty-list.component.scss rename to lib/core/datatable/components/empty-list/empty-list.component.scss diff --git a/lib/core/datatable/components/datatable/empty-list.component.spec.ts b/lib/core/datatable/components/empty-list/empty-list.component.spec.ts similarity index 100% rename from lib/core/datatable/components/datatable/empty-list.component.spec.ts rename to lib/core/datatable/components/empty-list/empty-list.component.spec.ts diff --git a/lib/core/datatable/components/datatable/empty-list.component.ts b/lib/core/datatable/components/empty-list/empty-list.component.ts similarity index 100% rename from lib/core/datatable/components/datatable/empty-list.component.ts rename to lib/core/datatable/components/empty-list/empty-list.component.ts diff --git a/lib/core/datatable/components/datatable/filesize-cell.component.ts b/lib/core/datatable/components/filesize-cell/filesize-cell.component.ts similarity index 94% rename from lib/core/datatable/components/datatable/filesize-cell.component.ts rename to lib/core/datatable/components/filesize-cell/filesize-cell.component.ts index a2328886c4..66072e27c9 100644 --- a/lib/core/datatable/components/datatable/filesize-cell.component.ts +++ b/lib/core/datatable/components/filesize-cell/filesize-cell.component.ts @@ -16,7 +16,7 @@ */ import { Component, ViewEncapsulation } from '@angular/core'; -import { DataTableCellComponent } from './datatable-cell.component'; +import { DataTableCellComponent } from '../datatable-cell/datatable-cell.component'; import { AlfrescoApiService } from '../../../services/alfresco-api.service'; @Component({ diff --git a/lib/core/datatable/components/datatable/json-cell.component.scss b/lib/core/datatable/components/json-cell/json-cell.component.scss similarity index 100% rename from lib/core/datatable/components/datatable/json-cell.component.scss rename to lib/core/datatable/components/json-cell/json-cell.component.scss diff --git a/lib/core/datatable/components/datatable/json-cell.component.spec.ts b/lib/core/datatable/components/json-cell/json-cell.component.spec.ts similarity index 94% rename from lib/core/datatable/components/datatable/json-cell.component.spec.ts rename to lib/core/datatable/components/json-cell/json-cell.component.spec.ts index 0f609ed007..454e6feac2 100644 --- a/lib/core/datatable/components/datatable/json-cell.component.spec.ts +++ b/lib/core/datatable/components/json-cell/json-cell.component.spec.ts @@ -16,8 +16,8 @@ */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ObjectDataTableAdapter } from './../../data/object-datatable-adapter'; -import { ObjectDataColumn } from './../../data/object-datacolumn.model'; +import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter'; +import { ObjectDataColumn } from '../../data/object-datacolumn.model'; import { setupTestBed } from '../../../testing/setup-test-bed'; import { CoreTestingModule } from '../../../testing/core.testing.module'; diff --git a/lib/core/datatable/components/datatable/json-cell.component.ts b/lib/core/datatable/components/json-cell/json-cell.component.ts similarity index 97% rename from lib/core/datatable/components/datatable/json-cell.component.ts rename to lib/core/datatable/components/json-cell/json-cell.component.ts index f6faf7093f..a4e7502dc7 100644 --- a/lib/core/datatable/components/datatable/json-cell.component.ts +++ b/lib/core/datatable/components/json-cell/json-cell.component.ts @@ -16,7 +16,7 @@ */ import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation, Input } from '@angular/core'; -import { DataTableCellComponent } from './datatable-cell.component'; +import { DataTableCellComponent } from '../datatable-cell/datatable-cell.component'; import { MatDialog } from '@angular/material'; import { EditJsonDialogComponent, EditJsonDialogSettings } from '../../../dialogs/edit-json/edit-json.dialog'; import { AlfrescoApiService } from '../../../services/alfresco-api.service'; diff --git a/lib/core/datatable/components/datatable/location-cell.component.spec.ts b/lib/core/datatable/components/location-cell/location-cell.component.spec.ts similarity index 96% rename from lib/core/datatable/components/datatable/location-cell.component.spec.ts rename to lib/core/datatable/components/location-cell/location-cell.component.spec.ts index 4ecc5c497e..1bed3fa4cc 100644 --- a/lib/core/datatable/components/datatable/location-cell.component.spec.ts +++ b/lib/core/datatable/components/location-cell/location-cell.component.spec.ts @@ -16,8 +16,8 @@ */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ObjectDataTableAdapter } from './../../data/object-datatable-adapter'; -import { ObjectDataColumn } from './../../data/object-datacolumn.model'; +import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter'; +import { ObjectDataColumn } from '../../data/object-datacolumn.model'; import { LocationCellComponent } from './location-cell.component'; import { setupTestBed } from '../../../testing/setup-test-bed'; diff --git a/lib/core/datatable/components/datatable/location-cell.component.ts b/lib/core/datatable/components/location-cell/location-cell.component.ts similarity index 96% rename from lib/core/datatable/components/datatable/location-cell.component.ts rename to lib/core/datatable/components/location-cell/location-cell.component.ts index 4105344618..2ff8a479a7 100644 --- a/lib/core/datatable/components/datatable/location-cell.component.ts +++ b/lib/core/datatable/components/location-cell/location-cell.component.ts @@ -23,7 +23,7 @@ import { ViewEncapsulation } from '@angular/core'; import { PathInfoEntity } from '@alfresco/js-api'; -import { DataTableCellComponent } from './datatable-cell.component'; +import { DataTableCellComponent } from '../datatable-cell/datatable-cell.component'; import { AlfrescoApiService } from '../../../services/alfresco-api.service'; @Component({ diff --git a/lib/core/datatable/datatable.module.ts b/lib/core/datatable/datatable.module.ts index 8aae06d8d7..7372c449c7 100644 --- a/lib/core/datatable/datatable.module.ts +++ b/lib/core/datatable/datatable.module.ts @@ -25,25 +25,25 @@ import { ContextMenuModule } from '../context-menu/context-menu.module'; import { PipeModule } from '../pipes/pipe.module'; import { DirectiveModule } from '../directives/directive.module'; -import { DataTableCellComponent } from './components/datatable/datatable-cell.component'; -import { DataTableRowComponent } from './components/datatable/datatable-row.component'; +import { DataTableCellComponent } from './components/datatable-cell/datatable-cell.component'; +import { DataTableRowComponent } from './components/datatable-row/datatable-row.component'; import { DataTableComponent } from './components/datatable/datatable.component'; -import { DateCellComponent } from './components/datatable/date-cell.component'; +import { DateCellComponent } from './components/date-cell/date-cell.component'; import { EmptyListBodyDirective, EmptyListComponent, EmptyListFooterDirective, - EmptyListHeaderDirective } from './components/datatable/empty-list.component'; -import { FileSizeCellComponent } from './components/datatable/filesize-cell.component'; -import { LocationCellComponent } from './components/datatable/location-cell.component'; + EmptyListHeaderDirective } from './components/empty-list/empty-list.component'; +import { FileSizeCellComponent } from './components/filesize-cell/filesize-cell.component'; +import { LocationCellComponent } from './components/location-cell/location-cell.component'; import { LoadingContentTemplateDirective } from './directives/loading-template.directive'; import { NoContentTemplateDirective } from './directives/no-content-template.directive'; import { NoPermissionTemplateDirective } from './directives/no-permission-template.directive'; import { CustomEmptyContentTemplateDirective } from './directives/custom-empty-content-template.directive'; import { CustomLoadingContentTemplateDirective } from './directives/custom-loading-template.directive'; import { CustomNoPermissionTemplateDirective } from './directives/custom-no-permission-template.directive'; -import { JsonCellComponent } from './components/datatable/json-cell.component'; +import { JsonCellComponent } from './components/json-cell/json-cell.component'; import { ClipboardModule } from '../clipboard/clipboard.module'; -import { DropZoneDirective } from './components/datatable/drop-zone.directive'; +import { DropZoneDirective } from './directives/drop-zone.directive'; import { DataColumnModule } from '../data-column/data-column.module'; @NgModule({ diff --git a/lib/core/datatable/components/datatable/drop-zone.directive.ts b/lib/core/datatable/directives/drop-zone.directive.ts similarity index 95% rename from lib/core/datatable/components/datatable/drop-zone.directive.ts rename to lib/core/datatable/directives/drop-zone.directive.ts index 9097e02d80..6893073257 100644 --- a/lib/core/datatable/components/datatable/drop-zone.directive.ts +++ b/lib/core/datatable/directives/drop-zone.directive.ts @@ -16,8 +16,8 @@ */ import { Directive, Input, ElementRef, NgZone, OnInit, OnDestroy } from '@angular/core'; -import { DataRow } from '../../data/data-row.model'; -import { DataColumn } from '../../data/data-column.model'; +import { DataRow } from '../data/data-row.model'; +import { DataColumn } from '../data/data-column.model'; @Directive({ selector: '[adf-drop-zone]' diff --git a/lib/core/datatable/public-api.ts b/lib/core/datatable/public-api.ts index 40a6d393ce..3be952d601 100644 --- a/lib/core/datatable/public-api.ts +++ b/lib/core/datatable/public-api.ts @@ -26,16 +26,16 @@ export * from './data/object-datarow.model'; export * from './data/object-datatable-adapter'; export * from './data/object-datacolumn.model'; -export * from './components/datatable/data-cell.event'; -export * from './components/datatable/data-row-action.event'; -export * from './components/datatable/drop-zone.directive'; -export * from './components/datatable/datatable-cell.component'; -export * from './components/datatable/datatable-row.component'; +export * from './components/data-cell.event'; +export * from './components/data-row-action.event'; +export * from './directives/drop-zone.directive'; +export * from './components/datatable-cell/datatable-cell.component'; +export * from './components/datatable-row/datatable-row.component'; export * from './components/datatable/datatable.component'; -export * from './components/datatable/date-cell.component'; -export * from './components/datatable/empty-list.component'; -export * from './components/datatable/filesize-cell.component'; -export * from './components/datatable/location-cell.component'; +export * from './components/date-cell/date-cell.component'; +export * from './components/empty-list/empty-list.component'; +export * from './components/filesize-cell/filesize-cell.component'; +export * from './components/location-cell/location-cell.component'; export * from './data/data-table.schema'; export * from './directives/loading-template.directive';