mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
fix location link sorting (#473)
This commit is contained in:
committed by
Cilibiu Bogdan
parent
9cdfa35ae5
commit
d89473046c
@@ -43,7 +43,7 @@ export class DataTable extends Component {
|
||||
row: '.adf-datatable-row[role]',
|
||||
selectedRow: '.adf-datatable-row.is-selected',
|
||||
cell: '.adf-data-table-cell',
|
||||
locationLink: 'app-location-link',
|
||||
locationLink: 'aca-location-link',
|
||||
|
||||
selectedIcon: '.mat-icon',
|
||||
|
||||
|
@@ -17,5 +17,5 @@
|
||||
<span *ngIf="size">| {{ 'APP.BROWSE.SEARCH.CUSTOM_ROW.SIZE' | translate }}: {{ size | adfFileSize }} </span>
|
||||
</div>
|
||||
|
||||
<div class="line">{{ 'APP.BROWSE.SEARCH.CUSTOM_ROW.LOCATION' | translate }}: <app-location-link [context]="context"></app-location-link></div>
|
||||
<div class="line">{{ 'APP.BROWSE.SEARCH.CUSTOM_ROW.LOCATION' | translate }}: <aca-location-link [context]="context"></aca-location-link></div>
|
||||
</div>
|
@@ -126,10 +126,10 @@
|
||||
</data-column>
|
||||
|
||||
<data-column
|
||||
key="path"
|
||||
key="path.name"
|
||||
title="APP.DOCUMENT_LIST.COLUMNS.LOCATION">
|
||||
<ng-template let-context>
|
||||
<app-location-link [context]="context"></app-location-link>
|
||||
<aca-location-link [context]="context"></aca-location-link>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
|
||||
|
@@ -24,8 +24,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, ChangeDetectionStrategy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { DataColumn, DataRow, DataTableAdapter } from '@alfresco/adf-core';
|
||||
import { PathInfoEntity, MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { PathInfo, MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
import { Store } from '@ngrx/store';
|
||||
@@ -34,7 +33,7 @@ import { NavigateToParentFolder } from '../../store/actions';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-location-link',
|
||||
selector: 'aca-location-link',
|
||||
template: `
|
||||
<a href="" [title]="tooltip | async" (click)="goToLocation()">
|
||||
{{ displayText | async }}
|
||||
@@ -42,7 +41,7 @@ import { ContentApiService } from '../../services/content-api.service';
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { 'class': 'app-location-link adf-location-cell' }
|
||||
host: { 'class': 'aca-location-link adf-location-cell' }
|
||||
})
|
||||
export class LocationLinkComponent implements OnInit {
|
||||
|
||||
@@ -72,21 +71,20 @@ export class LocationLinkComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
if (this.context) {
|
||||
const data: DataTableAdapter = this.context.data;
|
||||
const col: DataColumn = this.context.col;
|
||||
const row: DataRow = this.context.row;
|
||||
const path: PathInfoEntity = data.getValue(row, col);
|
||||
const value = path || this.context.row.node.entry.path;
|
||||
const node: MinimalNodeEntity = this.context.row.node;
|
||||
if (node && node.entry && node.entry.path) {
|
||||
const path = node.entry.path;
|
||||
|
||||
if (value && value.name && value.elements) {
|
||||
this.displayText = this.getDisplayText(value);
|
||||
this.tooltip = this.getTooltip(value);
|
||||
if (path && path.name && path.elements) {
|
||||
this.displayText = this.getDisplayText(path);
|
||||
this.tooltip = this.getTooltip(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo: review once 5.2.3 is out
|
||||
private getDisplayText(path: PathInfoEntity): Observable<string> {
|
||||
private getDisplayText(path: PathInfo): Observable<string> {
|
||||
const elements = path.elements.map(e => e.name);
|
||||
|
||||
// for admin users
|
||||
@@ -122,7 +120,7 @@ export class LocationLinkComponent implements OnInit {
|
||||
}
|
||||
|
||||
// todo: review once 5.2.3 is out
|
||||
private getTooltip(path: PathInfoEntity): Observable<string> {
|
||||
private getTooltip(path: PathInfo): Observable<string> {
|
||||
const elements = path.elements.map(e => Object.assign({}, e));
|
||||
|
||||
if (elements[0].name === 'Company Home') {
|
||||
|
@@ -120,10 +120,10 @@
|
||||
</data-column>
|
||||
|
||||
<data-column
|
||||
key="path"
|
||||
key="path.name"
|
||||
title="APP.DOCUMENT_LIST.COLUMNS.LOCATION">
|
||||
<ng-template let-context>
|
||||
<app-location-link [context]="context"></app-location-link>
|
||||
<aca-location-link [context]="context"></aca-location-link>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
|
||||
|
@@ -125,10 +125,10 @@
|
||||
</data-column>
|
||||
|
||||
<data-column
|
||||
key="path"
|
||||
key="path.name"
|
||||
title="APP.DOCUMENT_LIST.COLUMNS.LOCATION">
|
||||
<ng-template let-context>
|
||||
<app-location-link [context]="context"></app-location-link>
|
||||
<aca-location-link [context]="context"></aca-location-link>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
|
||||
|
@@ -60,10 +60,10 @@
|
||||
</data-column>
|
||||
|
||||
<data-column
|
||||
key="path"
|
||||
key="path.name"
|
||||
title="APP.DOCUMENT_LIST.COLUMNS.LOCATION">
|
||||
<ng-template let-context>
|
||||
<app-location-link [context]="context"></app-location-link>
|
||||
<aca-location-link [context]="context"></aca-location-link>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
|
||||
|
Reference in New Issue
Block a user