@flarehr/superhero-basic-profile 0.1.2217 → 0.1.2219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/delete.dcc7b157.svg +5 -0
- package/dist/assets/dialog-warning.cc77f3ba.svg +5 -0
- package/dist/assets/pencil.05fe6be6.svg +5 -0
- package/dist/index.html +20 -0
- package/dist/superhero-basic-profile.js +50 -0
- package/package.json +1 -1
- package/dist/App.jsx +0 -4
- package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +0 -102
- package/dist/Basic.Profile.Domain/Audit.jsx +0 -149
- package/dist/Basic.Profile.Domain/Commands.jsx +0 -68
- package/dist/Basic.Profile.Domain/CommonTypes.jsx +0 -194
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +0 -58
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +0 -23
- package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +0 -35
- package/dist/Basic.Profile.Domain/Config/Commands.jsx +0 -72
- package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +0 -197
- package/dist/Basic.Profile.Domain/Config/Dto.jsx +0 -181
- package/dist/Basic.Profile.Domain/Config/Types.jsx +0 -152
- package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +0 -23
- package/dist/Basic.Profile.Domain/DomainAggregates.jsx +0 -801
- package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +0 -426
- package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +0 -564
- package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +0 -157
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +0 -102
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +0 -85
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +0 -16
- package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +0 -427
- package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +0 -118
- package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +0 -6
- package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +0 -184
- package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +0 -439
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +0 -38
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +0 -199
- package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +0 -125
- package/dist/Basic.Profile.Domain/Dto/Audit.jsx +0 -121
- package/dist/Basic.Profile.Domain/Dto/Commands.jsx +0 -256
- package/dist/Basic.Profile.Domain/Dto/Common.jsx +0 -84
- package/dist/Basic.Profile.Domain/Dto/Events.jsx +0 -220
- package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +0 -580
- package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +0 -324
- package/dist/Basic.Profile.Domain/Dto/Validation.jsx +0 -229
- package/dist/Basic.Profile.Domain/Events.jsx +0 -64
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +0 -140
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +0 -499
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +0 -51
- package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +0 -154
- package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +0 -187
- package/dist/Basic.Profile.Domain/Import/Dto.jsx +0 -475
- package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +0 -531
- package/dist/Basic.Profile.Domain/Import/Types.jsx +0 -405
- package/dist/Basic.Profile.Domain/JwtPayload.jsx +0 -44
- package/dist/Basic.Profile.Domain/Metadata.jsx +0 -257
- package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +0 -261
- package/dist/Basic.Profile.Domain/ProfileModels.jsx +0 -59
- package/dist/Basic.Profile.Domain/Utils.jsx +0 -372
- package/dist/Common/PreactCustomElement.jsx +0 -8
- package/dist/Common/Resources.jsx +0 -20
- package/dist/Common/Tailwind.jsx +0 -8
- package/dist/Common/Utils.jsx +0 -18
- package/dist/Directory/App.jsx +0 -192
- package/dist/Directory/BackendServices/Common.jsx +0 -115
- package/dist/Directory/BackendServices/ConfigService.jsx +0 -168
- package/dist/Directory/BackendServices/ImportService.jsx +0 -137
- package/dist/Directory/Common.jsx +0 -93
- package/dist/Directory/Config/Components.jsx +0 -173
- package/dist/Directory/Config/Types.jsx +0 -187
- package/dist/Directory/PastImports/PastImports.jsx +0 -81
- package/dist/Directory/ProfileImport/ProfileImport.jsx +0 -284
- package/dist/Directory/ProfileImport/Types.jsx +0 -91
- package/dist/Directory/TabNav.jsx +0 -24
- package/dist/Directory/Types.jsx +0 -101
- package/dist/Directory/User.jsx +0 -117
- package/dist/HeadlessUI/Dialog.jsx +0 -66
- package/dist/HeadlessUI/ModalDialog.jsx +0 -74
- package/dist/HeadlessUI/Switch.jsx +0 -66
- package/dist/HeadlessUI/Transition.jsx +0 -66
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { createObj } from "../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
4
|
-
import { ofArray } from "../fable_modules/fable-library-js.4.20.0/List.js";
|
|
5
|
-
import { reactApi } from "../fable_modules/Feliz.2.8.0/Interop.fs.js";
|
|
6
|
-
import { useFeliz_React__React_useDeferred_Static_Z241A641 } from "../fable_modules/Feliz.UseDeferred.2.0.0/UseDeferred.fs.js";
|
|
7
|
-
import { defaultOf } from "../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
8
|
-
import { empty, map, singleton, append, delay, toList } from "../fable_modules/fable-library-js.4.20.0/Seq.js";
|
|
9
|
-
import { toString } from "../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
10
|
-
|
|
11
|
-
export function ErrorText(text) {
|
|
12
|
-
let elems, value_5;
|
|
13
|
-
return createElement("div", createObj(ofArray([["className", "text-center"], (elems = [createElement("p", {
|
|
14
|
-
children: ["Oops, something went wrong."],
|
|
15
|
-
}), createElement("p", {
|
|
16
|
-
children: [`Error: ${text}.`],
|
|
17
|
-
}), createElement("p", {
|
|
18
|
-
children: ["Please refresh the page and try again."],
|
|
19
|
-
}), createElement("button", createObj(ofArray([(value_5 = "mt-4 rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600", ["className", value_5]), ["onClick", (_arg) => {
|
|
20
|
-
window.location.reload();
|
|
21
|
-
}], ["children", "Refresh"]])))], ["children", reactApi.Children.toArray(Array.from(elems))])])));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function ImportSummary(importSummaryInputProps) {
|
|
25
|
-
let elems_1;
|
|
26
|
-
const onDone = importSummaryInputProps.onDone;
|
|
27
|
-
const fetchImport = importSummaryInputProps.fetchImport;
|
|
28
|
-
const importId = importSummaryInputProps.importId;
|
|
29
|
-
const deferredImport = useFeliz_React__React_useDeferred_Static_Z241A641(fetchImport(importId), []);
|
|
30
|
-
let matchResult, error, msg, import$;
|
|
31
|
-
switch (deferredImport.tag) {
|
|
32
|
-
case 3: {
|
|
33
|
-
matchResult = 1;
|
|
34
|
-
error = deferredImport.fields[0];
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
case 2: {
|
|
38
|
-
if (deferredImport.fields[0].tag === 0) {
|
|
39
|
-
matchResult = 3;
|
|
40
|
-
import$ = deferredImport.fields[0].fields[0];
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
matchResult = 2;
|
|
44
|
-
msg = deferredImport.fields[0].fields[0];
|
|
45
|
-
}
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
default:
|
|
49
|
-
matchResult = 0;
|
|
50
|
-
}
|
|
51
|
-
switch (matchResult) {
|
|
52
|
-
case 0:
|
|
53
|
-
return defaultOf();
|
|
54
|
-
case 1:
|
|
55
|
-
return ErrorText(error.message);
|
|
56
|
-
case 2:
|
|
57
|
-
return ErrorText(msg);
|
|
58
|
-
default:
|
|
59
|
-
return createElement("div", createObj(ofArray([["className", "text-center"], (elems_1 = toList(delay(() => append(singleton(createElement("p", {
|
|
60
|
-
children: [`Import ID: ${import$.ImportId}`],
|
|
61
|
-
})), delay(() => append(singleton(createElement("p", {
|
|
62
|
-
children: [`Creator: ${import$.User}`],
|
|
63
|
-
})), delay(() => append(singleton(createElement("p", {
|
|
64
|
-
children: [`Filename: ${import$.Filename}`],
|
|
65
|
-
})), delay(() => append(singleton(createElement("p", {
|
|
66
|
-
children: [`Date started: ${toString(import$.StartTime)}`],
|
|
67
|
-
})), delay(() => {
|
|
68
|
-
let matchValue;
|
|
69
|
-
return append((matchValue = import$.StopTime, (matchValue == null) ? singleton(defaultOf()) : singleton(createElement("p", {
|
|
70
|
-
children: [`Date completed: ${toString(matchValue)}`],
|
|
71
|
-
}))), delay(() => append(singleton(createElement("p", {
|
|
72
|
-
children: [`Total rows: ${import$.TotalRecordCount}`],
|
|
73
|
-
})), delay(() => append(singleton(createElement("p", {
|
|
74
|
-
children: [`Succeeded rows: ${import$.SucceededRecordCount}`],
|
|
75
|
-
})), delay(() => append(singleton(createElement("p", {
|
|
76
|
-
children: [`Failed rows: ${import$.FailedRecordCount}`],
|
|
77
|
-
})), delay(() => {
|
|
78
|
-
let elems;
|
|
79
|
-
return append((import$.FailedRecordCount > 0) ? singleton(createElement("div", createObj(ofArray([["className", "mt-8"], (elems = toList(delay(() => append(singleton(createElement("p", {
|
|
80
|
-
children: ["The following profiles could not be created"],
|
|
81
|
-
})), delay(() => map((record) => createElement("li", {
|
|
82
|
-
children: [`Row ${record.RowId}: ${record.Reason}`],
|
|
83
|
-
}), import$.FailedRecords))))), ["children", reactApi.Children.toArray(Array.from(elems))])])))) : empty(), delay(() => {
|
|
84
|
-
let value_18;
|
|
85
|
-
return singleton(createElement("button", createObj(ofArray([["type", "button"], ["children", "Done"], (value_18 = "mt-8 rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600", ["className", value_18]), ["onClick", (_arg) => {
|
|
86
|
-
onDone();
|
|
87
|
-
}]]))));
|
|
88
|
-
}));
|
|
89
|
-
}))))))));
|
|
90
|
-
})))))))))), ["children", reactApi.Children.toArray(Array.from(elems_1))])])));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { record_type, bool_type, option_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { ConfigService_$reflection } from "../BackendServices/ConfigService.jsx";
|
|
4
|
-
import { createElement } from "react";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { defaultOf } from "../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
7
|
-
import { StateModule_update, StateModule_init, Msg_get_CreateDeleteStarted, Mode, Msg, Msg_get_CreateUpdateStarted, State__GetConfigOrDefault, Mode__get_InEditMode } from "./Types.jsx";
|
|
8
|
-
import { createObj, equals } from "../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
9
|
-
import { OwnershipDto } from "../../Basic.Profile.Domain/Config/Api/Admin/Read.jsx";
|
|
10
|
-
import { reactApi } from "../../fable_modules/Feliz.2.8.0/Interop.fs.js";
|
|
11
|
-
import { dialogWarningDefault, deleteDefault, pencilDefault } from "../../Common/Resources.jsx";
|
|
12
|
-
import { singleton, ofArray } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
13
|
-
import { Group_Props, Label_Props, Label_Component, Props as Props_1, Component, Group_Component } from "../../HeadlessUI/Switch.jsx";
|
|
14
|
-
import { Props as Props_2, OkButtonTheme, Component as Component_1 } from "../../HeadlessUI/ModalDialog.jsx";
|
|
15
|
-
import { React_useElmish_Z6C327F2E } from "../../fable_modules/Feliz.UseElmish.2.5.0/UseElmish.fs.js";
|
|
16
|
-
import { ProgramModule_mkProgram } from "../../fable_modules/Fable.Elmish.4.0.0/program.fs.js";
|
|
17
|
-
|
|
18
|
-
export class Props extends Record {
|
|
19
|
-
constructor(PartnerId, AccountId, ConfigService, EditAllowed) {
|
|
20
|
-
super();
|
|
21
|
-
this.PartnerId = PartnerId;
|
|
22
|
-
this.AccountId = AccountId;
|
|
23
|
-
this.ConfigService = ConfigService;
|
|
24
|
-
this.EditAllowed = EditAllowed;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function Props_$reflection() {
|
|
29
|
-
return record_type("Basic.Profile.UI.Superhero.Directory.Config.Components.Props", [], Props, () => [["PartnerId", string_type], ["AccountId", option_type(string_type)], ["ConfigService", ConfigService_$reflection()], ["EditAllowed", bool_type]]);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function Basic_Profile_Domain_Config_Api_Admin_Read_ConfigDto__ConfigDto_get_OwnershipTitle(this$) {
|
|
33
|
-
const matchValue = this$.Ownership;
|
|
34
|
-
switch (matchValue.tag) {
|
|
35
|
-
case 2:
|
|
36
|
-
return "(Default)";
|
|
37
|
-
case 0:
|
|
38
|
-
return "";
|
|
39
|
-
default:
|
|
40
|
-
return "(Inherited)";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function renderErrorIfNeeded(state) {
|
|
45
|
-
const matchValue = state.Error;
|
|
46
|
-
let matchResult, error;
|
|
47
|
-
if (matchValue != null) {
|
|
48
|
-
if (state.Mode.tag === 1) {
|
|
49
|
-
matchResult = 0;
|
|
50
|
-
error = matchValue;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
matchResult = 1;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
matchResult = 1;
|
|
58
|
-
}
|
|
59
|
-
switch (matchResult) {
|
|
60
|
-
case 0:
|
|
61
|
-
return createElement("h1", {
|
|
62
|
-
className: "basis-1/4 text-lg font-semibold text-red-500",
|
|
63
|
-
children: `${error}. Please cancel edit or try again`,
|
|
64
|
-
});
|
|
65
|
-
default:
|
|
66
|
-
return defaultOf();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function renderPageTitle(configDto, isInEditMode) {
|
|
71
|
-
return createElement("h3", {
|
|
72
|
-
className: "basis-1/4 text-lg font-semibold text-gray-900",
|
|
73
|
-
children: isInEditMode ? "Admin Settings (*)" : (`Admin Settings ${Basic_Profile_Domain_Config_Api_Admin_Read_ConfigDto__ConfigDto_get_OwnershipTitle(configDto)}`),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function renderButtons(props, state, dispatch) {
|
|
78
|
-
let elems_2;
|
|
79
|
-
const canEdit = props.EditAllowed && !Mode__get_InEditMode(state.Mode);
|
|
80
|
-
const editButtonVisibility = canEdit ? "" : "hidden";
|
|
81
|
-
const saveAndCancelButtonsVisibility = Mode__get_InEditMode(state.Mode) ? "" : "hidden";
|
|
82
|
-
const deleteButtonVisibility = (canEdit && equals(State__GetConfigOrDefault(state).Ownership, new OwnershipDto(0, []))) ? "" : "hidden";
|
|
83
|
-
return createElement("div", createObj(ofArray([["className", "flex flex-row space-x-2 basis-3/4"], (elems_2 = [createElement("button", {
|
|
84
|
-
className: `${saveAndCancelButtonsVisibility} inline-flex justify-center rounded-md border border-transparent py-2 px-4 shadow-sm focus:outline-none focus:ring-indigo-500 focus:ring-2 focus:ring-offset-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700`,
|
|
85
|
-
onClick: (_arg) => {
|
|
86
|
-
dispatch(Msg_get_CreateUpdateStarted());
|
|
87
|
-
},
|
|
88
|
-
type: "button",
|
|
89
|
-
children: "Save",
|
|
90
|
-
}), createElement("button", {
|
|
91
|
-
className: `${saveAndCancelButtonsVisibility} inline-flex justify-center rounded-md border border-transparent py-2 px-4 shadow-sm focus:outline-none focus:ring-indigo-500 focus:ring-2 focus:ring-offset-2 text-sm font-medium border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-gray-300`,
|
|
92
|
-
onClick: (_arg_1) => {
|
|
93
|
-
dispatch(new Msg(8, []));
|
|
94
|
-
},
|
|
95
|
-
type: "button",
|
|
96
|
-
children: "Cancel",
|
|
97
|
-
}), createElement("button", {
|
|
98
|
-
className: `${editButtonVisibility} inline-flex items-center rounded border border-transparent bg-indigo-600 px-2.5 py-1.5 mr-2 text-xs font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none`,
|
|
99
|
-
onClick: (_arg_2) => {
|
|
100
|
-
dispatch(new Msg(0, [new Mode(1, [])]));
|
|
101
|
-
},
|
|
102
|
-
type: "button",
|
|
103
|
-
children: reactApi.Children.toArray([pencilDefault]),
|
|
104
|
-
}), createElement("button", {
|
|
105
|
-
className: `${deleteButtonVisibility} inline-flex items-center rounded border border-transparent bg-red-600 px-2.5 py-1.5 text-xs font-medium text-white shadow-sm hover:bg-red-700 focus:outline-none`,
|
|
106
|
-
onClick: (_arg_3) => {
|
|
107
|
-
dispatch(new Msg(6, []));
|
|
108
|
-
},
|
|
109
|
-
type: "button",
|
|
110
|
-
children: reactApi.Children.toArray([deleteDefault]),
|
|
111
|
-
})], ["children", reactApi.Children.toArray(Array.from(elems_2))])])));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export function renderCheckbox(isChecked, title, enabled, onChange) {
|
|
115
|
-
return Group_Component(singleton(new Group_Props([Component(ofArray([new Props_1(0, [isChecked]), new Props_1(1, [(b) => {
|
|
116
|
-
if (enabled) {
|
|
117
|
-
onChange(b);
|
|
118
|
-
}
|
|
119
|
-
}]), new Props_1(2, [`${isChecked ? "bg-gray-900" : "bg-gray-300"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2`]), new Props_1(3, [[createElement("span", {
|
|
120
|
-
className: `${isChecked ? "translate-x-5" : "translate-x-0"} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out`,
|
|
121
|
-
})]])])), Label_Component(ofArray([new Label_Props(0, ["ml-3"]), new Label_Props(1, [[createElement("span", {
|
|
122
|
-
className: "text-sm leading-5 font-medium text-gray-900",
|
|
123
|
-
children: title,
|
|
124
|
-
})]])]))])));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function renderConfirmationDialogIfRequested(state, dispatch) {
|
|
128
|
-
if (state.CurrentConfirmationDialog == null) {
|
|
129
|
-
return defaultOf();
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
return Component_1(new Props_2(true, "Reset User Management Configuration", "Are you sure you want to reset the current user management configuration? This action cannot be undone.", dialogWarningDefault, "Reset", () => {
|
|
133
|
-
dispatch(Msg_get_CreateDeleteStarted());
|
|
134
|
-
}, new OkButtonTheme(1, []), "Cancel", () => {
|
|
135
|
-
dispatch(new Msg(7, []));
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function ConfigComponent(props) {
|
|
141
|
-
let elems_2, elems, elems_1;
|
|
142
|
-
const patternInput = React_useElmish_Z6C327F2E(() => ProgramModule_mkProgram(() => StateModule_init, (msg, state) => StateModule_update(props.PartnerId, props.AccountId, props.ConfigService, msg, state), (_arg, _arg_1) => {
|
|
143
|
-
}), undefined, undefined);
|
|
144
|
-
const state_1 = patternInput[0];
|
|
145
|
-
const dispatch = patternInput[1];
|
|
146
|
-
const canEdit = props.EditAllowed && Mode__get_InEditMode(state_1.Mode);
|
|
147
|
-
const matchValue = state_1.Config;
|
|
148
|
-
switch (matchValue.tag) {
|
|
149
|
-
case 3:
|
|
150
|
-
return createElement("div", {
|
|
151
|
-
children: ["Something went wrong. Please try again"],
|
|
152
|
-
});
|
|
153
|
-
case 2: {
|
|
154
|
-
const result = matchValue.fields[0];
|
|
155
|
-
if (result.tag === 0) {
|
|
156
|
-
const configDto = result.fields[0];
|
|
157
|
-
return createElement("div", createObj(ofArray([["className", "flex flex-col mt-5 w-full "], (elems_2 = [createElement("div", createObj(ofArray([["className", "flex flex-row"], (elems = [renderPageTitle(configDto, Mode__get_InEditMode(state_1.Mode)), renderButtons(props, state_1, dispatch)], ["children", reactApi.Children.toArray(Array.from(elems))])]))), createElement("div", createObj(ofArray([["className", "mt-5"], (elems_1 = [renderCheckbox(configDto.AdminUserManagementEnabled, "User Management", canEdit, (arg) => {
|
|
158
|
-
dispatch(new Msg(3, [arg]));
|
|
159
|
-
})], ["children", reactApi.Children.toArray(Array.from(elems_1))])]))), renderErrorIfNeeded(state_1), renderConfirmationDialogIfRequested(state_1, dispatch)], ["children", reactApi.Children.toArray(Array.from(elems_2))])])));
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
return createElement("div", {
|
|
163
|
-
children: [`${result.fields[0]}`],
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
default:
|
|
168
|
-
return createElement("div", {
|
|
169
|
-
children: ["Please wait"],
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { Record, Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { bool_type, unit_type, record_type, string_type, option_type, union_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { ConfigDto, ConfigDto_get_Default, ConfigDto_$reflection } from "../../Basic.Profile.Domain/Config/Api/Admin/Read.jsx";
|
|
4
|
-
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
5
|
-
import { Deferred$1, Deferred$1_$reflection } from "../../fable_modules/Feliz.UseDeferred.2.0.0/UseDeferred.fs.js";
|
|
6
|
-
import { AsyncOperationStatus$2, AsyncOperationStatus$2_$reflection } from "../../Common/Utils.jsx";
|
|
7
|
-
import { singleton } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
8
|
-
import { Cmd_batch, Cmd_none } from "../../fable_modules/Fable.Elmish.4.0.0/cmd.fs.js";
|
|
9
|
-
import { Cmd_OfAsync_start, Cmd_OfAsyncWith_perform } from "../../fable_modules/Fable.Elmish.4.0.0/cmd.fs.js";
|
|
10
|
-
import { ConfigService__DeleteConfig, ConfigService__UpdateConfig, ConfigService__GetConfig } from "../BackendServices/ConfigService.jsx";
|
|
11
|
-
import { ConfigPutDto } from "../../Basic.Profile.Domain/Config/Api/Admin/Write.jsx";
|
|
12
|
-
|
|
13
|
-
export class Mode extends Union {
|
|
14
|
-
constructor(tag, fields) {
|
|
15
|
-
super();
|
|
16
|
-
this.tag = tag;
|
|
17
|
-
this.fields = fields;
|
|
18
|
-
}
|
|
19
|
-
cases() {
|
|
20
|
-
return ["View", "Edit"];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function Mode_$reflection() {
|
|
25
|
-
return union_type("Basic.Profile.UI.Superhero.Directory.Config.Types.Mode", [], Mode, () => [[], []]);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function Mode__get_InEditMode(this$) {
|
|
29
|
-
if (this$.tag === 0) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class ConfirmationDialog extends Union {
|
|
38
|
-
constructor() {
|
|
39
|
-
super();
|
|
40
|
-
this.tag = 0;
|
|
41
|
-
this.fields = [];
|
|
42
|
-
}
|
|
43
|
-
cases() {
|
|
44
|
-
return ["Reset"];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function ConfirmationDialog_$reflection() {
|
|
49
|
-
return union_type("Basic.Profile.UI.Superhero.Directory.Config.Types.ConfirmationDialog", [], ConfirmationDialog, () => [[]]);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class State extends Record {
|
|
53
|
-
constructor(Mode, CurrentConfirmationDialog, Config, Error$) {
|
|
54
|
-
super();
|
|
55
|
-
this.Mode = Mode;
|
|
56
|
-
this.CurrentConfirmationDialog = CurrentConfirmationDialog;
|
|
57
|
-
this.Config = Config;
|
|
58
|
-
this.Error = Error$;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function State_$reflection() {
|
|
63
|
-
return record_type("Basic.Profile.UI.Superhero.Directory.Config.Types.State", [], State, () => [["Mode", Mode_$reflection()], ["CurrentConfirmationDialog", option_type(ConfirmationDialog_$reflection())], ["Config", Deferred$1_$reflection(union_type("Microsoft.FSharp.Core.FSharpResult`2", [ConfigDto_$reflection(), string_type], FSharpResult$2, () => [[["ResultValue", ConfigDto_$reflection()]], [["ErrorValue", string_type]]]))], ["Error", option_type(string_type)]]);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function State__GetConfigOrDefault(this$) {
|
|
67
|
-
const matchValue = this$.Config;
|
|
68
|
-
let matchResult, config;
|
|
69
|
-
if (matchValue.tag === 2) {
|
|
70
|
-
if (matchValue.fields[0].tag === 0) {
|
|
71
|
-
matchResult = 0;
|
|
72
|
-
config = matchValue.fields[0].fields[0];
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
matchResult = 1;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
matchResult = 1;
|
|
80
|
-
}
|
|
81
|
-
switch (matchResult) {
|
|
82
|
-
case 0:
|
|
83
|
-
return config;
|
|
84
|
-
default:
|
|
85
|
-
return ConfigDto_get_Default();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export class Msg extends Union {
|
|
90
|
-
constructor(tag, fields) {
|
|
91
|
-
super();
|
|
92
|
-
this.tag = tag;
|
|
93
|
-
this.fields = fields;
|
|
94
|
-
}
|
|
95
|
-
cases() {
|
|
96
|
-
return ["SetMode", "Init", "FetchConfig", "SetAdminUserManagementEnabled", "UpdateConfig", "DeleteConfig", "ShowResetConfirmationDialog", "HideConfirmationDialog", "CancelEdit"];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function Msg_$reflection() {
|
|
101
|
-
return union_type("Basic.Profile.UI.Superhero.Directory.Config.Types.Msg", [], Msg, () => [[["Item", Mode_$reflection()]], [], [["Item", AsyncOperationStatus$2_$reflection(unit_type, union_type("Microsoft.FSharp.Core.FSharpResult`2", [ConfigDto_$reflection(), string_type], FSharpResult$2, () => [[["ResultValue", ConfigDto_$reflection()]], [["ErrorValue", string_type]]]))]], [["Item", bool_type]], [["Item", AsyncOperationStatus$2_$reflection(unit_type, union_type("Microsoft.FSharp.Core.FSharpResult`2", [unit_type, string_type], FSharpResult$2, () => [[["ResultValue", unit_type]], [["ErrorValue", string_type]]]))]], [["Item", AsyncOperationStatus$2_$reflection(unit_type, union_type("Microsoft.FSharp.Core.FSharpResult`2", [unit_type, string_type], FSharpResult$2, () => [[["ResultValue", unit_type]], [["ErrorValue", string_type]]]))]], [], [], []]);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function Msg_get_CreateFetchStarted() {
|
|
105
|
-
return new Msg(2, [new AsyncOperationStatus$2(0, [undefined])]);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function Msg_get_CreateUpdateStarted() {
|
|
109
|
-
return new Msg(4, [new AsyncOperationStatus$2(0, [undefined])]);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function Msg_get_CreateDeleteStarted() {
|
|
113
|
-
return new Msg(5, [new AsyncOperationStatus$2(0, [undefined])]);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export const StateModule_init = [new State(new Mode(0, []), undefined, new Deferred$1(0, []), undefined), singleton((dispatch) => {
|
|
117
|
-
dispatch(new Msg(1, []));
|
|
118
|
-
})];
|
|
119
|
-
|
|
120
|
-
export function StateModule_update(partnerId, accountId, configService, msg, state) {
|
|
121
|
-
let msg_2;
|
|
122
|
-
switch (msg.tag) {
|
|
123
|
-
case 0:
|
|
124
|
-
return [new State(msg.fields[0], state.CurrentConfirmationDialog, state.Config, state.Error), Cmd_none()];
|
|
125
|
-
case 2:
|
|
126
|
-
if (msg.fields[0].tag === 1) {
|
|
127
|
-
return [new State(state.Mode, state.CurrentConfirmationDialog, new Deferred$1(2, [msg.fields[0].fields[0]]), state.Error), Cmd_none()];
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
return [new State(state.Mode, state.CurrentConfirmationDialog, new Deferred$1(1, []), state.Error), Cmd_OfAsyncWith_perform((x) => {
|
|
131
|
-
Cmd_OfAsync_start(x);
|
|
132
|
-
}, () => ConfigService__GetConfig(configService, partnerId, accountId), undefined, (arg) => (new Msg(2, [new AsyncOperationStatus$2(1, [arg])])))];
|
|
133
|
-
}
|
|
134
|
-
case 3:
|
|
135
|
-
return [new State(state.Mode, state.CurrentConfirmationDialog, new Deferred$1(2, [new FSharpResult$2(0, [new ConfigDto(msg.fields[0], State__GetConfigOrDefault(state).Ownership)])]), state.Error), Cmd_none()];
|
|
136
|
-
case 4:
|
|
137
|
-
if (msg.fields[0].tag === 1) {
|
|
138
|
-
if (msg.fields[0].fields[0].tag === 1) {
|
|
139
|
-
return [new State(state.Mode, state.CurrentConfirmationDialog, state.Config, msg.fields[0].fields[0].fields[0]), Cmd_none()];
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
return [state, singleton((dispatch_2) => {
|
|
143
|
-
dispatch_2(new Msg(1, []));
|
|
144
|
-
})];
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
const writeConfigDto = new ConfigPutDto(State__GetConfigOrDefault(state).AdminUserManagementEnabled);
|
|
149
|
-
return [state, Cmd_OfAsyncWith_perform((x_1) => {
|
|
150
|
-
Cmd_OfAsync_start(x_1);
|
|
151
|
-
}, () => ConfigService__UpdateConfig(configService, partnerId, accountId, writeConfigDto), undefined, (arg_2) => (new Msg(4, [new AsyncOperationStatus$2(1, [arg_2])])))];
|
|
152
|
-
}
|
|
153
|
-
case 5:
|
|
154
|
-
if (msg.fields[0].tag === 1) {
|
|
155
|
-
if (msg.fields[0].fields[0].tag === 1) {
|
|
156
|
-
return [new State(state.Mode, state.CurrentConfirmationDialog, state.Config, msg.fields[0].fields[0].fields[0]), Cmd_none()];
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
return [state, singleton((dispatch_4) => {
|
|
160
|
-
dispatch_4(new Msg(1, []));
|
|
161
|
-
})];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return [state, Cmd_batch([singleton((dispatch_3) => {
|
|
166
|
-
dispatch_3(new Msg(7, []));
|
|
167
|
-
}), Cmd_OfAsyncWith_perform((x_2) => {
|
|
168
|
-
Cmd_OfAsync_start(x_2);
|
|
169
|
-
}, () => ConfigService__DeleteConfig(configService, partnerId, accountId), undefined, (arg_4) => (new Msg(5, [new AsyncOperationStatus$2(1, [arg_4])])))])];
|
|
170
|
-
}
|
|
171
|
-
case 6:
|
|
172
|
-
return [new State(state.Mode, new ConfirmationDialog(), state.Config, state.Error), Cmd_none()];
|
|
173
|
-
case 7:
|
|
174
|
-
return [new State(state.Mode, undefined, state.Config, state.Error), Cmd_none()];
|
|
175
|
-
case 8:
|
|
176
|
-
return [state, singleton((dispatch_5) => {
|
|
177
|
-
dispatch_5(new Msg(1, []));
|
|
178
|
-
})];
|
|
179
|
-
default:
|
|
180
|
-
return [new State(state.Mode, undefined, state.Config, undefined), Cmd_batch([singleton((dispatch) => {
|
|
181
|
-
dispatch(new Msg(0, [new Mode(0, [])]));
|
|
182
|
-
}), (msg_2 = Msg_get_CreateFetchStarted(), singleton((dispatch_1) => {
|
|
183
|
-
dispatch_1(msg_2);
|
|
184
|
-
}))])];
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { toString, Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { union_type, int32_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { reactApi } from "../../fable_modules/Feliz.2.8.0/Interop.fs.js";
|
|
6
|
-
import { createObj } from "../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
7
|
-
import { ofArray } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
8
|
-
import { map, delay, toList } from "../../fable_modules/fable-library-js.4.20.0/Seq.js";
|
|
9
|
-
import { ImportSummary } from "../Common.jsx";
|
|
10
|
-
|
|
11
|
-
export class Types_View extends Union {
|
|
12
|
-
constructor(tag, fields) {
|
|
13
|
-
super();
|
|
14
|
-
this.tag = tag;
|
|
15
|
-
this.fields = fields;
|
|
16
|
-
}
|
|
17
|
-
cases() {
|
|
18
|
-
return ["HistoryTable", "ImportSummary"];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function Types_View_$reflection() {
|
|
23
|
-
return union_type("Basic.Profile.UI.Superhero.Directory.PastImports.PastImports.Types.View", [], Types_View, () => [[], [["ImportId", int32_type]]]);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function Component(componentInputProps) {
|
|
27
|
-
let elems_7, elems_6, elems_5, elems_4, elems_1, children, elems_3, elems;
|
|
28
|
-
const fetchImport = componentInputProps.fetchImport;
|
|
29
|
-
const accountImports = componentInputProps.accountImports;
|
|
30
|
-
const patternInput = reactApi.useState(new Types_View(0, []));
|
|
31
|
-
const view = patternInput[0];
|
|
32
|
-
const setView = patternInput[1];
|
|
33
|
-
if (view.tag === 0) {
|
|
34
|
-
return createElement("div", createObj(ofArray([["className", "-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"], (elems_7 = [createElement("div", createObj(ofArray([["className", "inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"], (elems_6 = [createElement("div", createObj(ofArray([["className", "overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg"], (elems_5 = [createElement("table", createObj(ofArray([["className", "min-w-full divide-y divide-gray-300"], (elems_4 = [createElement("thead", createObj(ofArray([["className", "bg-gray-100"], (elems_1 = [(children = ofArray([createElement("th", {
|
|
35
|
-
scope: "col",
|
|
36
|
-
className: "py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6",
|
|
37
|
-
children: "Import ID",
|
|
38
|
-
}), createElement("th", {
|
|
39
|
-
scope: "col",
|
|
40
|
-
className: "px-3 py-3.5 text-left text-sm font-semibold text-gray-900",
|
|
41
|
-
children: "Date",
|
|
42
|
-
}), createElement("th", {
|
|
43
|
-
scope: "col",
|
|
44
|
-
className: "px-3 py-3.5 text-left text-sm font-semibold text-gray-900",
|
|
45
|
-
children: "User",
|
|
46
|
-
}), createElement("th", {
|
|
47
|
-
scope: "col",
|
|
48
|
-
className: "px-3 py-3.5 text-left text-sm font-semibold text-gray-900",
|
|
49
|
-
children: "# of Profiles",
|
|
50
|
-
})]), createElement("tr", {
|
|
51
|
-
children: reactApi.Children.toArray(Array.from(children)),
|
|
52
|
-
}))], ["children", reactApi.Children.toArray(Array.from(elems_1))])]))), createElement("tbody", createObj(ofArray([["className", "divide-y divide-gray-200 bg-white"], (elems_3 = toList(delay(() => map((import$) => {
|
|
53
|
-
let elems_2;
|
|
54
|
-
return createElement("tr", createObj(ofArray([["key", import$.ImportId], ["className", "cursor-pointer hover:bg-gray-50"], ["onClick", (_arg) => {
|
|
55
|
-
setView(new Types_View(1, [import$.ImportId]));
|
|
56
|
-
}], (elems_2 = [createElement("td", {
|
|
57
|
-
className: "whitespace-nowrap py-4 pl-4 pr-3 text-sm text-gray-500 sm:pl-6",
|
|
58
|
-
children: import$.ImportId,
|
|
59
|
-
}), createElement("td", {
|
|
60
|
-
className: "whitespace-nowrap px-3 py-4 text-sm text-gray-500",
|
|
61
|
-
children: toString(import$.StartTime),
|
|
62
|
-
}), createElement("td", {
|
|
63
|
-
className: "whitespace-nowrap px-3 py-4 text-sm text-gray-500",
|
|
64
|
-
children: import$.User,
|
|
65
|
-
}), createElement("td", {
|
|
66
|
-
className: "whitespace-nowrap px-3 py-4 text-sm text-gray-500",
|
|
67
|
-
children: import$.Succeeded,
|
|
68
|
-
})], ["children", reactApi.Children.toArray(Array.from(elems_2))])])));
|
|
69
|
-
}, accountImports.ImportHistory))), ["children", reactApi.Children.toArray(Array.from(elems_3))])])))], ["children", reactApi.Children.toArray(Array.from(elems_4))])])))], ["children", reactApi.Children.toArray(Array.from(elems_5))])])))], ["children", reactApi.Children.toArray(Array.from(elems_6))])])))], ["children", reactApi.Children.toArray(Array.from(elems_7))])])));
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
return createElement("div", createObj(ofArray([["className", "border border-gray-300 w-full py-12 rounded text-center bg-white"], (elems = [createElement(ImportSummary, {
|
|
73
|
-
importId: view.fields[0],
|
|
74
|
-
fetchImport: fetchImport,
|
|
75
|
-
onDone: () => {
|
|
76
|
-
setView(new Types_View(0, []));
|
|
77
|
-
},
|
|
78
|
-
})], ["children", reactApi.Children.toArray(Array.from(elems))])])));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|