mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-06 10:26:22 +08:00
Allow for clickable history timeline
- Add a link to the subject of the history - Takes you to the record that is shown
This commit is contained in:
parent
9d91000e28
commit
0f39a0f264
3 changed files with 24 additions and 2 deletions
|
@ -65,11 +65,22 @@
|
|||
<div class="card">
|
||||
<div class="card-body p-1 pr-2 pl-2">
|
||||
<p class="card-title text-break history-timeline-entry-title">
|
||||
<a *ngIf="entry.record.module !== 'audit'"
|
||||
[routerLink]="redirectLink(entry.record.module, entry.record.id)"
|
||||
>
|
||||
<scrm-field [type]="entry.title.type"
|
||||
mode="list"
|
||||
[field]="entry.title"
|
||||
[record]="entry.record">
|
||||
</scrm-field>
|
||||
</a>
|
||||
<a *ngIf="entry.record.module === 'audit'">
|
||||
<scrm-field [type]="entry.title.type"
|
||||
mode="list"
|
||||
[field]="entry.title"
|
||||
[record]="entry.record">
|
||||
</scrm-field>
|
||||
</a>
|
||||
</p>
|
||||
<div *ngIf="entry.description"
|
||||
class="card-text history-timeline-entry-description">
|
||||
|
|
|
@ -33,6 +33,7 @@ import {combineLatest, Subscription, timer} from 'rxjs';
|
|||
import {debounce, map} from 'rxjs/operators';
|
||||
import {floor} from 'lodash-es';
|
||||
import {CdkVirtualScrollViewport} from '@angular/cdk/scrolling';
|
||||
import {ModuleNavigation} from "../../../../services/navigation/module-navigation/module-navigation.service";
|
||||
|
||||
@Component({
|
||||
selector: 'scrm-history-timeline-widget',
|
||||
|
@ -48,7 +49,8 @@ export class HistorySidebarWidgetComponent extends BaseWidgetComponent implement
|
|||
|
||||
constructor(
|
||||
protected historyTimelineAdapterFactory: HistoryTimelineAdapterFactory,
|
||||
protected languageStore: LanguageStore) {
|
||||
protected languageStore: LanguageStore,
|
||||
protected navigation: ModuleNavigation) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -120,4 +122,11 @@ export class HistorySidebarWidgetComponent extends BaseWidgetComponent implement
|
|||
}
|
||||
}
|
||||
|
||||
redirectLink(module: string, id: string) {
|
||||
if (module === 'audit') {
|
||||
return;
|
||||
}
|
||||
return this.navigation.getRecordRouterLink(module, id)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import {ImageModule} from '../../../../components/image/image.module';
|
|||
import {LoadingSpinnerModule} from '../../../../components/loading-spinner/loading-spinner.module';
|
||||
import {LabelModule} from '../../../../components/label/label.module';
|
||||
import {ChartMessageAreaModule} from '../../../../components/chart/components/chart-message-area/chart-message-area.module';
|
||||
import {RouterModule} from "@angular/router";
|
||||
|
||||
@NgModule({
|
||||
declarations: [HistorySidebarWidgetComponent],
|
||||
|
@ -48,7 +49,8 @@ import {ChartMessageAreaModule} from '../../../../components/chart/components/ch
|
|||
WidgetPanelModule,
|
||||
LoadingSpinnerModule,
|
||||
LabelModule,
|
||||
ChartMessageAreaModule
|
||||
ChartMessageAreaModule,
|
||||
RouterModule,
|
||||
]
|
||||
})
|
||||
export class HistorySidebarWidgetModule {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue