[ACS-7462] cleanup deprecated api for DataTable and DocumentList (#9500)

* refactor: cleanup gallery mode from DataTable/DocumentList

* refactor: cleanup gallery mode from DataTable/DocumentList

* refactor: cleanup gallery mode from DataTable/DocumentList [ci:force]

* refactor: remove unused api [ci:force]

* refactor: remove unused api [ci:force]

* refactor: update and fix documentation [ci:force]

* refactor: restore thumbnails, docs fixes [ci:force]

* fix package lock
This commit is contained in:
Denys Vuika
2024-04-09 13:13:57 -04:00
committed by GitHub
parent 8b591876b6
commit 135b3b4b51
16 changed files with 210 additions and 502 deletions

View File

@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { Node } from '@alfresco/js-api';
export interface NavigableComponentInterface {
navigateTo(node: Node | string);
}

View File

@@ -17,6 +17,5 @@
export * from './breadcrumb.component';
export * from './dropdown-breadcrumb.component';
export * from './navigable-component.interface';
export * from './breadcrumb.module';

View File

@@ -10,7 +10,6 @@
[rowStyleClass]="rowStyleClass"
[showMainDatatableActions]="true"
[loading]="loading"
[display]="display"
[noPermission]="noPermission"
[showHeader]="showHeader"
[rowMenuCacheEnabled]="false"

View File

@@ -364,23 +364,6 @@ describe('DocumentList', () => {
expect(documentList.resetSelection).toHaveBeenCalled();
});
it('should use the cardview style if cardview is true', () => {
documentList.display = 'gallery';
fixture.detectChanges();
expect(element.querySelector('.adf-datatable-card')).toBeDefined();
});
it('should use the base document list style if cardview is false', () => {
documentList.display = 'list';
fixture.detectChanges();
expect(element.querySelector('.adf-datatable-card')).toBe(null);
expect(element.querySelector('.adf-datatable')).toBeDefined();
});
it('should reset selection upon reload', () => {
documentList.currentFolderId = 'id-folder';
spyOn(documentList, 'resetSelection').and.callThrough();

View File

@@ -41,7 +41,6 @@ import {
DataRowActionEvent,
DataSorting,
DataTableComponent,
DisplayMode,
ShowHeaderMode,
PaginatedComponent,
AppConfigService,
@@ -61,7 +60,6 @@ import {
DataColumn
} from '@alfresco/adf-core';
import { NodesApiService } from '../../common/services/nodes-api.service';
import { Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
import { Subject, BehaviorSubject, of } from 'rxjs';
import { ShareDataRow } from './../data/share-data-row.model';
@@ -70,7 +68,6 @@ import { presetsDefaultModel } from '../models/preset.model';
import { ContentActionModel } from './../models/content-action.model';
import { PermissionStyleModel } from './../models/permissions-style.model';
import { NodeEntityEvent, NodeEntryEvent } from './node.event';
import { NavigableComponentInterface } from '../../breadcrumb/navigable-component.interface';
import { FilterSearch } from './../../search/models/filter-search.interface';
import { RowFilter } from '../data/row-filter.model';
import { DocumentListService } from '../services/document-list.service';
@@ -97,7 +94,7 @@ const BYTES_TO_MB_CONVERSION_VALUE = 1048576;
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-document-list' }
})
export class DocumentListComponent extends DataTableSchema implements OnInit, OnChanges, OnDestroy, AfterContentInit, PaginatedComponent, NavigableComponentInterface {
export class DocumentListComponent extends DataTableSchema implements OnInit, OnChanges, OnDestroy, AfterContentInit, PaginatedComponent {
static SINGLE_CLICK_NAVIGATION: string = 'click';
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
@@ -133,10 +130,6 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
@Input()
where: string;
/** Change the display mode of the table. Can be "list" or "gallery". */
@Input()
display: string = DisplayMode.List;
/**
* Define a set of CSS styles to apply depending on the permission
* of the user on that node. See the Permission Style model
@@ -479,7 +472,6 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
return defaultSorting;
}
isMobile(): boolean {
return !!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
@@ -976,7 +968,6 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
return canNavigateFolder;
}
private onDataReady(nodePaging: NodePaging) {
this.ready.emit(nodePaging);
this.pagination.next(nodePaging.list.pagination);