mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-2314] display "locked by" in search results (#1732)
* display "locked by" in search results * Trigger build
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
<div
|
||||
class="aca-custom-name-column"
|
||||
[ngClass]="{
|
||||
'aca-name-column-container': isFile() && isFileWriteLocked()
|
||||
'aca-name-column-container': isFile && isFileWriteLocked
|
||||
}"
|
||||
>
|
||||
<span
|
||||
role="link"
|
||||
[attr.aria-label]="
|
||||
(isFile()
|
||||
? 'CUSTOM_NAME_COLUMN.ACCESSIBILITY.FILE_LINK_ARIA_LABEL'
|
||||
: 'CUSTOM_NAME_COLUMN.ACCESSIBILITY.FOLDER_LINK_ARIA_LABEL')
|
||||
| translate
|
||||
: {
|
||||
name: displayText$ | async
|
||||
}
|
||||
(isFile ? 'CUSTOM_NAME_COLUMN.ACCESSIBILITY.FILE_LINK_ARIA_LABEL' : 'CUSTOM_NAME_COLUMN.ACCESSIBILITY.FOLDER_LINK_ARIA_LABEL')
|
||||
| translate: { name: displayText$ | async }
|
||||
"
|
||||
class="adf-datatable-cell-value"
|
||||
title="{{ node | adfNodeNameTooltip }}"
|
||||
@@ -23,7 +18,7 @@
|
||||
{{ displayText$ | async }}
|
||||
</span>
|
||||
|
||||
<ng-container *ngIf="isFile() && isFileWriteLocked()">
|
||||
<aca-locked-by [context]="context"></aca-locked-by>
|
||||
<ng-container *ngIf="isFile && isFileWriteLocked">
|
||||
<aca-locked-by [node]="context.row.node"></aca-locked-by>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
@@ -91,11 +91,11 @@ export class CustomNameColumnComponent extends NameColumnComponent implements On
|
||||
this.onDestroy$$.complete();
|
||||
}
|
||||
|
||||
isFile(): boolean {
|
||||
get isFile(): boolean {
|
||||
return this.node && this.node.entry && !this.node.entry.isFolder;
|
||||
}
|
||||
|
||||
isFileWriteLocked(): boolean {
|
||||
get isFileWriteLocked(): boolean {
|
||||
return isLocked(this.node);
|
||||
}
|
||||
}
|
||||
|
@@ -1,22 +1,8 @@
|
||||
<div class="line">
|
||||
<span
|
||||
tabindex="0"
|
||||
role="link"
|
||||
*ngIf="isFile"
|
||||
(click)="showPreview($event)"
|
||||
(keyup.enter)="showPreview($event)"
|
||||
class="link"
|
||||
>
|
||||
<span tabindex="0" role="link" *ngIf="isFile" (click)="showPreview($event)" (keyup.enter)="showPreview($event)" class="link">
|
||||
{{ name$ | async }}
|
||||
</span>
|
||||
<span
|
||||
tabindex="0"
|
||||
role="link"
|
||||
*ngIf="!isFile"
|
||||
(click)="navigate($event)"
|
||||
(keyup.enter)="navigate($event)"
|
||||
class="bold link"
|
||||
>
|
||||
<span tabindex="0" role="link" *ngIf="!isFile" (click)="navigate($event)" (keyup.enter)="navigate($event)" class="bold link">
|
||||
{{ name$ | async }}
|
||||
</span>
|
||||
<span>{{ title$ | async }}</span>
|
||||
@@ -35,6 +21,10 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="line" *ngIf="isFile && isFileWriteLocked">
|
||||
<aca-locked-by [node]="context.row.node"></aca-locked-by>
|
||||
</div>
|
||||
|
||||
<div class="line">
|
||||
{{ 'APP.BROWSE.SEARCH.CUSTOM_ROW.LOCATION' | translate }}:
|
||||
<aca-location-link [context]="context"></aca-location-link>
|
||||
|
@@ -31,6 +31,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Router } from '@angular/router';
|
||||
import { isLocked } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-search-results-row',
|
||||
@@ -55,7 +56,7 @@ export class SearchResultsRowComponent implements OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
this.updateValues();
|
||||
|
||||
this.alfrescoApiService.nodeUpdated.pipe(takeUntil(this.onDestroy$)).subscribe((node: any) => {
|
||||
this.alfrescoApiService.nodeUpdated.pipe(takeUntil(this.onDestroy$)).subscribe((node) => {
|
||||
const row = this.context.row;
|
||||
if (row) {
|
||||
const { entry } = row.node;
|
||||
@@ -110,6 +111,10 @@ export class SearchResultsRowComponent implements OnInit, OnDestroy {
|
||||
return this.node.entry.isFile;
|
||||
}
|
||||
|
||||
get isFileWriteLocked(): boolean {
|
||||
return isLocked(this.node);
|
||||
}
|
||||
|
||||
showPreview(event: MouseEvent) {
|
||||
event.stopPropagation();
|
||||
this.store.dispatch(new ViewNodeAction(this.node.entry.id, { location: this.router.url }));
|
||||
|
@@ -27,6 +27,7 @@ import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { ContentModule } from '@alfresco/adf-content-services';
|
||||
import { LockedByModule } from '@alfresco/aca-shared';
|
||||
import { SearchResultsComponent } from './search-results/search-results.component';
|
||||
import { SearchResultsRowComponent } from './search-results-row/search-results-row.component';
|
||||
import { SearchLibrariesResultsComponent } from './search-libraries-results/search-libraries-results.component';
|
||||
@@ -47,7 +48,8 @@ import { ContextMenuModule } from '../context-menu/context-menu.module';
|
||||
AppToolbarModule,
|
||||
DirectivesModule,
|
||||
AppLayoutModule,
|
||||
ContextMenuModule
|
||||
ContextMenuModule,
|
||||
LockedByModule
|
||||
],
|
||||
declarations: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent],
|
||||
exports: [SearchResultsComponent, SearchLibrariesResultsComponent, SearchResultsRowComponent]
|
||||
|
Reference in New Issue
Block a user