Skip to content

Commit

Permalink
Multi instance compare2 (#3886)
Browse files Browse the repository at this point in the history
CR: Jakub
  • Loading branch information
lbwexler authored Jan 3, 2025
1 parent 39c5c72 commit 51bf50d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
9 changes: 7 additions & 2 deletions admin/tabs/cluster/distobjects/DistributedObjectsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class DistributedObjectsModel extends HoistModel {

try {
await XH.fetchJson({
url: 'distributedObjectAdmin/clearAllHibernateCaches'
url: 'clusterObjectsAdmin/clearAllHibernateCaches'
}).linkTo(this.loadModel);

await this.refreshAsync();
Expand All @@ -249,9 +249,14 @@ export class DistributedObjectsModel extends HoistModel {
override async doLoadAsync(loadSpec: LoadSpec) {
try {
const report = await XH.fetchJson({
url: 'distributedObjectAdmin/getDistributedObjectsReport'
url: 'clusterObjectsAdmin/getClusterObjectsReport'
});

report.info = report.info.map(it => ({
...it,
comparableFields: it.comparableAdminStats
}));

this.gridModel.loadData(this.processReport(report));
runInAction(() => {
this.startTimestamp = report.startTimestamp
Expand Down
6 changes: 3 additions & 3 deletions cmp/viewmanager/ViewManagerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export interface ViewCreateSpec {
}

export interface ViewUpdateSpec {
name: string;
group: string;
description: string;
name?: string;
group?: string;
description?: string;
isShared?: boolean;
isDefaultPinned?: boolean;
}
Expand Down
16 changes: 5 additions & 11 deletions desktop/cmp/viewmanager/dialog/ViewPanelModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {FormModel} from '@xh/hoist/cmp/form';
import {fragment, p, strong} from '@xh/hoist/cmp/layout';
import {HoistModel, managed, TaskObserver, XH} from '@xh/hoist/core';
import {capitalize} from 'lodash';
import {capitalize, isUndefined} from 'lodash';
import {ManageDialogModel} from './ManageDialogModel';
import {makeObservable} from '@xh/hoist/mobx';
import {ViewInfo} from '@xh/hoist/cmp/viewmanager';
Expand Down Expand Up @@ -55,14 +55,14 @@ export class ViewPanelModel extends HoistModel {

async saveAsync() {
const {parent, view, formModel} = this,
{name, group, description, isDefaultPinned, isShared} = formModel.getData(),
updates = formModel.getData(true),
isValid = await formModel.validateAsync(),
isDirty = formModel.isDirty;

if (!isValid || !isDirty) return;

if (view.isOwned && view.isShared != isShared) {
const msg: ReactNode = !isShared
if (view.isOwned && !isUndefined(updates.isShared)) {
const msg: ReactNode = !updates.isShared
? `Your ${view.typedName} will no longer be visible to all other ${XH.appName} users.`
: `Your ${view.typedName} will become visible to all other ${XH.appName} users.`;
const msgs = [msg, strong('Are you sure you want to proceed?')];
Expand All @@ -79,13 +79,7 @@ export class ViewPanelModel extends HoistModel {
if (!confirmed) return;
}

await parent.updateAsync(view, {
name,
group,
description,
isShared,
isDefaultPinned
});
await parent.updateAsync(view, updates);
}

//------------------------
Expand Down

0 comments on commit 51bf50d

Please sign in to comment.