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:
Clemente Raposo 2021-01-15 10:43:59 +00:00 committed by Dillon-Brown
parent 9c17802df5
commit eb56608933

View file

@ -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
* *