+283
-206
lines changedFilter options
+283
-206
lines changed Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ export function start(options: { routes: JSX.Element[], showAlerts?: (typeName:
52
52
}));
53
53
54
54
Operations.addSettings(new EntityOperationSettings(AlertOperation.Delay, {
55
-
onClick: (eoc) => chooseDate().then(d => d && eoc.defaultClick(d.toISO())).done(),
55
+
onClick: (eoc) => chooseDate().then(d => d && eoc.defaultClick(d.toISO())),
56
56
hideOnCanExecute: true,
57
-
contextual: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())).done() },
58
-
contextualFromMany: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())).done() },
57
+
contextual: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())) },
58
+
contextualFromMany: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())) },
59
59
}));
60
60
61
61
var cellFormatter = new Finder.CellFormatter((cell, ctx) => {
Original file line number Diff line number Diff line change
@@ -32,24 +32,24 @@ export function start(options: { routes: JSX.Element[] }) {
32
32
onClick: eoc => {
33
33
(eoc.frame.entityComponent as DynamicTypeComponent).beforeSave();
34
34
35
-
Operations.API.executeEntity(eoc.entity, eoc.operationInfo.key)
35
+
return Operations.API.executeEntity(eoc.entity, eoc.operationInfo.key)
36
36
.then(pack => { eoc.frame.onReload(pack); Operations.notifySuccess(); })
37
37
.then(() => {
38
38
if (AuthClient.isPermissionAuthorized(DynamicPanelPermission.ViewDynamicPanel)) {
39
-
MessageModal.show({
39
+
return MessageModal.show({
40
40
title: DynamicTypeMessage.TypeSaved.niceToString(),
41
41
message: DynamicTypeMessage.DynamicType0SucessfullySavedGoToDynamicPanelNow.niceToString(eoc.entity.typeName),
42
42
buttons: "yes_no",
43
43
style: "success",
44
44
icon: "success"
45
45
}).then(result => {
46
-
if (result == "yes")
46
+
if (result == "yes")
47
47
window.open(AppContext.toAbsoluteUrl("~/dynamic/panel"));
48
-
}).done();
48
+
return;
49
+
});
49
50
}
50
51
})
51
-
.catch(ifError(ValidationError, e => eoc.frame.setError(e.modelState, "entity")))
52
-
.done();
52
+
.catch(ifError(ValidationError, e => eoc.frame.setError(e.modelState, "entity")));
53
53
},
54
54
alternatives: eoc => [],
55
55
}));
Original file line number Diff line number Diff line change
@@ -64,33 +64,33 @@ export function start(options: { routes: JSX.Element[] }) {
64
64
onClick: ctx => {
65
65
(ctx.frame.entityComponent as DynamicViewEntityComponent).beforeSave();
66
66
cleanCaches();
67
-
ctx.defaultClick();
67
+
return ctx.defaultClick();
68
68
}
69
69
}));
70
70
71
71
Operations.addSettings(new EntityOperationSettings(DynamicViewOperation.Delete, {
72
72
onClick: ctx => {
73
73
cleanCaches();
74
-
ctx.defaultClick();
74
+
return ctx.defaultClick();
75
75
},
76
-
contextual: { onClick: ctx => { cleanCaches(); ctx.defaultContextualClick(); } },
77
-
contextualFromMany: { onClick: ctx => { cleanCaches(); ctx.defaultContextualClick(); } },
76
+
contextual: { onClick: ctx => { cleanCaches(); return ctx.defaultContextualClick(); } },
77
+
contextualFromMany: { onClick: ctx => { cleanCaches(); return ctx.defaultContextualClick(); } },
78
78
}));
79
79
80
80
Operations.addSettings(new EntityOperationSettings(DynamicViewSelectorOperation.Save, {
81
81
onClick: ctx => {
82
82
cleanCaches();
83
-
ctx.defaultClick();
83
+
return ctx.defaultClick();
84
84
}
85
85
}));
86
86
87
87
Operations.addSettings(new EntityOperationSettings(DynamicViewSelectorOperation.Delete, {
88
88
onClick: ctx => {
89
89
cleanCaches();
90
-
ctx.defaultClick();
90
+
return ctx.defaultClick();
91
91
},
92
-
contextual: { onClick: ctx => { cleanCaches(); ctx.defaultContextualClick(); } },
93
-
contextualFromMany: { onClick: ctx => { cleanCaches(); ctx.defaultContextualClick(); } },
92
+
contextual: { onClick: ctx => { cleanCaches(); return ctx.defaultContextualClick(); } },
93
+
contextualFromMany: { onClick: ctx => { cleanCaches(); return ctx.defaultContextualClick(); } },
94
94
}));
95
95
96
96
Navigator.setViewDispatcher(new DynamicViewViewDispatcher());
Original file line number Diff line number Diff line change
@@ -68,20 +68,18 @@ export function start(options: { routes: JSX.Element[] }) {
68
68
69
69
Operations.addSettings(new EntityOperationSettings(PredictorOperation.Publish, {
70
70
hideOnCanExecute: true,
71
-
onClick: eoc => {
71
+
onClick: eoc =>
72
72
API.publications(eoc.entity.mainQuery.query!.key)
73
73
.then(pubs => SelectorModal.chooseElement(pubs, { buttonDisplay: a => symbolNiceName(a), buttonName: a => a.key }))
74
74
.then(pps => pps && eoc.defaultClick(pps))
75
-
.done();
76
-
},
75
+
,
77
76
contextual: {
78
-
onClick: coc => {
77
+
onClick: coc =>
79
78
Navigator.API.fetch(coc.context.lites[0])
80
79
.then(p => API.publications(p.mainQuery.query!.key))
81
80
.then(pubs => SelectorModal.chooseElement(pubs, { buttonDisplay: a => symbolNiceName(a), buttonName: a => a.key }))
82
81
.then(pps => pps && coc.defaultContextualClick(pps))
83
-
.done();
84
-
}
82
+
85
83
}
86
84
}));
87
85
Original file line number Diff line number Diff line change
@@ -3,10 +3,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3
3
import { ajaxPost, ajaxGet } from '@framework/Services';
4
4
import { EntitySettings } from '@framework/Navigator'
5
5
import * as Navigator from '@framework/Navigator'
6
+
import * as Constructor from '@framework/Constructor'
6
7
import * as Finder from '@framework/Finder'
7
8
import { Lite, Entity, registerToString, JavascriptMessage } from '@framework/Signum.Entities'
8
9
import { EntityOperationSettings } from '@framework/Operations'
9
-
import { PseudoType, Type, getTypeName } from '@framework/Reflection'
10
+
import { PseudoType, Type, getTypeName, isTypeEntity } from '@framework/Reflection'
10
11
import * as Operations from '@framework/Operations'
11
12
import { EmailMessageEntity, EmailTemplateMessageEmbedded, EmailMasterTemplateEntity, EmailMasterTemplateMessageEmbedded, EmailMessageOperation, EmailPackageEntity, EmailRecipientEmbedded, EmailConfigurationEmbedded, EmailTemplateEntity, AsyncEmailSenderPermission, EmailModelEntity, IEmailOwnerEntity, EmailFromEmbedded, MicrosoftGraphEmbedded } from './Signum.Entities.Mailing'
12
13
import { EmailSenderConfigurationEntity, Pop3ConfigurationEntity, Pop3ReceptionEntity, EmailAddressEmbedded } from './Signum.Entities.Mailing'
@@ -61,17 +62,20 @@ export function start(options: {
61
62
62
63
Operations.addSettings(new EntityOperationSettings(EmailMessageOperation.CreateEmailFromTemplate, {
63
64
onClick: (ctx) => {
64
-
65
65
var promise: Promise<string | undefined> = ctx.entity.model ? API.getConstructorType(ctx.entity.model) : Promise.resolve(undefined);
66
-
promise
67
-
68
-
Finder.find({ queryName: ctx.entity.query!.key }).then(lite => {
69
-
if (!lite)
70
-
return;
71
-
Navigator.API.fetch(lite).then(entity =>
72
-
ctx.defaultClick(entity))
73
-
.done();
74
-
}).done();
66
+
return promise.then(ct => {
67
+
if (!ct || isTypeEntity(ct))
68
+
return Finder.find({ queryName: ctx.entity.query!.key }).then(lite => {
69
+
if (!lite)
70
+
return;
71
+
return Navigator.API.fetch(lite).then(entity => ctx.defaultClick(entity));
72
+
});
73
+
else {
74
+
var s = settings[ct];
75
+
var promise = (s?.createFromTemplate ? s.createFromTemplate(ctx.entity) : Constructor.constructPack(ct).then(a => a && Navigator.view(a)));
76
+
return promise.then(model => model && ctx.defaultClick(model));
77
+
}
78
+
});
75
79
}
76
80
}));
77
81
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export function start(options: { routes: JSX.Element[] }) {
36
36
new EntityOperationSettings(TreeOperation.Copy, {
37
37
onClick: ctx => copyModal(toLite(ctx.entity)).then(m => {
38
38
if (m) {
39
-
ctx.onConstructFromSuccess = pack => Operations.notifySuccess();
39
+
ctx.onConstructFromSuccess = pack => { Operations.notifySuccess(); return Promise.resolve(); };
40
40
ctx.defaultClick(m);
41
41
}
42
42
}),
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ export function start(options: { routes: JSX.Element[], contextual: boolean, que
60
60
onClick: ctx => {
61
61
62
62
var promise: Promise<string | undefined> = ctx.entity.model ? API.getConstructorType(ctx.entity.model) : Promise.resolve(undefined);
63
-
promise
63
+
return promise
64
64
.then<Response | undefined>(ct => {
65
65
var template = toLite(ctx.entity);
66
66
@@ -77,8 +77,8 @@ export function start(options: { routes: JSX.Element[], contextual: boolean, que
77
77
if (!response)
78
78
return;
79
79
80
-
saveFile(response);
81
-
}).done();
80
+
return saveFile(response);
81
+
});
82
82
}
83
83
}));
84
84
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ interface CaseFrameModalState {
38
38
show: boolean;
39
39
prefix?: string;
40
40
refreshCount: number;
41
+
executing?: boolean;
41
42
}
42
43
43
44
var modalCount = 0;
@@ -65,7 +66,7 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
65
66
.done();
66
67
}
67
68
68
-
handleKeyDown(e: KeyboardEvent) {
69
+
handleKeyDown(e: KeyboardEvent) {
69
70
this.buttonBar && this.buttonBar.handleKeyDown(e);
70
71
}
71
72
@@ -176,7 +177,18 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
176
177
},
177
178
refreshCount: this.state.refreshCount,
178
179
allowExchangeEntity: false,
179
-
prefix: this.prefix
180
+
prefix: this.prefix,
181
+
isExecuting: () => this.state.executing == true,
182
+
execute: action => {
183
+
if (this.state.executing)
184
+
return;
185
+
186
+
this.setState({ executing: true });
187
+
action()
188
+
.finally(() => this.setState({ executing: undefined }))
189
+
.done();
190
+
}
191
+
180
192
};
181
193
182
194
var activityPack = { entity: pack.activity, canExecute: pack.canExecuteActivity };
@@ -229,7 +241,18 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
229
241
},
230
242
refreshCount: this.state.refreshCount,
231
243
allowExchangeEntity: false,
232
-
prefix: this.prefix
244
+
prefix: this.prefix,
245
+
isExecuting: () => this.state.executing == true,
246
+
execute: action => {
247
+
if (this.state.executing)
248
+
return;
249
+
250
+
this.setState({ executing: true });
251
+
252
+
action()
253
+
.finally(() => this.setState({ executing: undefined }))
254
+
.done();
255
+
}
233
256
};
234
257
235
258
var ti = this.getMainTypeInfo();
@@ -247,7 +270,7 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
247
270
};
248
271
249
272
return (
250
-
<div className="sf-main-entity case-main-entity" data-main-entity={entityInfo(mainEntity)}>
273
+
<div className="sf-main-entity case-main-entity" style={this.state.executing == true ? { opacity: ".7" } : undefined} data-main-entity={entityInfo(mainEntity)}>
251
274
<div className="sf-button-widget-container">
252
275
{renderWidgets(wc)}
253
276
{this.entityComponent && !mainEntity.isNew && !pack.activity.doneBy ? <ButtonBar ref={bb => this.buttonBar = bb} frame={mainFrame} pack={mainFrame.pack} /> : <br />}
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ interface CaseFramePageState {
29
29
pack?: WorkflowClient.CaseEntityPack;
30
30
getComponent?: (ctx: TypeContext<Entity>) => React.ReactElement<any>;
31
31
refreshCount: number;
32
+
executing?: boolean;
32
33
}
33
34
34
35
export default class CaseFramePage extends React.Component<CaseFramePageProps, CaseFramePageState> implements IHasCaseActivity {
@@ -161,7 +162,17 @@ export default class CaseFramePage extends React.Component<CaseFramePageProps, C
161
162
},
162
163
refreshCount: this.state.refreshCount,
163
164
allowExchangeEntity: false,
164
-
prefix: "caseFrame"
165
+
prefix: "caseFrame",
166
+
isExecuting: () => this.state.executing == true,
167
+
execute: action => {
168
+
if (this.state.executing)
169
+
return;
170
+
171
+
this.setState({ executing: true });
172
+
action()
173
+
.finally(() => { this.setState({ executing: undefined }) })
174
+
.done();
175
+
}
165
176
};
166
177
167
178
@@ -232,7 +243,17 @@ export default class CaseFramePage extends React.Component<CaseFramePageProps, C
232
243
},
233
244
refreshCount: this.state.refreshCount,
234
245
allowExchangeEntity: false,
235
-
prefix: "caseFrame"
246
+
prefix: "caseFrame",
247
+
isExecuting: () => this.state.executing == true,
248
+
execute: action => {
249
+
if (this.state.executing)
250
+
return;
251
+
252
+
this.setState({ executing: true });
253
+
action()
254
+
.finally(() => this.setState({ executing: undefined }))
255
+
.done();
256
+
}
236
257
};
237
258
238
259
var ti = this.getMainTypeInfo();
@@ -252,7 +273,7 @@ export default class CaseFramePage extends React.Component<CaseFramePageProps, C
252
273
};
253
274
254
275
return (
255
-
<div className="sf-main-entity case-main-entity" data-main-entity={entityInfo(mainEntity)}>
276
+
<div className="sf-main-entity case-main-entity" style={this.state.executing == true ? { opacity: ".7" } : undefined} data-main-entity={entityInfo(mainEntity)}>
256
277
<div className="sf-button-widget-container">
257
278
{renderWidgets(wc)}
258
279
{this.entityComponent && !mainEntity.isNew && !pack.activity.doneBy ? <ButtonBar ref={a => this.buttonBar = a} frame={mainFrame} pack={mainFrame.pack} /> : <br />}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4