mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 11:00:40 +08:00
Add metadata store public api to fetch module metadata
- Make getMetatada method public - Allow retrieving metadata for modules other that the current -- Containers will need to display views of different modules
This commit is contained in:
parent
9c17802df5
commit
eb56608933
1 changed files with 18 additions and 14 deletions
|
@ -156,19 +156,6 @@ export class MetadataStore implements StateStore {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal API
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the state
|
|
||||||
*
|
|
||||||
* @param {object} state to set
|
|
||||||
*/
|
|
||||||
protected updateState(state: Metadata): void {
|
|
||||||
this.store.next(internalState = state);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ListViewMeta cached Observable or call the backend
|
* Get ListViewMeta cached Observable or call the backend
|
||||||
*
|
*
|
||||||
|
@ -176,7 +163,11 @@ export class MetadataStore implements StateStore {
|
||||||
* @param {string[]} types to retrieve
|
* @param {string[]} types to retrieve
|
||||||
* @returns {object} Observable<any>
|
* @returns {object} Observable<any>
|
||||||
*/
|
*/
|
||||||
protected getMetadata(module: string, types: string[]): Observable<Metadata> {
|
public getMetadata(module: string, types: string[] = null): Observable<Metadata> {
|
||||||
|
|
||||||
|
if (types === null) {
|
||||||
|
types = this.getMetadataTypes();
|
||||||
|
}
|
||||||
|
|
||||||
let metadataCache: BehaviorSubject<Metadata> = null;
|
let metadataCache: BehaviorSubject<Metadata> = null;
|
||||||
// check for currently missing and
|
// check for currently missing and
|
||||||
|
@ -225,6 +216,19 @@ export class MetadataStore implements StateStore {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal API
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the state
|
||||||
|
*
|
||||||
|
* @param {object} state to set
|
||||||
|
*/
|
||||||
|
protected updateState(state: Metadata): void {
|
||||||
|
this.store.next(internalState = state);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the Metadata from the backend
|
* Fetch the Metadata from the backend
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue