Add panelCollapseMode signal to subpanel component

This commit is contained in:
Clemente Raposo 2024-11-06 13:03:13 +00:00 committed by Jack Anderson
parent 199bda9b4d
commit 547fbfc80c
3 changed files with 7 additions and 4 deletions

View file

@ -26,15 +26,15 @@
*/ */
--> -->
<ng-container> <ng-container>
<scrm-panel [title]="store.getTitle()" mode="closable" [close]="closeButton" bodyPadding="0" [klass]="'subpanel-' + store?.metadata?.name ?? ''"> <scrm-panel [title]="store.getTitle()" [mode]="store?.panelCollapseMode() ?? 'closable'" [close]="closeButton" bodyPadding="0" [klass]="'subpanel-' + store?.metadata?.name ?? ''">
<span class="subpanel-icon pl-1" panel-icon-area> <span class="subpanel-icon pl-1" panel-icon-area *ngIf="store.getIcon()">
<scrm-image [image]="store.getIcon()"></scrm-image> <scrm-image [image]="store.getIcon()"></scrm-image>
</span> </span>
<span panel-header-button> <span panel-header-button>
<scrm-action-group-menu [config]="actionsAdapter" <scrm-action-group-menu [config]="actionsAdapter"
[actionContext]="getActionContext()" [actionContext]="getActionContext()"
[actionLimitConfig]="'subpanelview_actions_limits'" [actionLimitConfig]="'subpanelview_actions_limits'"
buttonClass="btn btn-sm btn-outline-light" [buttonClass]="panelHeaderButtonClass"
></scrm-action-group-menu> ></scrm-action-group-menu>
</span> </span>
<div panel-body> <div panel-body>

View file

@ -55,6 +55,7 @@ export class SubpanelComponent implements OnInit {
@Input() maxColumns$: Observable<number>; @Input() maxColumns$: Observable<number>;
@Input() onClose: Function; @Input() onClose: Function;
@Input() filterConfig: FilterConfig; @Input() filterConfig: FilterConfig;
@Input() panelHeaderButtonClass: string = 'btn btn-sm btn-outline-light';
closeButton: ButtonInterface; closeButton: ButtonInterface;
adapter: SubpanelTableAdapter; adapter: SubpanelTableAdapter;

View file

@ -24,7 +24,7 @@
* the words "Supercharged by SuiteCRM". * the words "Supercharged by SuiteCRM".
*/ */
import {Injectable} from '@angular/core'; import {Injectable, signal, WritableSignal} from '@angular/core';
import {StateStore} from '../../../../store/state'; import {StateStore} from '../../../../store/state';
import {RecordList, RecordListStore} from '../../../../store/record-list/record-list.store'; import {RecordList, RecordListStore} from '../../../../store/record-list/record-list.store';
import {BehaviorSubject, forkJoin, Observable, Subscription} from 'rxjs'; import {BehaviorSubject, forkJoin, Observable, Subscription} from 'rxjs';
@ -47,6 +47,7 @@ import {map, take, tap} from "rxjs/operators";
import {MetadataStore} from "../../../../store/metadata/metadata.store.service"; import {MetadataStore} from "../../../../store/metadata/metadata.store.service";
import {SavedFilter, SavedFilterMap} from "../../../../store/saved-filters/saved-filter.model"; import {SavedFilter, SavedFilterMap} from "../../../../store/saved-filters/saved-filter.model";
import {UserPreferenceStore} from "../../../../store/user-preference/user-preference.store"; import {UserPreferenceStore} from "../../../../store/user-preference/user-preference.store";
import {PanelCollapseMode} from "../../../../components/panel/panel.component";
export interface SubpanelStoreMap { export interface SubpanelStoreMap {
[key: string]: SubpanelStore; [key: string]: SubpanelStore;
@ -71,6 +72,7 @@ export class SubpanelStore implements StateStore {
columns$: Observable<ColumnDefinition[]>; columns$: Observable<ColumnDefinition[]>;
metadata: SubPanelDefinition; metadata: SubPanelDefinition;
loading$: Observable<boolean>; loading$: Observable<boolean>;
panelCollapseMode: WritableSignal<PanelCollapseMode> = signal('closable');
// Filter variables // Filter variables
filterList: FilterListStore; filterList: FilterListStore;