feat(appstore): use shared resolver
This commit is contained in:
@@ -25,13 +25,13 @@ export class ObViewAppStore extends DeesElement {
|
||||
accessor currentView: 'grid' | 'detail' = 'grid';
|
||||
|
||||
@state()
|
||||
accessor selectedApp: interfaces.requests.ICatalogApp | null = null;
|
||||
accessor selectedApp: interfaces.requests.IAppStoreApp | null = null;
|
||||
|
||||
@state()
|
||||
accessor selectedAppMeta: interfaces.requests.IAppMeta | null = null;
|
||||
accessor selectedAppMeta: interfaces.requests.IAppStoreAppMeta | null = null;
|
||||
|
||||
@state()
|
||||
accessor selectedAppConfig: interfaces.requests.IAppVersionConfig | null = null;
|
||||
accessor selectedAppConfig: interfaces.requests.IAppStoreVersionConfig | null = null;
|
||||
|
||||
@state()
|
||||
accessor selectedVersion: string = '';
|
||||
@@ -331,7 +331,7 @@ export class ObViewAppStore extends DeesElement {
|
||||
|
||||
async connectedCallback() {
|
||||
super.connectedCallback();
|
||||
await appstate.appStoreStatePart.dispatchAction(appstate.fetchAppTemplatesAction, null);
|
||||
await appstate.appStoreStatePart.dispatchAction(appstate.fetchAppStoreTemplatesAction, null);
|
||||
}
|
||||
|
||||
public render(): TemplateResult {
|
||||
@@ -541,7 +541,7 @@ export class ObViewAppStore extends DeesElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private renderDeploymentFootprint(config: interfaces.requests.IAppVersionConfig): TemplateResult | '' {
|
||||
private renderDeploymentFootprint(config: interfaces.requests.IAppStoreVersionConfig): TemplateResult | '' {
|
||||
const volumes = this.getConfigVolumes(config);
|
||||
const publishedPorts = config.publishedPorts || [];
|
||||
|
||||
@@ -577,7 +577,7 @@ export class ObViewAppStore extends DeesElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private renderDeployConfirmation(config: interfaces.requests.IAppVersionConfig): TemplateResult | '' {
|
||||
private renderDeployConfirmation(config: interfaces.requests.IAppStoreVersionConfig): TemplateResult | '' {
|
||||
const volumes = this.getConfigVolumes(config);
|
||||
const publishedPorts = config.publishedPorts || [];
|
||||
if (volumes.length === 0 && publishedPorts.length === 0) return '';
|
||||
@@ -590,7 +590,7 @@ export class ObViewAppStore extends DeesElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private getConfigVolumes(config: interfaces.requests.IAppVersionConfig): interfaces.data.IServiceVolume[] {
|
||||
private getConfigVolumes(config: interfaces.requests.IAppStoreVersionConfig): interfaces.data.IServiceVolume[] {
|
||||
return (config.volumes || []).map((volume) => {
|
||||
if (typeof volume === 'string') {
|
||||
return { mountPath: volume };
|
||||
@@ -658,8 +658,8 @@ export class ObViewAppStore extends DeesElement {
|
||||
if (!identity) return;
|
||||
|
||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||
interfaces.requests.IReq_GetAppConfig
|
||||
>('/typedrequest', 'getAppConfig');
|
||||
interfaces.requests.IReq_GetAppStoreConfig
|
||||
>('/typedrequest', 'getAppStoreConfig');
|
||||
|
||||
const response = await typedRequest.fire({ identity, appId, version });
|
||||
|
||||
@@ -728,8 +728,8 @@ export class ObViewAppStore extends DeesElement {
|
||||
const identity = appstate.loginStatePart.getState().identity;
|
||||
if (!identity) return;
|
||||
const typedRequest = new plugins.domtools.plugins.typedrequest.TypedRequest<
|
||||
interfaces.requests.IReq_InstallAppTemplate
|
||||
>('/typedrequest', 'installAppTemplate');
|
||||
interfaces.requests.IReq_InstallAppStoreApp
|
||||
>('/typedrequest', 'installAppStoreApp');
|
||||
await typedRequest.fire({
|
||||
identity,
|
||||
install: {
|
||||
|
||||
@@ -226,7 +226,7 @@ export class ObViewServices extends DeesElement {
|
||||
await Promise.all([
|
||||
appstate.servicesStatePart.dispatchAction(appstate.fetchServicesAction, null),
|
||||
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServicesAction, null),
|
||||
appstate.appStoreStatePart.dispatchAction(appstate.fetchUpgradeableServicesAction, null),
|
||||
appstate.appStoreStatePart.dispatchAction(appstate.fetchUpgradeableAppStoreServicesAction, null),
|
||||
]);
|
||||
|
||||
// If a platform service was selected from the dashboard, navigate to its detail
|
||||
@@ -497,7 +497,7 @@ export class ObViewServices extends DeesElement {
|
||||
class="deploy-button"
|
||||
style="padding: 8px 16px; font-size: 13px;"
|
||||
@click=${async () => {
|
||||
await appstate.appStoreStatePart.dispatchAction(appstate.upgradeServiceAction, {
|
||||
await appstate.appStoreStatePart.dispatchAction(appstate.upgradeAppStoreServiceAction, {
|
||||
serviceName: upgradeInfo.serviceName,
|
||||
targetVersion: upgradeInfo.latestVersion,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user