@finos/legend-application-marketplace
Version:
Legend Marketplace application core
61 lines • 2.59 kB
JavaScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { makeObservable, observable } from 'mobx';
import { ActionState } from '@finos/legend-shared';
import { EntitlementsDashboardState } from './EntitlementsDashboardState.js';
export const TEST_USER = undefined;
export const TEST_USER2 = undefined;
export class LakehouseEntitlementsStore {
marketplaceBaseStore;
applicationStore;
lakehouseContractServerClient;
directoryUrl;
applicationIdUrl;
directoryCallBack;
applicationCallBack;
contractIdToTargetUsersMap = new Map();
contractIdToAssigneesMap = new Map();
contractIdToUserStatusMap = new Map();
currentViewerFetchStatus = ActionState.create();
dashboardViewer;
constructor(marketplaceBaseStore) {
makeObservable(this, {
contractIdToTargetUsersMap: observable,
contractIdToAssigneesMap: observable,
contractIdToUserStatusMap: observable,
});
this.marketplaceBaseStore = marketplaceBaseStore;
this.applicationStore = marketplaceBaseStore.applicationStore;
this.lakehouseContractServerClient =
marketplaceBaseStore.lakehouseContractServerClient;
this.directoryUrl =
this.applicationStore.config.lakehouseEntitlementsConfig?.applicationDirectoryUrl;
this.applicationIdUrl =
this.applicationStore.config.lakehouseEntitlementsConfig?.applicationIDUrl;
this.directoryCallBack = this.directoryUrl
? (user) => {
this.applicationStore.navigationService.navigator.visitAddress(`${this.directoryUrl}/${user}`);
}
: undefined;
this.applicationCallBack = this.applicationIdUrl
? (id) => {
this.applicationStore.navigationService.navigator.visitAddress(`${this.applicationIdUrl}/${id}`);
}
: undefined;
this.dashboardViewer = new EntitlementsDashboardState(this);
}
}
//# sourceMappingURL=LakehouseEntitlementsStore.js.map