@plusscommunities/pluss-feature-builder-web-b 1.0.2-beta.4 → 1.0.2-beta.6
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/index.cjs.js +188 -144
- package/package.json +1 -1
- package/src/actions/featureDefinitionsIndex.js +15 -15
- package/src/actions/formActions.js +148 -158
- package/src/actions/listingActions.js +27 -25
- package/src/actions/wizardActions.js +174 -189
- package/src/components/BaseFieldConfig.jsx +234 -234
- package/src/components/IconLoader.jsx +138 -138
- package/src/components/IconSelector.jsx +0 -1
- package/src/components/ListingEditor.jsx +0 -1
- package/src/components/SidebarLayout.jsx +47 -25
- package/src/components/SidebarLayout.module.css +0 -34
- package/src/components/index.js +0 -2
- package/src/components/listing/GalleryDisplay.jsx +0 -1
- package/src/components/listing/ListingGalleryInput.jsx +4 -1
- package/src/hooks/useFeatureDefinitionLoader.js +6 -2
- package/src/index.js +6 -6
- package/src/reducers/featureBuilderReducer.js +14 -25
- package/src/screens/Form.module.css +11 -1
- package/src/screens/FormLayoutStep.jsx +10 -13
- package/src/screens/FormOverviewStep.jsx +351 -357
- package/src/screens/ListingScreen.jsx +0 -1
- package/src/selectors/featureBuilderSelectors.js +52 -43
package/dist/index.cjs.js
CHANGED
|
@@ -116,7 +116,7 @@ const selectFormState = state => getFeatureBuilderState(state).form;
|
|
|
116
116
|
*/
|
|
117
117
|
const selectFormTitle = state => {
|
|
118
118
|
const formState = selectFormState(state);
|
|
119
|
-
return formState
|
|
119
|
+
return formState === null || formState === void 0 ? void 0 : formState.title;
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
/**
|
|
@@ -127,7 +127,7 @@ const selectFormTitle = state => {
|
|
|
127
127
|
*/
|
|
128
128
|
const selectFormIcon = state => {
|
|
129
129
|
const formState = selectFormState(state);
|
|
130
|
-
return formState
|
|
130
|
+
return formState === null || formState === void 0 ? void 0 : formState.icon;
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
/**
|
|
@@ -138,7 +138,7 @@ const selectFormIcon = state => {
|
|
|
138
138
|
*/
|
|
139
139
|
const selectFormDisplayName = state => {
|
|
140
140
|
const formState = selectFormState(state);
|
|
141
|
-
return formState
|
|
141
|
+
return formState === null || formState === void 0 ? void 0 : formState.displayName;
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -149,7 +149,7 @@ const selectFormDisplayName = state => {
|
|
|
149
149
|
*/
|
|
150
150
|
const selectFormLayout = state => {
|
|
151
151
|
const formState = selectFormState(state);
|
|
152
|
-
return formState
|
|
152
|
+
return formState === null || formState === void 0 ? void 0 : formState.layout;
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
/**
|
|
@@ -160,24 +160,24 @@ const selectFormLayout = state => {
|
|
|
160
160
|
*/
|
|
161
161
|
const selectFormFields = state => {
|
|
162
162
|
const formState = selectFormState(state);
|
|
163
|
-
return formState
|
|
163
|
+
return (formState === null || formState === void 0 ? void 0 : formState.fields) || [];
|
|
164
164
|
};
|
|
165
165
|
const selectFormField = fieldId => state => selectFormFields(state).find(field => field.id === fieldId);
|
|
166
166
|
const selectFormIsInitial = state => {
|
|
167
167
|
const formState = selectFormState(state);
|
|
168
|
-
return formState
|
|
168
|
+
return formState === null || formState === void 0 ? void 0 : formState._isInitial;
|
|
169
169
|
};
|
|
170
170
|
const selectFormIsSubmitting = state => {
|
|
171
171
|
const formState = selectFormState(state);
|
|
172
|
-
return formState
|
|
172
|
+
return formState === null || formState === void 0 ? void 0 : formState._isSubmitting;
|
|
173
173
|
};
|
|
174
174
|
const selectFormSubmitError = state => {
|
|
175
175
|
const formState = selectFormState(state);
|
|
176
|
-
return formState
|
|
176
|
+
return formState === null || formState === void 0 ? void 0 : formState._submitError;
|
|
177
177
|
};
|
|
178
178
|
const selectFormSubmitSuccess = state => {
|
|
179
179
|
const formState = selectFormState(state);
|
|
180
|
-
return formState
|
|
180
|
+
return formState === null || formState === void 0 ? void 0 : formState._submitSuccess;
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
// ============ DEFINITION SELECTORS ============
|
|
@@ -185,46 +185,59 @@ const selectFormSubmitSuccess = state => {
|
|
|
185
185
|
const selectDefinitionState = state => getFeatureBuilderState(state).definition;
|
|
186
186
|
const selectDefinition = state => {
|
|
187
187
|
const definitionState = selectDefinitionState(state);
|
|
188
|
-
return definitionState
|
|
188
|
+
return definitionState === null || definitionState === void 0 ? void 0 : definitionState.definition;
|
|
189
189
|
};
|
|
190
190
|
const selectDefinitionId = state => {
|
|
191
191
|
const definitionState = selectDefinitionState(state);
|
|
192
|
-
return definitionState
|
|
192
|
+
return definitionState === null || definitionState === void 0 ? void 0 : definitionState.id;
|
|
193
193
|
};
|
|
194
194
|
const selectDefinitionIsLoading = state => {
|
|
195
195
|
const definitionState = selectDefinitionState(state);
|
|
196
|
-
return definitionState
|
|
196
|
+
return definitionState === null || definitionState === void 0 ? void 0 : definitionState.isLoading;
|
|
197
197
|
};
|
|
198
198
|
const selectDefinitionError = state => {
|
|
199
199
|
const definitionState = selectDefinitionState(state);
|
|
200
|
-
return definitionState
|
|
200
|
+
return definitionState === null || definitionState === void 0 ? void 0 : definitionState.error;
|
|
201
|
+
};
|
|
202
|
+
const selectDefinitionMode = state => {
|
|
203
|
+
const definitionState = selectDefinitionState(state);
|
|
204
|
+
return definitionState === null || definitionState === void 0 ? void 0 : definitionState.mode;
|
|
201
205
|
};
|
|
202
206
|
|
|
203
|
-
// Check if we have a definition loaded
|
|
204
|
-
|
|
207
|
+
// Check if we have a definition loaded or if we've determined the mode
|
|
208
|
+
// This is used by hiddenFromFeaturePicker to determine if feature should be shown
|
|
209
|
+
// When mode is "create", definition is null but we've determined the feature doesn't exist
|
|
210
|
+
// When mode is "edit", definition exists and we've determined the feature exists
|
|
211
|
+
const selectHasDefinition = state => {
|
|
212
|
+
const definition = selectDefinition(state);
|
|
213
|
+
const mode = selectDefinitionMode(state);
|
|
214
|
+
// Consider feature "loaded" if definition exists OR mode is set
|
|
215
|
+
// Mode being set means we've successfully fetched and determined the state
|
|
216
|
+
return !!definition || !!mode;
|
|
217
|
+
};
|
|
205
218
|
|
|
206
219
|
// ============ LISTINGS SELECTORS ============
|
|
207
220
|
|
|
208
221
|
const selectListingsState = state => getFeatureBuilderState(state).listings;
|
|
209
222
|
const selectListings = state => {
|
|
210
223
|
const listingsState = selectListingsState(state);
|
|
211
|
-
return listingsState
|
|
224
|
+
return (listingsState === null || listingsState === void 0 ? void 0 : listingsState.listings) || [];
|
|
212
225
|
};
|
|
213
226
|
const selectListingsIsLoading = state => {
|
|
214
227
|
const listingsState = selectListingsState(state);
|
|
215
|
-
return listingsState
|
|
228
|
+
return listingsState === null || listingsState === void 0 ? void 0 : listingsState.isLoading;
|
|
216
229
|
};
|
|
217
230
|
const selectListingsError = state => {
|
|
218
231
|
const listingsState = selectListingsState(state);
|
|
219
|
-
return listingsState
|
|
232
|
+
return listingsState === null || listingsState === void 0 ? void 0 : listingsState.error;
|
|
220
233
|
};
|
|
221
234
|
const selectListingsIsRestoring = state => {
|
|
222
235
|
const listingsState = selectListingsState(state);
|
|
223
|
-
return listingsState
|
|
236
|
+
return listingsState === null || listingsState === void 0 ? void 0 : listingsState.isRestoring;
|
|
224
237
|
};
|
|
225
238
|
const selectListingsIsInitiallyLoaded = state => {
|
|
226
239
|
const listingsState = selectListingsState(state);
|
|
227
|
-
return listingsState
|
|
240
|
+
return listingsState === null || listingsState === void 0 ? void 0 : listingsState.isInitiallyLoaded;
|
|
228
241
|
};
|
|
229
242
|
|
|
230
243
|
// Get a specific listing by ID
|
|
@@ -257,7 +270,7 @@ const selectDeletedListings = state => {
|
|
|
257
270
|
const selectWizardState = state => getFeatureBuilderState(state).wizard;
|
|
258
271
|
const selectWizardMode = state => {
|
|
259
272
|
const wizardState = selectWizardState(state);
|
|
260
|
-
return wizardState
|
|
273
|
+
return wizardState === null || wizardState === void 0 ? void 0 : wizardState.mode;
|
|
261
274
|
};
|
|
262
275
|
|
|
263
276
|
// Mode detection selectors - wizard mode is the SINGLE SOURCE OF TRUTH for create/edit mode
|
|
@@ -266,35 +279,35 @@ const selectIsCreateMode = state => selectWizardMode(state) === "create";
|
|
|
266
279
|
const selectIsEditMode = state => selectWizardMode(state) === "edit";
|
|
267
280
|
const selectNavigationState = state => {
|
|
268
281
|
const wizardState = selectWizardState(state);
|
|
269
|
-
return wizardState
|
|
282
|
+
return wizardState === null || wizardState === void 0 ? void 0 : wizardState.navigation;
|
|
270
283
|
};
|
|
271
284
|
const selectCurrentStep = state => {
|
|
272
285
|
const navigationState = selectNavigationState(state);
|
|
273
|
-
return navigationState
|
|
286
|
+
return navigationState === null || navigationState === void 0 ? void 0 : navigationState.currentStep;
|
|
274
287
|
};
|
|
275
288
|
const selectStepValidation = state => {
|
|
276
289
|
const wizardState = selectWizardState(state);
|
|
277
|
-
return wizardState
|
|
290
|
+
return wizardState === null || wizardState === void 0 ? void 0 : wizardState.stepValidation;
|
|
278
291
|
};
|
|
279
292
|
const selectStepValidationState = step => state => {
|
|
280
293
|
const stepValidation = selectStepValidation(state);
|
|
281
|
-
return stepValidation
|
|
294
|
+
return stepValidation === null || stepValidation === void 0 ? void 0 : stepValidation[step];
|
|
282
295
|
};
|
|
283
296
|
const selectIsStepValid = step => state => {
|
|
284
297
|
const stepValidationState = selectStepValidationState(step)(state);
|
|
285
|
-
return stepValidationState
|
|
298
|
+
return stepValidationState === null || stepValidationState === void 0 ? void 0 : stepValidationState.isValid;
|
|
286
299
|
};
|
|
287
300
|
const selectStepErrors = step => state => {
|
|
288
301
|
const stepValidationState = selectStepValidationState(step)(state);
|
|
289
|
-
return stepValidationState ? stepValidationState.errors
|
|
302
|
+
return (stepValidationState === null || stepValidationState === void 0 ? void 0 : stepValidationState.errors) || {};
|
|
290
303
|
};
|
|
291
304
|
const selectStepCompletion = state => {
|
|
292
305
|
const wizardState = selectWizardState(state);
|
|
293
|
-
return wizardState
|
|
306
|
+
return wizardState === null || wizardState === void 0 ? void 0 : wizardState.stepCompletion;
|
|
294
307
|
};
|
|
295
308
|
const selectIsStepComplete = step => state => {
|
|
296
309
|
const stepCompletion = selectStepCompletion(state);
|
|
297
|
-
return stepCompletion
|
|
310
|
+
return stepCompletion === null || stepCompletion === void 0 ? void 0 : stepCompletion[step];
|
|
298
311
|
};
|
|
299
312
|
|
|
300
313
|
// Check if current step should be accessible in current mode
|
|
@@ -324,14 +337,16 @@ const selectIsStepAccessible = step => state => {
|
|
|
324
337
|
|
|
325
338
|
// Get current sort method
|
|
326
339
|
const selectSortBy = state => {
|
|
340
|
+
var _listingsState$sortBy;
|
|
327
341
|
const listingsState = selectListingsState(state);
|
|
328
|
-
return listingsState
|
|
342
|
+
return (_listingsState$sortBy = listingsState === null || listingsState === void 0 ? void 0 : listingsState.sortBy) !== null && _listingsState$sortBy !== void 0 ? _listingsState$sortBy : "newest";
|
|
329
343
|
};
|
|
330
344
|
|
|
331
345
|
// Get show deleted toggle state
|
|
332
346
|
const selectShowDeleted = state => {
|
|
347
|
+
var _listingsState$showDe;
|
|
333
348
|
const listingsState = selectListingsState(state);
|
|
334
|
-
return listingsState
|
|
349
|
+
return (_listingsState$showDe = listingsState === null || listingsState === void 0 ? void 0 : listingsState.showDeleted) !== null && _listingsState$showDe !== void 0 ? _listingsState$showDe : false;
|
|
335
350
|
};
|
|
336
351
|
|
|
337
352
|
// Get sorted and filtered listings
|
|
@@ -2257,15 +2272,6 @@ const updateFeatureBuilderIcon = icon => (dispatch, getState) => {
|
|
|
2257
2272
|
});
|
|
2258
2273
|
};
|
|
2259
2274
|
|
|
2260
|
-
/**
|
|
2261
|
-
* Form Actions for Feature Builder
|
|
2262
|
-
* Manages form state including title, icon, fields, layout, and submission
|
|
2263
|
-
* Handles CRUD operations for form fields and layout configuration
|
|
2264
|
-
* Coordinates with external menu updates and feature definition actions
|
|
2265
|
-
*
|
|
2266
|
-
* @namespace formActions
|
|
2267
|
-
*/
|
|
2268
|
-
|
|
2269
2275
|
/**
|
|
2270
2276
|
* @typedef {Object} FieldValues
|
|
2271
2277
|
* @property {string} [label] - Field label text
|
|
@@ -2291,20 +2297,20 @@ const updateFeatureBuilderIcon = icon => (dispatch, getState) => {
|
|
|
2291
2297
|
*/
|
|
2292
2298
|
|
|
2293
2299
|
const actionsTypes = {
|
|
2294
|
-
SET_INITIAL_VALUES: "
|
|
2295
|
-
SET_TITLE: "
|
|
2296
|
-
SET_ICON: "
|
|
2297
|
-
SET_DISPLAY_NAME: "
|
|
2298
|
-
ADD_FIELD: "
|
|
2299
|
-
DELETE_FIELD: "
|
|
2300
|
-
UPDATE_FIELD: "
|
|
2301
|
-
SET_LAYOUT_GRID_ICON: "
|
|
2302
|
-
SET_LAYOUT_TYPE: "
|
|
2303
|
-
SUBMIT_FORM_REQUEST: "
|
|
2304
|
-
SUBMIT_FORM_SUCCESS: "
|
|
2305
|
-
SUBMIT_FORM_FAILURE: "
|
|
2306
|
-
CLEAR_FORM_SUBMISSION_STATE: "
|
|
2307
|
-
SET_SUMMARY_FIELD: "
|
|
2300
|
+
SET_INITIAL_VALUES: "".concat(values.reducerKey.toUpperCase(), "_SET_INITIAL_VALUES"),
|
|
2301
|
+
SET_TITLE: "".concat(values.reducerKey.toUpperCase(), "_SET_TITLE"),
|
|
2302
|
+
SET_ICON: "".concat(values.reducerKey.toUpperCase(), "_SET_ICON"),
|
|
2303
|
+
SET_DISPLAY_NAME: "".concat(values.reducerKey.toUpperCase(), "_SET_DISPLAY_NAME"),
|
|
2304
|
+
ADD_FIELD: "".concat(values.reducerKey.toUpperCase(), "_ADD_FIELD"),
|
|
2305
|
+
DELETE_FIELD: "".concat(values.reducerKey.toUpperCase(), "_DELETE_FIELD"),
|
|
2306
|
+
UPDATE_FIELD: "".concat(values.reducerKey.toUpperCase(), "_UPDATE_FIELD"),
|
|
2307
|
+
SET_LAYOUT_GRID_ICON: "".concat(values.reducerKey.toUpperCase(), "_SET_LAYOUT_GRID_ICON"),
|
|
2308
|
+
SET_LAYOUT_TYPE: "".concat(values.reducerKey.toUpperCase(), "_SET_LAYOUT_TYPE"),
|
|
2309
|
+
SUBMIT_FORM_REQUEST: "".concat(values.reducerKey.toUpperCase(), "_SUBMIT_FORM_REQUEST"),
|
|
2310
|
+
SUBMIT_FORM_SUCCESS: "".concat(values.reducerKey.toUpperCase(), "_SUBMIT_FORM_SUCCESS"),
|
|
2311
|
+
SUBMIT_FORM_FAILURE: "".concat(values.reducerKey.toUpperCase(), "_SUBMIT_FORM_FAILURE"),
|
|
2312
|
+
CLEAR_FORM_SUBMISSION_STATE: "".concat(values.reducerKey.toUpperCase(), "_CLEAR_FORM_SUBMISSION_STATE"),
|
|
2313
|
+
SET_SUMMARY_FIELD: "".concat(values.reducerKey.toUpperCase(), "_SET_SUMMARY_FIELD")
|
|
2308
2314
|
};
|
|
2309
2315
|
|
|
2310
2316
|
/**
|
|
@@ -2480,7 +2486,7 @@ const clearFormSubmissionState = () => {
|
|
|
2480
2486
|
function submitForm() {
|
|
2481
2487
|
return async (dispatch, getState) => {
|
|
2482
2488
|
const state = getState()[values.reducerKey];
|
|
2483
|
-
const form = state
|
|
2489
|
+
const form = state === null || state === void 0 ? void 0 : state.form;
|
|
2484
2490
|
if (!form) {
|
|
2485
2491
|
dispatch(submitFormFailure(new Error("Form data is missing. Please refresh the page and try again.")));
|
|
2486
2492
|
return;
|
|
@@ -2494,9 +2500,9 @@ function submitForm() {
|
|
|
2494
2500
|
}
|
|
2495
2501
|
|
|
2496
2502
|
// Use mode from fetch instead of checking definition ID
|
|
2497
|
-
const definitionState = state
|
|
2498
|
-
const mode = definitionState
|
|
2499
|
-
const definitionId = definitionState
|
|
2503
|
+
const definitionState = state === null || state === void 0 ? void 0 : state.definition;
|
|
2504
|
+
const mode = definitionState === null || definitionState === void 0 ? void 0 : definitionState.mode; // Use stored mode from fetch
|
|
2505
|
+
const definitionId = definitionState === null || definitionState === void 0 ? void 0 : definitionState.id;
|
|
2500
2506
|
if (mode === "edit") {
|
|
2501
2507
|
// Always update when in edit mode
|
|
2502
2508
|
const updatedDefinition = {
|
|
@@ -2538,7 +2544,7 @@ function submitForm() {
|
|
|
2538
2544
|
status,
|
|
2539
2545
|
data
|
|
2540
2546
|
} = err.response;
|
|
2541
|
-
if (status === 400 && data && data.error) {
|
|
2547
|
+
if (status === 400 && data !== null && data !== void 0 && data.error) {
|
|
2542
2548
|
errorToDisplay = new Error("Validation error: ".concat(data.error));
|
|
2543
2549
|
} else if (status === 401) {
|
|
2544
2550
|
errorToDisplay = new Error("You are not authorized to perform this action");
|
|
@@ -2547,7 +2553,7 @@ function submitForm() {
|
|
|
2547
2553
|
} else if (status >= 500) {
|
|
2548
2554
|
errorToDisplay = new Error("Server error. Please try again later.");
|
|
2549
2555
|
} else {
|
|
2550
|
-
errorToDisplay = new Error(data
|
|
2556
|
+
errorToDisplay = new Error((data === null || data === void 0 ? void 0 : data.error) || "Request failed with status ".concat(status));
|
|
2551
2557
|
}
|
|
2552
2558
|
} else if (err.request) {
|
|
2553
2559
|
// Network error (no response received)
|
|
@@ -2566,9 +2572,12 @@ function submitForm() {
|
|
|
2566
2572
|
|
|
2567
2573
|
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2568
2574
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
const
|
|
2575
|
+
|
|
2576
|
+
// Wizard action types
|
|
2577
|
+
const REDUCER_PREFIX$2 = values.reducerKey.toUpperCase();
|
|
2578
|
+
const SET_NAVIGATION_STATE$1 = "".concat(REDUCER_PREFIX$2, "_SET_NAVIGATION_STATE");
|
|
2579
|
+
const UPDATE_STEP_VALIDATION$1 = "".concat(REDUCER_PREFIX$2, "_UPDATE_STEP_VALIDATION");
|
|
2580
|
+
const MARK_STEP_COMPLETE$1 = "".concat(REDUCER_PREFIX$2, "_MARK_STEP_COMPLETE");
|
|
2572
2581
|
const setCurrentStep = function (step) {
|
|
2573
2582
|
let previousStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
2574
2583
|
return {
|
|
@@ -2582,8 +2591,9 @@ const setCurrentStep = function (step) {
|
|
|
2582
2591
|
};
|
|
2583
2592
|
};
|
|
2584
2593
|
const goToStep = step => (dispatch, getState) => {
|
|
2594
|
+
var _state$wizard;
|
|
2585
2595
|
const state = getState()[values.reducerKey];
|
|
2586
|
-
const currentStep = state
|
|
2596
|
+
const currentStep = state === null || state === void 0 || (_state$wizard = state.wizard) === null || _state$wizard === void 0 || (_state$wizard = _state$wizard.navigation) === null || _state$wizard === void 0 ? void 0 : _state$wizard.currentStep;
|
|
2587
2597
|
|
|
2588
2598
|
// Clear form submission state when changing steps
|
|
2589
2599
|
dispatch(clearFormSubmissionState());
|
|
@@ -2672,9 +2682,10 @@ const getFormValidation = (form, step) => {
|
|
|
2672
2682
|
switch (step) {
|
|
2673
2683
|
case "overview":
|
|
2674
2684
|
{
|
|
2675
|
-
|
|
2676
|
-
const
|
|
2677
|
-
const
|
|
2685
|
+
var _form$title, _form$displayName, _form$icon;
|
|
2686
|
+
const hasTitle = ((_form$title = form.title) === null || _form$title === void 0 ? void 0 : _form$title.trim().length) > 0;
|
|
2687
|
+
const hasDisplayName = ((_form$displayName = form.displayName) === null || _form$displayName === void 0 ? void 0 : _form$displayName.trim().length) > 0;
|
|
2688
|
+
const hasIcon = ((_form$icon = form.icon) === null || _form$icon === void 0 ? void 0 : _form$icon.length) > 0;
|
|
2678
2689
|
return {
|
|
2679
2690
|
isValid: hasTitle && hasDisplayName && hasIcon,
|
|
2680
2691
|
errors: {
|
|
@@ -2686,8 +2697,9 @@ const getFormValidation = (form, step) => {
|
|
|
2686
2697
|
}
|
|
2687
2698
|
case "fields":
|
|
2688
2699
|
{
|
|
2689
|
-
|
|
2690
|
-
const
|
|
2700
|
+
var _form$fields, _form$fields2;
|
|
2701
|
+
const hasTitleField = (_form$fields = form.fields) === null || _form$fields === void 0 ? void 0 : _form$fields.some(field => field.id === "mandatory-title");
|
|
2702
|
+
const hasImageField = (_form$fields2 = form.fields) === null || _form$fields2 === void 0 ? void 0 : _form$fields2.some(field => field.id === "mandatory-feature-image");
|
|
2691
2703
|
|
|
2692
2704
|
// Check each field for missing labels and create field-specific errors
|
|
2693
2705
|
const fieldErrors = {};
|
|
@@ -2712,7 +2724,8 @@ const getFormValidation = (form, step) => {
|
|
|
2712
2724
|
}
|
|
2713
2725
|
case "layout":
|
|
2714
2726
|
{
|
|
2715
|
-
|
|
2727
|
+
var _form$layout;
|
|
2728
|
+
const hasLayoutType = ((_form$layout = form.layout) === null || _form$layout === void 0 || (_form$layout = _form$layout.type) === null || _form$layout === void 0 ? void 0 : _form$layout.length) > 0;
|
|
2716
2729
|
return {
|
|
2717
2730
|
isValid: hasLayoutType,
|
|
2718
2731
|
errors: {
|
|
@@ -2734,8 +2747,8 @@ const setCurrentStepAndSave = function (step) {
|
|
|
2734
2747
|
};
|
|
2735
2748
|
};
|
|
2736
2749
|
|
|
2737
|
-
var css$d = ".
|
|
2738
|
-
var modules_d5b6badf = {"fullWidthContent":"
|
|
2750
|
+
var css$d = ".SidebarLayout_module_fullWidthContent__0d6658dd {\n\tmax-width: 100%;\n\tmargin-left: auto;\n\tmargin-right: auto;\n\tpadding: 2rem 2rem 3rem 2rem; /* Add extra bottom padding */\n}\n\n/* Full-width container that allows scrollbar at edge */\n.SidebarLayout_module_fullWidthContainer__0d6658dd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1;\n\tmin-height: 0; /* Allow content to determine height */\n\twidth: 100%; /* Take full width to ensure scrollbar is at edge */\n}\n\n/* Content container to keep content centered */\n.SidebarLayout_module_contentContainer__0d6658dd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1;\n\tmin-height: 0;\n\tmax-width: 960px;\n\tmargin: 0 auto;\n\tpadding: 64px 32px;\n\twidth: 100%;\n\tbox-sizing: border-box;\n}\n\n/* Legacy container class for backward compatibility */\n.SidebarLayout_module_container__0d6658dd{\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1;\n\tmin-height: 0; /* Allow content to determine height */\n max-width: 960px;\n margin: 0 auto;\n padding: 64px 32px;\n}\n\n/* Responsive adjustments for content container */\n@media (max-width: 768px) {\n\t.SidebarLayout_module_contentContainer__0d6658dd {\n\t\tpadding: 1.5rem 1.5rem 2.5rem 1.5rem; /* Slightly reduced but still adequate */\n\t}\n\t.SidebarLayout_module_container__0d6658dd {\n\t\tpadding: 1.5rem 1.5rem 2.5rem 1.5rem; /* Legacy container support */\n\t}\n}\n\n@media (max-width: 480px) {\n\t.SidebarLayout_module_contentContainer__0d6658dd {\n\t\tpadding: 1rem 1rem 2rem 1rem; /* Maintain padding on small screens */\n\t}\n\t.SidebarLayout_module_container__0d6658dd {\n\t\tpadding: 1rem 1rem 2rem 1rem; /* Legacy container support */\n\t}\n}\n\n/* Enhanced sidebar navigation for progress indication */\n\n/* Enhanced progress section */\n.hub-sideBar-section {\n\tborder-bottom: 2px solid var(--colour-branding-main-fade, rgba(74, 87, 183, 0.15));\n\tpadding-bottom: 1rem;\n\tmargin-bottom: 1rem;\n}\n\n.hub-sideBar-section:last-child {\n\tborder-bottom: none;\n}\n";
|
|
2751
|
+
var modules_d5b6badf = {"fullWidthContent":"SidebarLayout_module_fullWidthContent__0d6658dd","fullWidthContainer":"SidebarLayout_module_fullWidthContainer__0d6658dd","contentContainer":"SidebarLayout_module_contentContainer__0d6658dd","container":"SidebarLayout_module_container__0d6658dd"};
|
|
2739
2752
|
n(css$d,{});
|
|
2740
2753
|
|
|
2741
2754
|
/**
|
|
@@ -2772,8 +2785,17 @@ const SideBarInner = props => {
|
|
|
2772
2785
|
|
|
2773
2786
|
// Define step configuration with dynamic URL based on mode
|
|
2774
2787
|
const getStepUrl = stepKey => {
|
|
2775
|
-
//
|
|
2776
|
-
|
|
2788
|
+
// Use routes from values.config to support different variants (-a, -b, -c, -d)
|
|
2789
|
+
switch (stepKey) {
|
|
2790
|
+
case "overview":
|
|
2791
|
+
return values.routeFormOverviewStep;
|
|
2792
|
+
case "fields":
|
|
2793
|
+
return values.routeFormFieldsStep;
|
|
2794
|
+
case "layout":
|
|
2795
|
+
return values.routeFormLayoutStep;
|
|
2796
|
+
default:
|
|
2797
|
+
return "";
|
|
2798
|
+
}
|
|
2777
2799
|
};
|
|
2778
2800
|
const steps = [{
|
|
2779
2801
|
key: "overview",
|
|
@@ -2794,6 +2816,7 @@ const SideBarInner = props => {
|
|
|
2794
2816
|
|
|
2795
2817
|
// Build sidebar items based on mode
|
|
2796
2818
|
const buildSidebarItems = () => {
|
|
2819
|
+
const isWizardMode = mode === "create" || mode === "edit";
|
|
2797
2820
|
return steps.map((step, index) => {
|
|
2798
2821
|
const isCompleted = selectIsStepComplete(step.key);
|
|
2799
2822
|
const isAccessible = selectIsStepAccessible(step.key);
|
|
@@ -2805,15 +2828,15 @@ const SideBarInner = props => {
|
|
|
2805
2828
|
text: stepText,
|
|
2806
2829
|
icon: step.icon,
|
|
2807
2830
|
selected: isSelected(step.url),
|
|
2808
|
-
onclick: isAccessible ? () => {
|
|
2831
|
+
onclick: isWizardMode ? null : isAccessible ? () => {
|
|
2809
2832
|
goTo(step.url);
|
|
2810
2833
|
dispatch(goToStep(step.key));
|
|
2811
2834
|
} : null,
|
|
2812
2835
|
isFontAwesome: true,
|
|
2813
2836
|
// Enhanced completion indicator
|
|
2814
2837
|
completed: isCompleted,
|
|
2815
|
-
//
|
|
2816
|
-
disabled: mode === "create" && !isAccessible
|
|
2838
|
+
// Disable all navigation in wizard mode
|
|
2839
|
+
disabled: isWizardMode || mode === "create" && !isAccessible
|
|
2817
2840
|
};
|
|
2818
2841
|
return itemProps;
|
|
2819
2842
|
});
|
|
@@ -2837,6 +2860,7 @@ const SideBarInner = props => {
|
|
|
2837
2860
|
|
|
2838
2861
|
// Add effect to manually attach click handlers since HubSidebar might not use onclick properly
|
|
2839
2862
|
React.useEffect(() => {
|
|
2863
|
+
const isWizardMode = mode === "create" || mode === "edit";
|
|
2840
2864
|
const attachClickHandlers = () => {
|
|
2841
2865
|
const stepsWithUrls = [{
|
|
2842
2866
|
key: "overview",
|
|
@@ -2848,8 +2872,8 @@ const SideBarInner = props => {
|
|
|
2848
2872
|
key: "layout",
|
|
2849
2873
|
url: getStepUrl("layout")
|
|
2850
2874
|
}];
|
|
2851
|
-
stepsWithUrls.forEach(step => {
|
|
2852
|
-
const navItem = Array.from(document.querySelectorAll(".sideNav-item")).find(item => item.textContent && item.textContent.includes(
|
|
2875
|
+
stepsWithUrls.forEach((step, index) => {
|
|
2876
|
+
const navItem = Array.from(document.querySelectorAll(".hub-wrapperContainer .sideNav-item")).find(item => item.textContent && item.textContent.includes("".concat(index + 1, ".")));
|
|
2853
2877
|
if (navItem) {
|
|
2854
2878
|
// Remove any existing click listeners
|
|
2855
2879
|
navItem.onclick = null;
|
|
@@ -2866,8 +2890,12 @@ const SideBarInner = props => {
|
|
|
2866
2890
|
}
|
|
2867
2891
|
});
|
|
2868
2892
|
|
|
2869
|
-
//
|
|
2870
|
-
|
|
2893
|
+
// Check if this is the current step (selected)
|
|
2894
|
+
const isCurrentStep = isSelected(step.url);
|
|
2895
|
+
|
|
2896
|
+
// In wizard mode, don't attach any click handlers
|
|
2897
|
+
// Only attach click handler if not in wizard mode AND accessible
|
|
2898
|
+
if (!isWizardMode && isAccessible) {
|
|
2871
2899
|
navItem.onclick = event => {
|
|
2872
2900
|
event.preventDefault();
|
|
2873
2901
|
event.stopPropagation();
|
|
@@ -2877,9 +2905,18 @@ const SideBarInner = props => {
|
|
|
2877
2905
|
}
|
|
2878
2906
|
|
|
2879
2907
|
// Make sure it's styled appropriately
|
|
2880
|
-
|
|
2881
|
-
navItem.style.pointerEvents = "auto";
|
|
2882
|
-
|
|
2908
|
+
// In wizard mode: block clicks, but keep current step visible
|
|
2909
|
+
navItem.style.pointerEvents = isWizardMode ? "none" : "auto";
|
|
2910
|
+
if (isWizardMode) {
|
|
2911
|
+
// Current step: full opacity, not-allowed cursor
|
|
2912
|
+
// Other steps: reduced opacity
|
|
2913
|
+
navItem.style.opacity = isCurrentStep ? "1" : "0.4";
|
|
2914
|
+
navItem.style.cursor = "not-allowed";
|
|
2915
|
+
} else {
|
|
2916
|
+
// Not in wizard mode: normal styling based on accessibility
|
|
2917
|
+
navItem.style.cursor = isAccessible ? "pointer" : "not-allowed";
|
|
2918
|
+
navItem.style.opacity = isAccessible ? "1" : "0.5";
|
|
2919
|
+
}
|
|
2883
2920
|
}
|
|
2884
2921
|
});
|
|
2885
2922
|
};
|
|
@@ -2923,8 +2960,8 @@ const SideBarInner = props => {
|
|
|
2923
2960
|
};
|
|
2924
2961
|
const SidebarLayout = reactRouter.withRouter(SideBarInner);
|
|
2925
2962
|
|
|
2926
|
-
var css$c = ".Form_module_content__dfb952c8 {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\tflex-flow: column nowrap;\n\tpadding: 2rem 0 3rem 0; /* Add proper top/bottom padding */\n\tmin-height: 100%; /* Ensure full height for proper spacing */\n}\n\n/* New page wrapper for centered container approach */\n.Form_module_pageWrapper__dfb952c8 {\n\tpadding: 2rem 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n}\n\n@media (min-width: 768px) {\n\t.Form_module_pageWrapper__dfb952c8 {\n\t\tpadding: 3rem 0;\n\t}\n}\n\n/* Form container styling when using CenteredContainer */\n.Form_module_formContainer__dfb952c8 {\n\tbackground-color: var(--bg-white);\n}\n\n/* Section styling */\n.Form_module_section__dfb952c8 {\n\tmargin-bottom: 2rem;\n\t\tpadding: 0 0 2em;\n}\n\n.Form_module_section_NoBorder__dfb952c8 {\n\t\tborder-bottom: none;\n}\n\n.Form_module_subtitle__dfb952c8 {\n\tcolor: var(--text-bluegrey, #6c7a90);\n}\n\n.Form_module_sectionHeader__dfb952c8 {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n}\n\n/* Add Field Button styling */\n.Form_module_addFieldButton__dfb952c8 {\n\tbackground: var(--colour-branding-action, #5c90df);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 1.5rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tcursor: pointer;\n\tmargin-bottom: 2rem;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_addFieldButton__dfb952c8:hover {\n\tbackground: var(--colour-branding-action-hover, #364196);\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 2px 4px rgba(92, 144, 223, 0.3);\n}\n\n.Form_module_addFieldButton__dfb952c8:focus {\n\toutline: 2px solid var(--colour-branding-action, #5c90df);\n\toutline-offset: 2px;\n}\n\n.Form_module_addFieldButton__dfb952c8:active {\n\ttransform: translateY(0);\n}\n\n/* Refresh button styling */\n.Form_module_refreshButton__dfb952c8 {\n\tmargin-left: 10px;\n\tpadding: 2px 8px;\n\tfont-size: 12px;\n\tbackground: var(--colour-dusk, #536280);\n\tcolor: white;\n\tborder: none;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\ttransition: background-color 0.2s ease;\n}\n\n.Form_module_refreshButton__dfb952c8:hover {\n\tbackground: var(--colour-dusk-hover, #485968);\n}\n\n/* Error message container */\n.Form_module_errorMessageContainer__dfb952c8 {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n/* Add Field Container - matches field structure */\n.Form_module_addFieldContainer__dfb952c8 {\n\tdisplay: flex;\n\tmargin-top: 32px;\n}\n\n.Form_module_fieldNumberContainer__dfb952c8 {\n\tdisplay: flex;\n\twidth: 40px;\n}\n\n/* Add Field Section */\n.Form_module_addFieldSection__dfb952c8 {\n\tdisplay: flex;\n\tgap: 1rem;\n\talign-items: center;\n\tjustify-content: flex-start; /* Align to start to match field content */\n\tmargin-top: 0; /* Remove top margin since it's in the container */\n}\n\n/* Desktop: horizontal layout for field selector and button */\n@media (min-width: 769px) {\n\t.Form_module_addFieldSection__dfb952c8 {\n\t\tflex-direction: row;\n\t\talign-items: baseline;\n\t\tgap: 2rem;\n\t\talign-items: flex-start;\n\t\tjustify-content: flex-start; /* Align to start to match field content */\n\t}\n}\n\n/* Help Section for Popup */\n.Form_module_helpSection__dfb952c8 {\n\tbackground-color: var(--colour-branding-action-superlight);\n\tborder: 1px solid var(--colour-branding-inactive);\n\tborder-radius: 8px;\n\tpadding: 1.5rem;\n\tmargin-bottom: 1.5rem;\n}\n\n.Form_module_helpTitle__dfb952c8 {\n\tcolor: var(--text-dark);\n\tfont-weight: 600;\n\tmargin-bottom: 0.75rem;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n\tfont-size: 1.25rem;\n}\n\n.Form_module_helpText__dfb952c8 {\n\tcolor: var(--colour-branding-action);\n\tline-height: 1.6;\n\tfont-size: 1.25rem;\n}\n\n/* Field Type Cards for Popup */\n.Form_module_fieldTypeCards__dfb952c8 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 1rem; /* Spacing between vertical cards */\n\tpadding: 1rem 0;\n}\n\n/* Responsive layout: maintain vertical layout on all screen sizes */\n@media (min-width: 768px) {\n\t.Form_module_fieldTypeCards__dfb952c8 {\n\t\tgap: 1.5rem; /* Slightly larger gap on desktop */\n\t}\n}\n\n.Form_module_fieldTypeCard__dfb952c8 {\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: flex-start;\n\tpadding: 1.75rem 1.25rem; /* More vertical padding */\n\tborder: 1px solid var(--border-line-grey);\n\tborder-radius: 8px;\n\tbackground-color: var(--bg-white);\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n\tmin-height: 120px; /* Adjust height for horizontal layout */\n\tgap: 1rem; /* Space between icon and content */\n}\n\n.Form_module_fieldTypeCard__dfb952c8:hover {\n\tborder-color: var(--text-light);\n\tbackground-color: var(--bg-bluegrey);\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n}\n\n.Form_module_fieldTypeCard__dfb952c8:focus {\n\toutline: 2px solid var(--text-light);\n\toutline-offset: 2px;\n}\n\n.Form_module_fieldTypeCard__dfb952c8:active {\n\ttransform: scale(0.98);\n\ttransition: transform 0.1s ease;\n}\n\n.Form_module_fieldTypeCardIcon__dfb952c8 {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 48px;\n\theight: 48px;\n\tmargin-bottom: 0; /* Remove bottom margin for horizontal layout */\n\tfont-size: 20px;\n\tflex-shrink: 0;\n\tborder: 1px solid var(--border-line-grey); /* Subtle border */\n\tborder-radius: 8px;\n\tbackground-color: var(--bg-bluegrey);\n\tpadding: 8px;\n}\n\n\n.Form_module_fieldTypeCardContent__dfb952c8 {\n\tflex: 1;\n\twidth: 100%;\n\tmin-width: 0; /* Prevent content from overflowing */\n}\n\n.Form_module_fieldTypeCardTitle__dfb952c8 {\n\tmargin: 0 0 0.25rem 0;\n\tfont-weight: 600;\n\tfont-size: 1.4rem; /* Increased for better readability */\n}\n\n.Form_module_fieldTypeCardDescription__dfb952c8 {\n\tmargin: 0 0 0.75rem 0;\n\tfont-size: 1.6rem; /* Increased for better readability */\n\tline-height: 1.5; /* Improved line height for better readability */\n}\n\n.Form_module_fieldTypeCardUseCase__dfb952c8 {\n\tmargin: 0;\n\tfont-size: 1.4rem;\n\tfont-style: italic;\n\tcolor: var(--text-light);\n\tpadding-top: 0.5rem;\n\tborder-top: 1px solid var(--border-line-grey);\n}\n\n/* Field selector and button container - horizontal layout */\n.Form_module_addFieldSection__dfb952c8> div:first-child {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0.5rem;\n\tflex: 1;\n}\n\n/* Container for add field button alignment */\n.Form_module_addFieldButtonContainer__dfb952c8 {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n}\n\n/* Empty State */\n.Form_module_emptyState__dfb952c8 {\n\tpadding: 2rem;\n\ttext-align: center;\n\tbackground-color: var(--bg-bluegrey, #f4f7f9);\n\tborder-radius: 8px;\n\tborder: 1px dashed var(--border-line-grey, #dbddf1);\n\tmargin-bottom: 1rem;\n}\n\n.Form_module_emptyStateText__dfb952c8 {\n\tcolor: var(--text-bluegrey, #6c7a90);\n\tfont-style: italic;\n}\n\n.Form_module_fieldTypeSelector__dfb952c8 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmax-width: 500px; /* Increased from 300px to accommodate longer text */\n\twidth: 100%;\n}\n\n@media (max-width: 768px) {\n\t.Form_module_addFieldSection__dfb952c8 {\n\t\talign-items: stretch;\n\t}\n\t\n\t.Form_module_fieldTypeSelector__dfb952c8 {\n\t\tmax-width: none;\n\t}\n}\n\n.Form_module_grid__four__dfb952c8 {\n max-width: 1200px;\n\tdisplay: grid;\n\tgrid-template-columns: repeat(2, minmax(250px, 1fr));\n margin: 2rem 0;\n\tgap: 2rem;\n\tjustify-items: center;\n}\n\n@media (max-width: 768px) {\n\t.Form_module_grid__four__dfb952c8 {\n\t\tgrid-template-columns: 1fr;\n\t\tgap: 2rem;\n\t}\n}\n\n/* Navigation styles */\n.Form_module_navigation__dfb952c8 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 1rem;\n\tmargin-top: 3rem; /* Increase from 2rem */\n\tpadding-top: 2rem;\n\tpadding-bottom: 2rem; /* Add bottom padding */\n\tborder-top: 1px solid #e9ecef;\n}\n\n/* Single button alignment - align to right for overview step save button */\n.Form_module_navigation__dfb952c8> :only-child {\n\tmargin-left: auto;\n\tmargin-right: 0;\n}\n\n/* Two button alignment - one left, one right */\n.Form_module_navigation__dfb952c8> :first-child:not(:only-child) {\n\tmargin-right: auto;\n}\n\n.Form_module_navigation__dfb952c8> :last-child:not(:only-child) {\n\tmargin-left: auto;\n}\n\n/* Special case for overview step - align save button to right */\n.Form_module_overviewStep__dfb952c8 .Form_module_navigation__dfb952c8> :only-child {\n\tmargin-left: auto;\n\tmargin-right: 0;\n}\n\n.Form_module_previousButton__dfb952c8 {\n\tbackground: #6c757d;\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 1.5rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_previousButton__dfb952c8:hover {\n\tbackground: #5a6268;\n}\n\n.Form_module_saveButton__dfb952c8 {\n\tbackground: var(--colour-purple, #6e79c5);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 2rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tfont-weight: 500;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_saveButton__dfb952c8:hover:not(:disabled) {\n\tbackground: var(--colour-purple-hover, #5a66b3);\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 2px 4px rgba(110, 121, 197, 0.3);\n}\n\n.Form_module_saveButton__dfb952c8:focus {\n\toutline: 2px solid var(--colour-purple, #6e79c5);\n\toutline-offset: 2px;\n}\n\n.Form_module_saveButton__dfb952c8:disabled {\n\tbackground: #6c757d;\n\tcursor: not-allowed;\n\topacity: 0.65;\n\ttransform: none;\n\tbox-shadow: none;\n}\n\n.Form_module_nextButton__dfb952c8 {\n\tbackground: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 2rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tfont-weight: 500;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_nextButton__dfb952c8:hover:not(:disabled) {\n\ttransform: translateY(-2px);\n\tbox-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n}\n\n.Form_module_nextButton__dfb952c8:disabled {\n\tbackground: #6c757d;\n\tcursor: not-allowed;\n\topacity: 0.65;\n\ttransform: none;\n\tbox-shadow: none;\n}\n\n\n\n.Form_module_errorMessage__dfb952c8 {\n\tcolor: var(--colour-red);\n\tmargin: 0.25rem 0;\n\tpadding: 0.25rem 0;\n\tfont-size: 0.875rem;\n\tline-height: 1.4;\n}\n\n/* Layout option styles */\n.Form_module_layoutOption__dfb952c8 {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\tbackground-color: transparent;\n}\n\n.Form_module_layoutOptionImage__dfb952c8 {\n\twidth: 250px;\n\theight: 250px;\n\tborder-radius: 12px;\n\toverflow: hidden;\n\tmargin-bottom: 1rem;\n\tborder: 2px solid var(--border-line-grey, #dbddf1);\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_layoutOption__dfb952c8.Form_module_selected__dfb952c8 .Form_module_layoutOptionImage__dfb952c8 {\n\tborder-color: var(--border-line-grey, #dbddf1);\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n}\n\n.Form_module_layoutOptionImg__dfb952c8 {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n}\n\n.Form_module_layoutOptionContent__dfb952c8 {\n\tmax-width: 250px;\n}\n\n.Form_module_layoutOptionTitle__dfb952c8 {\n\tfont-size: 1.6rem;\n\tfont-weight: 600;\n\tmargin: 0 0 0.5rem 0;\n\tline-height: 1.3;\n\tcolor: #333;\n}\n\n.Form_module_layoutOptionDescription__dfb952c8 {\n\tfont-size: 1.2rem;\n\tmargin: 0;\n\tline-height: 1.3;\n\tcolor: #6c757d;\n}\n\n.Form_module_layoutOption__dfb952c8.Form_module_hasError__dfb952c8 .Form_module_layoutOptionImage__dfb952c8 {\n\tborder-color: var(--colour-red, #dc3545);\n}\n\n/* Field error styles */\n.Form_module_fieldError__dfb952c8 {\n\tcolor: #dc3545;\n\tfont-size: 1.6rem;\n\tfont-weight: 500;\n\tmargin-top: 0.5rem;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.25rem;\n}\n\n.Form_module_errorIcon__dfb952c8 {\n\tfont-size: 1rem;\n}\n\n/* Field wrapper styles are now handled in Fields.module.css */\n\n/* Field type indicator styles are now handled in Fields.module.css */\n\n@keyframes Form_module_errorShake__dfb952c8 {\n\t0%, 100% { transform: translateX(0); }\n\t25% { transform: translateX(-3px); }\n\t75% { transform: translateX(3px); }\n}\n\n@keyframes Form_module_errorPulse__dfb952c8 {\n\t0% { \n\t\tbox-shadow: 0 1px 3px rgba(192, 39, 67, 0.1), 0 1px 2px rgba(192, 39, 67, 0.08);\n\t}\n\t50% { \n\t\tbox-shadow: 0 2px 6px rgba(192, 39, 67, 0.2), 0 1px 3px rgba(192, 39, 67, 0.15);\n\t}\n\t100% { \n\t\tbox-shadow: 0 1px 3px rgba(192, 39, 67, 0.1), 0 1px 2px rgba(192, 39, 67, 0.08);\n\t}\n}\n\n.Form_module_successMessage__dfb952c8 {\n\tbackground: var(--colour-branding-secondary-light);\n\tborder: 1px solid var(--colour-branding-secondary);\n\tborder-radius: 8px;\n\tpadding: 1rem;\n\tmargin-top: 1rem;\n\tcolor: var(--colour-green);\n\tfont-weight: 500;\n}\n\n/* Mode-aware styling */\n.Form_module_createMode__dfb952c8 {\n\tcolor: var(--colour-purple, #6e79c5);\n}\n\n.Form_module_editMode__dfb952c8 {\n\tcolor: var(--colour-branding-dark, #364196);\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n\t.Form_module_content__dfb952c8 {\n\t\tpadding: 1.5rem 0 2.5rem 0; /* Maintain proper padding on mobile */\n\t}\n\t\n\t.Form_module_section__dfb952c8 {\n\t\tmargin-bottom: 1.5rem;\n\t}\n\t\n\t/* Mobile: vertical layout for field selector and button */\n\t.Form_module_addFieldSection__dfb952c8 {\n\t\tflex-direction: column;\n\t\talign-items: stretch; /* Stretch to fill available space */\n\t}\n\t\n\t/* Button should not be full width on mobile */\n\t.Form_module_addFieldSection__dfb952c8 Button {\n\t\twidth: auto; /* Let button use its natural width */\n\t\tpadding: 1rem 1.5rem; /* Keep proper padding but not full width */\n\t}\n\t\n\t.Form_module_addFieldButtonContainer__dfb952c8 {\n\t\talign-items: stretch;\n\t\tjustify-content: stretch;\n\t\tmin-height: auto;\n\t}\n\t\n\t.Form_module_navigation__dfb952c8 {\n\t\tflex-direction: column;\n\t\tgap: 0.75rem;\n\t\tjustify-content: flex-start; /* Align to start on mobile */\n\t\tmargin-top: 2rem; /* Slightly reduce on mobile */\n\t\tpadding-top: 1.5rem;\n\t\tpadding-bottom: 1.5rem; /* Maintain bottom padding */\n\t}\n\t\n\t/* Mobile button alignment - single button aligns right, two buttons stack */\n\t.Form_module_navigation__dfb952c8> :only-child {\n\t\tmargin-left: auto;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_navigation__dfb952c8> :first-child:not(:only-child),\n\t.Form_module_navigation__dfb952c8> :last-child:not(:only-child) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_previousButton__dfb952c8,\n\t.Form_module_nextButton__dfb952c8,\n\t.Form_module_saveButton__dfb952c8 {\n\t\twidth: 100%;\n\t\tpadding: 1rem;\n\t}\n}\n\n@media (max-width: 480px) {\n\t.Form_module_content__dfb952c8 {\n\t\tpadding: 1rem 0 2rem 0; /* Still maintain padding on small screens */\n\t}\n\t\n\t.Form_module_section__dfb952c8 {\n\t\tmargin-bottom: 1rem;\n\t}\n\t\n\t.Form_module_navigation__dfb952c8 {\n\t\tmargin-top: 1.5rem; /* Further reduce on very small screens */\n\t\tpadding-top: 1rem;\n\t\tpadding-bottom: 1.5rem;\n\t\tjustify-content: flex-start; /* Align to start on small screens */\n\t}\n\t\n\t/* Small screen button alignment */\n\t.Form_module_navigation__dfb952c8> :only-child {\n\t\tmargin-left: auto;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_navigation__dfb952c8> :first-child:not(:only-child),\n\t.Form_module_navigation__dfb952c8> :last-child:not(:only-child) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_errorMessageContainer__dfb952c8 {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 0.75rem;\n\t}\n\t\n\t.Form_module_refreshButton__dfb952c8 {\n\t\talign-self: flex-end;\n\t}\n}\n\n/* Full width content when sidebar is hidden */\n.hub-contentWrapper.fullWidthContent {\n\tmax-width: 1000px;\n\tmargin: 0 auto;\n\tpadding: 2rem;\n}\n\n.Form_module_hubContentWrapper_Col__dfb952c8 {\n flex-flow: column;\n}\n\n/* Validation error message - displayed at top of form */\n.Form_module_validationErrorMessage__dfb952c8 {\n\tbackground-color: var(--colour-branding-secondary-light);\n\tborder: 1px solid var(--colour-branding-secondary);\n\tborder-radius: 6px;\n\tcolor: var(--colour-red);\n\tpadding: 12px 16px;\n\tfont-weight: 500;\n\tfont-size: 14px;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\t\tmargin: 24px 32px;\n}\n\n.Form_module_validationErrorMessage__dfb952c8::before {\n\tcontent: \"⚠\";\n\tfont-size: 16px;\n\tcolor: var(--colour-red);\n}\n\n/* Loading overlay for forms - deprecated, use SkeletonLoader instead */\n/*\n.loadingOverlay {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tbackground: rgba(255, 255, 255, 0.95);\n\tbackdrop-filter: blur(2px);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tz-index: 10;\n\tborder-radius: 8px;\n\tanimation: fadeIn 0.2s ease-in-out;\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n*/\n\n/* Form header with buttons */\n.Form_module_formHeader__dfb952c8 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tmargin-bottom: 16px;\n}\n\n/* Loading container for fields */\n.Form_module_fieldsLoadingContainer__dfb952c8 {\n\ttext-align: center;\n\tpadding: 60px 20px;\n}\n\n/* Help note styling */\n.Form_module_helpNote__dfb952c8 {\n\tfont-size: 13px;\n\tcolor: #6c757d;\n}\n\n/* Loading container for overview */\n.Form_module_overviewLoadingContainer__dfb952c8 {\n\ttext-align: center;\n\tpadding: 60px 20px;\n}\n\n/* Form layout header */\n.Form_module_formLayoutHeader__dfb952c8 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tmargin-bottom: 16px;\n}\n\n/* Section margins */\n.Form_module_gridIconSection__dfb952c8 {\n\tmargin-bottom: 3rem;\n}\n\n.Form_module_layoutSection__dfb952c8 {\n\tmargin-bottom: 2rem;\n}\n\n/* Grid icon loading state */\n.Form_module_gridIconLoading__dfb952c8 {\n\tgrid-column: 1 / -1;\n}\n\n/* Hide upload button in grid icon section */\n.Form_module_gridIconSection__dfb952c8 .iconLoader__buttonOverlay button:first-child {\n\tdisplay: none !important;\n}\n";
|
|
2927
|
-
var modules_cd65a764 = {"content":"
|
|
2963
|
+
var css$c = ".Form_module_content__d62303b4 {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\tflex-flow: column nowrap;\n\tpadding: 2rem 0 3rem 0; /* Add proper top/bottom padding */\n\tmin-height: 100%; /* Ensure full height for proper spacing */\n}\n\n/* New page wrapper for centered container approach */\n.Form_module_pageWrapper__d62303b4 {\n\tpadding: 2rem 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n}\n\n@media (min-width: 768px) {\n\t.Form_module_pageWrapper__d62303b4 {\n\t\tpadding: 3rem 0;\n\t}\n}\n\n/* Form container styling when using CenteredContainer */\n.Form_module_formContainer__d62303b4 {\n\tbackground-color: var(--bg-white);\n}\n\n/* Section styling */\n.Form_module_section__d62303b4 {\n\tmargin-bottom: 2rem;\n\t\tpadding: 0 0 2em;\n}\n\n.Form_module_section_NoBorder__d62303b4 {\n\t\tborder-bottom: none;\n}\n\n.Form_module_subtitle__d62303b4 {\n\tcolor: var(--text-bluegrey, #6c7a90);\n}\n\n.Form_module_sectionHeader__d62303b4 {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n}\n\n/* Add Field Button styling */\n.Form_module_addFieldButton__d62303b4 {\n\tbackground: var(--colour-branding-action, #5c90df);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 1.5rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tcursor: pointer;\n\tmargin-bottom: 2rem;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_addFieldButton__d62303b4:hover {\n\tbackground: var(--colour-branding-action-hover, #364196);\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 2px 4px rgba(92, 144, 223, 0.3);\n}\n\n.Form_module_addFieldButton__d62303b4:focus {\n\toutline: 2px solid var(--colour-branding-action, #5c90df);\n\toutline-offset: 2px;\n}\n\n.Form_module_addFieldButton__d62303b4:active {\n\ttransform: translateY(0);\n}\n\n/* Refresh button styling */\n.Form_module_refreshButton__d62303b4 {\n\tmargin-left: 10px;\n\tpadding: 2px 8px;\n\tfont-size: 12px;\n\tbackground: var(--colour-dusk, #536280);\n\tcolor: white;\n\tborder: none;\n\tborder-radius: 4px;\n\tcursor: pointer;\n\ttransition: background-color 0.2s ease;\n}\n\n.Form_module_refreshButton__d62303b4:hover {\n\tbackground: var(--colour-dusk-hover, #485968);\n}\n\n/* Error message container */\n.Form_module_errorMessageContainer__d62303b4 {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n/* Add Field Container - matches field structure */\n.Form_module_addFieldContainer__d62303b4 {\n\tdisplay: flex;\n\tmargin-top: 32px;\n}\n\n.Form_module_fieldNumberContainer__d62303b4 {\n\tdisplay: flex;\n\twidth: 40px;\n}\n\n/* Add Field Section */\n.Form_module_addFieldSection__d62303b4 {\n\tdisplay: flex;\n\tgap: 1rem;\n\talign-items: center;\n\tjustify-content: flex-start; /* Align to start to match field content */\n\tmargin-top: 0; /* Remove top margin since it's in the container */\n}\n\n/* Desktop: horizontal layout for field selector and button */\n@media (min-width: 769px) {\n\t.Form_module_addFieldSection__d62303b4 {\n\t\tflex-direction: row;\n\t\talign-items: baseline;\n\t\tgap: 2rem;\n\t\talign-items: flex-start;\n\t\tjustify-content: flex-start; /* Align to start to match field content */\n\t}\n}\n\n/* Help Section for Popup */\n.Form_module_helpSection__d62303b4 {\n\tbackground-color: var(--colour-branding-action-superlight);\n\tborder: 1px solid var(--colour-branding-inactive);\n\tborder-radius: 8px;\n\tpadding: 1.5rem;\n\tmargin-bottom: 1.5rem;\n}\n\n.Form_module_helpTitle__d62303b4 {\n\tcolor: var(--text-dark);\n\tfont-weight: 600;\n\tmargin-bottom: 0.75rem;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n\tfont-size: 1.25rem;\n}\n\n.Form_module_helpText__d62303b4 {\n\tcolor: var(--colour-branding-action);\n\tline-height: 1.6;\n\tfont-size: 1.25rem;\n}\n\n/* Field Type Cards for Popup */\n.Form_module_fieldTypeCards__d62303b4 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 1rem; /* Spacing between vertical cards */\n\tpadding: 1rem 0;\n}\n\n/* Responsive layout: maintain vertical layout on all screen sizes */\n@media (min-width: 768px) {\n\t.Form_module_fieldTypeCards__d62303b4 {\n\t\tgap: 1.5rem; /* Slightly larger gap on desktop */\n\t}\n}\n\n.Form_module_fieldTypeCard__d62303b4 {\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: flex-start;\n\tpadding: 1.75rem 1.25rem; /* More vertical padding */\n\tborder: 1px solid var(--border-line-grey);\n\tborder-radius: 8px;\n\tbackground-color: var(--bg-white);\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n\tmin-height: 120px; /* Adjust height for horizontal layout */\n\tgap: 1rem; /* Space between icon and content */\n}\n\n.Form_module_fieldTypeCard__d62303b4:hover {\n\tborder-color: var(--text-light);\n\tbackground-color: var(--bg-bluegrey);\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n}\n\n.Form_module_fieldTypeCard__d62303b4:focus {\n\toutline: 2px solid var(--text-light);\n\toutline-offset: 2px;\n}\n\n.Form_module_fieldTypeCard__d62303b4:active {\n\ttransform: scale(0.98);\n\ttransition: transform 0.1s ease;\n}\n\n.Form_module_fieldTypeCardIcon__d62303b4 {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 48px;\n\theight: 48px;\n\tmargin-bottom: 0; /* Remove bottom margin for horizontal layout */\n\tfont-size: 20px;\n\tflex-shrink: 0;\n\tborder: 1px solid var(--border-line-grey); /* Subtle border */\n\tborder-radius: 8px;\n\tbackground-color: var(--bg-bluegrey);\n\tpadding: 8px;\n}\n\n\n.Form_module_fieldTypeCardContent__d62303b4 {\n\tflex: 1;\n\twidth: 100%;\n\tmin-width: 0; /* Prevent content from overflowing */\n}\n\n.Form_module_fieldTypeCardTitle__d62303b4 {\n\tmargin: 0 0 0.25rem 0;\n\tfont-weight: 600;\n\tfont-size: 1.4rem; /* Increased for better readability */\n}\n\n.Form_module_fieldTypeCardDescription__d62303b4 {\n\tmargin: 0 0 0.75rem 0;\n\tfont-size: 1.6rem; /* Increased for better readability */\n\tline-height: 1.5; /* Improved line height for better readability */\n}\n\n.Form_module_fieldTypeCardUseCase__d62303b4 {\n\tmargin: 0;\n\tfont-size: 1.4rem;\n\tfont-style: italic;\n\tcolor: var(--text-light);\n\tpadding-top: 0.5rem;\n\tborder-top: 1px solid var(--border-line-grey);\n}\n\n/* Field selector and button container - horizontal layout */\n.Form_module_addFieldSection__d62303b4> div:first-child {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0.5rem;\n\tflex: 1;\n}\n\n/* Container for add field button alignment */\n.Form_module_addFieldButtonContainer__d62303b4 {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n}\n\n/* Empty State */\n.Form_module_emptyState__d62303b4 {\n\tpadding: 2rem;\n\ttext-align: center;\n\tbackground-color: var(--bg-bluegrey, #f4f7f9);\n\tborder-radius: 8px;\n\tborder: 1px dashed var(--border-line-grey, #dbddf1);\n\tmargin-bottom: 1rem;\n}\n\n.Form_module_emptyStateText__d62303b4 {\n\tcolor: var(--text-bluegrey, #6c7a90);\n\tfont-style: italic;\n}\n\n.Form_module_fieldTypeSelector__d62303b4 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmax-width: 500px; /* Increased from 300px to accommodate longer text */\n\twidth: 100%;\n}\n\n@media (max-width: 768px) {\n\t.Form_module_addFieldSection__d62303b4 {\n\t\talign-items: stretch;\n\t}\n\t\n\t.Form_module_fieldTypeSelector__d62303b4 {\n\t\tmax-width: none;\n\t}\n}\n\n.Form_module_grid__four__d62303b4 {\n max-width: 1200px;\n\tdisplay: grid;\n\tgrid-template-columns: repeat(2, minmax(250px, 1fr));\n margin: 2rem 0;\n\tgap: 2rem;\n\tjustify-items: center;\n}\n\n@media (max-width: 768px) {\n\t.Form_module_grid__four__d62303b4 {\n\t\tgrid-template-columns: 1fr;\n\t\tgap: 2rem;\n\t}\n}\n\n/* Navigation styles */\n.Form_module_navigation__d62303b4 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 1rem;\n\tmargin-top: 3rem; /* Increase from 2rem */\n\tpadding-top: 2rem;\n\tpadding-bottom: 2rem; /* Add bottom padding */\n\tborder-top: 1px solid #e9ecef;\n}\n\n/* Single button alignment - align to right for overview step save button */\n.Form_module_navigation__d62303b4> :only-child {\n\tmargin-left: auto;\n\tmargin-right: 0;\n}\n\n/* Two button alignment - one left, one right */\n.Form_module_navigation__d62303b4> :first-child:not(:only-child) {\n\tmargin-right: auto;\n}\n\n.Form_module_navigation__d62303b4> :last-child:not(:only-child) {\n\tmargin-left: auto;\n}\n\n/* Special case for overview step - align save button to right */\n.Form_module_overviewStep__d62303b4 .Form_module_navigation__d62303b4> :only-child {\n\tmargin-left: auto;\n\tmargin-right: 0;\n}\n\n.Form_module_previousButton__d62303b4 {\n\tbackground: #6c757d;\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 1.5rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_previousButton__d62303b4:hover {\n\tbackground: #5a6268;\n}\n\n.Form_module_saveButton__d62303b4 {\n\tbackground: var(--colour-purple, #6e79c5);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 2rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tfont-weight: 500;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_saveButton__d62303b4:hover:not(:disabled) {\n\tbackground: var(--colour-purple-hover, #5a66b3);\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 2px 4px rgba(110, 121, 197, 0.3);\n}\n\n.Form_module_saveButton__d62303b4:focus {\n\toutline: 2px solid var(--colour-purple, #6e79c5);\n\toutline-offset: 2px;\n}\n\n.Form_module_saveButton__d62303b4:disabled {\n\tbackground: #6c757d;\n\tcursor: not-allowed;\n\topacity: 0.65;\n\ttransform: none;\n\tbox-shadow: none;\n}\n\n.Form_module_nextButton__d62303b4 {\n\tbackground: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n\tcolor: white;\n\tborder: none;\n\tpadding: 0.75rem 2rem;\n\tborder-radius: 6px;\n\tfont-size: 1rem;\n\tfont-weight: 500;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_nextButton__d62303b4:hover:not(:disabled) {\n\ttransform: translateY(-2px);\n\tbox-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n}\n\n.Form_module_nextButton__d62303b4:disabled {\n\tbackground: #6c757d;\n\tcursor: not-allowed;\n\topacity: 0.65;\n\ttransform: none;\n\tbox-shadow: none;\n}\n\n\n\n.Form_module_errorMessage__d62303b4 {\n\tcolor: var(--colour-red);\n\tmargin: 0.25rem 0;\n\tpadding: 0.25rem 0;\n\tfont-size: 0.875rem;\n\tline-height: 1.4;\n}\n\n/* Layout option styles */\n.Form_module_layoutOption__d62303b4 {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\ttext-align: center;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\tbackground-color: transparent;\n\topacity: 0.6;\n}\n\n.Form_module_layoutOption__d62303b4:hover {\n\topacity: 1;\n}\n\n.Form_module_layoutOptionImage__d62303b4 {\n\twidth: 250px;\n\theight: 250px;\n\tborder-radius: 12px;\n\toverflow: hidden;\n\tmargin-bottom: 1rem;\n\tborder: 2px solid var(--border-line-grey, #dbddf1);\n\ttransition: all 0.2s ease;\n}\n\n.Form_module_layoutOption__d62303b4.Form_module_selected__d62303b4 .Form_module_layoutOptionImage__d62303b4 {\n\tborder-color: var(--colour-purple, #6e79c5);\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n}\n\n.Form_module_layoutOption__d62303b4.Form_module_selected__d62303b4 {\n\topacity: 1;\n}\n\n.Form_module_layoutOptionImg__d62303b4 {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n}\n\n.Form_module_layoutOptionContent__d62303b4 {\n\tmax-width: 250px;\n\tmargin-bottom: 0.5rem;\n}\n\n.Form_module_layoutOptionTitle__d62303b4 {\n\tfont-size: 1.6rem;\n\tfont-weight: 600;\n\tmargin: 0 0 0.5rem 0;\n\tline-height: 1.3;\n\tcolor: #333;\n}\n\n.Form_module_layoutOptionDescription__d62303b4 {\n\tfont-size: 1.2rem;\n\tmargin: 0;\n\tline-height: 1.3;\n\tcolor: #6c757d;\n}\n\n.Form_module_layoutOption__d62303b4.Form_module_hasError__d62303b4 .Form_module_layoutOptionImage__d62303b4 {\n\tborder-color: var(--colour-red, #dc3545);\n}\n\n/* Field error styles */\n.Form_module_fieldError__d62303b4 {\n\tcolor: #dc3545;\n\tfont-size: 1.6rem;\n\tfont-weight: 500;\n\tmargin-top: 0.5rem;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.25rem;\n}\n\n.Form_module_errorIcon__d62303b4 {\n\tfont-size: 1rem;\n}\n\n/* Field wrapper styles are now handled in Fields.module.css */\n\n/* Field type indicator styles are now handled in Fields.module.css */\n\n@keyframes Form_module_errorShake__d62303b4 {\n\t0%, 100% { transform: translateX(0); }\n\t25% { transform: translateX(-3px); }\n\t75% { transform: translateX(3px); }\n}\n\n@keyframes Form_module_errorPulse__d62303b4 {\n\t0% { \n\t\tbox-shadow: 0 1px 3px rgba(192, 39, 67, 0.1), 0 1px 2px rgba(192, 39, 67, 0.08);\n\t}\n\t50% { \n\t\tbox-shadow: 0 2px 6px rgba(192, 39, 67, 0.2), 0 1px 3px rgba(192, 39, 67, 0.15);\n\t}\n\t100% { \n\t\tbox-shadow: 0 1px 3px rgba(192, 39, 67, 0.1), 0 1px 2px rgba(192, 39, 67, 0.08);\n\t}\n}\n\n.Form_module_successMessage__d62303b4 {\n\tbackground: var(--colour-branding-secondary-light);\n\tborder: 1px solid var(--colour-branding-secondary);\n\tborder-radius: 8px;\n\tpadding: 1rem;\n\tmargin-top: 1rem;\n\tcolor: var(--colour-green);\n\tfont-weight: 500;\n}\n\n/* Mode-aware styling */\n.Form_module_createMode__d62303b4 {\n\tcolor: var(--colour-purple, #6e79c5);\n}\n\n.Form_module_editMode__d62303b4 {\n\tcolor: var(--colour-branding-dark, #364196);\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n\t.Form_module_content__d62303b4 {\n\t\tpadding: 1.5rem 0 2.5rem 0; /* Maintain proper padding on mobile */\n\t}\n\t\n\t.Form_module_section__d62303b4 {\n\t\tmargin-bottom: 1.5rem;\n\t}\n\t\n\t/* Mobile: vertical layout for field selector and button */\n\t.Form_module_addFieldSection__d62303b4 {\n\t\tflex-direction: column;\n\t\talign-items: stretch; /* Stretch to fill available space */\n\t}\n\t\n\t/* Button should not be full width on mobile */\n\t.Form_module_addFieldSection__d62303b4 Button {\n\t\twidth: auto; /* Let button use its natural width */\n\t\tpadding: 1rem 1.5rem; /* Keep proper padding but not full width */\n\t}\n\t\n\t.Form_module_addFieldButtonContainer__d62303b4 {\n\t\talign-items: stretch;\n\t\tjustify-content: stretch;\n\t\tmin-height: auto;\n\t}\n\t\n\t.Form_module_navigation__d62303b4 {\n\t\tflex-direction: column;\n\t\tgap: 0.75rem;\n\t\tjustify-content: flex-start; /* Align to start on mobile */\n\t\tmargin-top: 2rem; /* Slightly reduce on mobile */\n\t\tpadding-top: 1.5rem;\n\t\tpadding-bottom: 1.5rem; /* Maintain bottom padding */\n\t}\n\t\n\t/* Mobile button alignment - single button aligns right, two buttons stack */\n\t.Form_module_navigation__d62303b4> :only-child {\n\t\tmargin-left: auto;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_navigation__d62303b4> :first-child:not(:only-child),\n\t.Form_module_navigation__d62303b4> :last-child:not(:only-child) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_previousButton__d62303b4,\n\t.Form_module_nextButton__d62303b4,\n\t.Form_module_saveButton__d62303b4 {\n\t\twidth: 100%;\n\t\tpadding: 1rem;\n\t}\n}\n\n@media (max-width: 480px) {\n\t.Form_module_content__d62303b4 {\n\t\tpadding: 1rem 0 2rem 0; /* Still maintain padding on small screens */\n\t}\n\t\n\t.Form_module_section__d62303b4 {\n\t\tmargin-bottom: 1rem;\n\t}\n\t\n\t.Form_module_navigation__d62303b4 {\n\t\tmargin-top: 1.5rem; /* Further reduce on very small screens */\n\t\tpadding-top: 1rem;\n\t\tpadding-bottom: 1.5rem;\n\t\tjustify-content: flex-start; /* Align to start on small screens */\n\t}\n\t\n\t/* Small screen button alignment */\n\t.Form_module_navigation__d62303b4> :only-child {\n\t\tmargin-left: auto;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_navigation__d62303b4> :first-child:not(:only-child),\n\t.Form_module_navigation__d62303b4> :last-child:not(:only-child) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\t\n\t.Form_module_errorMessageContainer__d62303b4 {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 0.75rem;\n\t}\n\t\n\t.Form_module_refreshButton__d62303b4 {\n\t\talign-self: flex-end;\n\t}\n}\n\n/* Full width content when sidebar is hidden */\n.hub-contentWrapper.fullWidthContent {\n\tmax-width: 1000px;\n\tmargin: 0 auto;\n\tpadding: 2rem;\n}\n\n.Form_module_hubContentWrapper_Col__d62303b4 {\n flex-flow: column;\n}\n\n/* Validation error message - displayed at top of form */\n.Form_module_validationErrorMessage__d62303b4 {\n\tbackground-color: var(--colour-branding-secondary-light);\n\tborder: 1px solid var(--colour-branding-secondary);\n\tborder-radius: 6px;\n\tcolor: var(--colour-red);\n\tpadding: 12px 16px;\n\tfont-weight: 500;\n\tfont-size: 14px;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\t\tmargin: 24px 32px;\n}\n\n.Form_module_validationErrorMessage__d62303b4::before {\n\tcontent: \"⚠\";\n\tfont-size: 16px;\n\tcolor: var(--colour-red);\n}\n\n/* Loading overlay for forms - deprecated, use SkeletonLoader instead */\n/*\n.loadingOverlay {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tbackground: rgba(255, 255, 255, 0.95);\n\tbackdrop-filter: blur(2px);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tz-index: 10;\n\tborder-radius: 8px;\n\tanimation: fadeIn 0.2s ease-in-out;\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n*/\n\n/* Form header with buttons */\n.Form_module_formHeader__d62303b4 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tmargin-bottom: 16px;\n}\n\n/* Loading container for fields */\n.Form_module_fieldsLoadingContainer__d62303b4 {\n\ttext-align: center;\n\tpadding: 60px 20px;\n}\n\n/* Help note styling */\n.Form_module_helpNote__d62303b4 {\n\tfont-size: 13px;\n\tcolor: #6c757d;\n}\n\n/* Loading container for overview */\n.Form_module_overviewLoadingContainer__d62303b4 {\n\ttext-align: center;\n\tpadding: 60px 20px;\n}\n\n/* Form layout header */\n.Form_module_formLayoutHeader__d62303b4 {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tmargin-bottom: 16px;\n}\n\n/* Section margins */\n.Form_module_gridIconSection__d62303b4 {\n\tmargin-bottom: 3rem;\n}\n\n.Form_module_layoutSection__d62303b4 {\n\tmargin-bottom: 2rem;\n}\n\n/* Grid icon loading state */\n.Form_module_gridIconLoading__d62303b4 {\n\tgrid-column: 1 / -1;\n}\n\n/* Hide upload button in grid icon section */\n.Form_module_gridIconSection__d62303b4 .iconLoader__buttonOverlay button:first-child {\n\tdisplay: none !important;\n}\n";
|
|
2964
|
+
var modules_cd65a764 = {"content":"Form_module_content__d62303b4","pageWrapper":"Form_module_pageWrapper__d62303b4","formContainer":"Form_module_formContainer__d62303b4","section":"Form_module_section__d62303b4","section--no-border":"Form_module_section_NoBorder__d62303b4","subtitle":"Form_module_subtitle__d62303b4","sectionHeader":"Form_module_sectionHeader__d62303b4","addFieldButton":"Form_module_addFieldButton__d62303b4","refreshButton":"Form_module_refreshButton__d62303b4","errorMessageContainer":"Form_module_errorMessageContainer__d62303b4","addFieldContainer":"Form_module_addFieldContainer__d62303b4","fieldNumberContainer":"Form_module_fieldNumberContainer__d62303b4","addFieldSection":"Form_module_addFieldSection__d62303b4","helpSection":"Form_module_helpSection__d62303b4","helpTitle":"Form_module_helpTitle__d62303b4","helpText":"Form_module_helpText__d62303b4","fieldTypeCards":"Form_module_fieldTypeCards__d62303b4","fieldTypeCard":"Form_module_fieldTypeCard__d62303b4","fieldTypeCardIcon":"Form_module_fieldTypeCardIcon__d62303b4","fieldTypeCardContent":"Form_module_fieldTypeCardContent__d62303b4","fieldTypeCardTitle":"Form_module_fieldTypeCardTitle__d62303b4","fieldTypeCardDescription":"Form_module_fieldTypeCardDescription__d62303b4","fieldTypeCardUseCase":"Form_module_fieldTypeCardUseCase__d62303b4","addFieldButtonContainer":"Form_module_addFieldButtonContainer__d62303b4","emptyState":"Form_module_emptyState__d62303b4","emptyStateText":"Form_module_emptyStateText__d62303b4","fieldTypeSelector":"Form_module_fieldTypeSelector__d62303b4","grid__four":"Form_module_grid__four__d62303b4","navigation":"Form_module_navigation__d62303b4","overviewStep":"Form_module_overviewStep__d62303b4","previousButton":"Form_module_previousButton__d62303b4","saveButton":"Form_module_saveButton__d62303b4","nextButton":"Form_module_nextButton__d62303b4","errorMessage":"Form_module_errorMessage__d62303b4","layoutOption":"Form_module_layoutOption__d62303b4","layoutOptionImage":"Form_module_layoutOptionImage__d62303b4","selected":"Form_module_selected__d62303b4","layoutOptionImg":"Form_module_layoutOptionImg__d62303b4","layoutOptionContent":"Form_module_layoutOptionContent__d62303b4","layoutOptionTitle":"Form_module_layoutOptionTitle__d62303b4","layoutOptionDescription":"Form_module_layoutOptionDescription__d62303b4","hasError":"Form_module_hasError__d62303b4","fieldError":"Form_module_fieldError__d62303b4","errorIcon":"Form_module_errorIcon__d62303b4","successMessage":"Form_module_successMessage__d62303b4","createMode":"Form_module_createMode__d62303b4","editMode":"Form_module_editMode__d62303b4","hub-contentWrapper--col":"Form_module_hubContentWrapper_Col__d62303b4","validationErrorMessage":"Form_module_validationErrorMessage__d62303b4","formHeader":"Form_module_formHeader__d62303b4","fieldsLoadingContainer":"Form_module_fieldsLoadingContainer__d62303b4","helpNote":"Form_module_helpNote__d62303b4","overviewLoadingContainer":"Form_module_overviewLoadingContainer__d62303b4","formLayoutHeader":"Form_module_formLayoutHeader__d62303b4","gridIconSection":"Form_module_gridIconSection__d62303b4","layoutSection":"Form_module_layoutSection__d62303b4","gridIconLoading":"Form_module_gridIconLoading__d62303b4","errorShake":"Form_module_errorShake__d62303b4","errorPulse":"Form_module_errorPulse__d62303b4"};
|
|
2928
2965
|
n(css$c,{});
|
|
2929
2966
|
|
|
2930
2967
|
/*
|
|
@@ -3864,21 +3901,22 @@ const FileField = props => {
|
|
|
3864
3901
|
});
|
|
3865
3902
|
};
|
|
3866
3903
|
|
|
3867
|
-
const
|
|
3868
|
-
const
|
|
3869
|
-
const
|
|
3870
|
-
const
|
|
3871
|
-
const
|
|
3872
|
-
const
|
|
3873
|
-
const
|
|
3874
|
-
const
|
|
3875
|
-
const
|
|
3876
|
-
const
|
|
3877
|
-
const
|
|
3904
|
+
const REDUCER_PREFIX$1 = values.reducerKey.toUpperCase();
|
|
3905
|
+
const FETCH_FEATURES_REQUEST = "".concat(REDUCER_PREFIX$1, "_FETCH_FEATURES_REQUEST");
|
|
3906
|
+
const FETCH_FEATURES_SUCCESS = "".concat(REDUCER_PREFIX$1, "_FETCH_FEATURES_SUCCESS");
|
|
3907
|
+
const FETCH_FEATURES_FAILURE = "".concat(REDUCER_PREFIX$1, "_FETCH_FEATURES_FAILURE");
|
|
3908
|
+
const FEATURE_CREATE_REQUEST = "".concat(REDUCER_PREFIX$1, "_FEATURE_CREATE_REQUEST");
|
|
3909
|
+
const FEATURE_CREATE_SUCCESS = "".concat(REDUCER_PREFIX$1, "_FEATURE_CREATE_SUCCESS");
|
|
3910
|
+
const FEATURE_CREATE_FAILURE = "".concat(REDUCER_PREFIX$1, "_FEATURE_CREATE_FAILURE");
|
|
3911
|
+
const FEATURE_EDIT_REQUEST = "".concat(REDUCER_PREFIX$1, "_FEATURE_EDIT_REQUEST");
|
|
3912
|
+
const FEATURE_EDIT_SUCCESS = "".concat(REDUCER_PREFIX$1, "_FEATURE_EDIT_SUCCESS");
|
|
3913
|
+
const FEATURE_EDIT_FAILURE = "".concat(REDUCER_PREFIX$1, "_FEATURE_EDIT_FAILURE");
|
|
3914
|
+
const FEATURE_DELETE_REQUEST = "".concat(REDUCER_PREFIX$1, "_FEATURE_DELETE_REQUEST");
|
|
3915
|
+
const FEATURE_DELETE_FAILURE = "".concat(REDUCER_PREFIX$1, "_FEATURE_DELETE_FAILURE");
|
|
3878
3916
|
|
|
3879
3917
|
// Wizard synchronization action types
|
|
3880
|
-
const SYNC_WIZARD_MODE_FROM_DEFINITION = "
|
|
3881
|
-
const SET_WIZARD_MODE = "
|
|
3918
|
+
const SYNC_WIZARD_MODE_FROM_DEFINITION = "".concat(REDUCER_PREFIX$1, "_SYNC_WIZARD_MODE_FROM_DEFINITION");
|
|
3919
|
+
const SET_WIZARD_MODE = "".concat(REDUCER_PREFIX$1, "_SET_WIZARD_MODE");
|
|
3882
3920
|
function fetchFeaturesRequest() {
|
|
3883
3921
|
return {
|
|
3884
3922
|
type: FETCH_FEATURES_REQUEST
|
|
@@ -3941,8 +3979,9 @@ function fetchFeatureDefinitions() {
|
|
|
3941
3979
|
dispatch(fetchFeaturesFailure(new Error("Unexpected response status: ".concat(response.status))));
|
|
3942
3980
|
}
|
|
3943
3981
|
} catch (err) {
|
|
3982
|
+
var _err$response;
|
|
3944
3983
|
// Check if it's a 404 (feature doesn't exist)
|
|
3945
|
-
if (
|
|
3984
|
+
if (((_err$response = err.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 404) {
|
|
3946
3985
|
// 404: Feature doesn't exist → create mode
|
|
3947
3986
|
dispatch(fetchFeaturesSuccess(null, "create"));
|
|
3948
3987
|
|
|
@@ -3990,9 +4029,12 @@ const useFeatureDefinitionLoader = function () {
|
|
|
3990
4029
|
const definition = reactRedux.useSelector(selectDefinition);
|
|
3991
4030
|
const isLoading = reactRedux.useSelector(selectDefinitionIsLoading);
|
|
3992
4031
|
const error = reactRedux.useSelector(selectDefinitionError);
|
|
4032
|
+
const mode = reactRedux.useSelector(selectDefinitionMode);
|
|
3993
4033
|
|
|
3994
4034
|
// Determine if we need to load the definition
|
|
3995
|
-
|
|
4035
|
+
// Only load if: definition is missing AND mode is not yet set (meaning we haven't tried to fetch yet)
|
|
4036
|
+
// OR forceReload is true
|
|
4037
|
+
const shouldLoadDefinition = !definition && !mode || forceReload;
|
|
3996
4038
|
|
|
3997
4039
|
// Function to manually reload definition
|
|
3998
4040
|
const reloadDefinition = () => {
|
|
@@ -4595,8 +4637,7 @@ const FormLayoutStepInner = props => {
|
|
|
4595
4637
|
// Use custom hook to handle definition loading
|
|
4596
4638
|
const {
|
|
4597
4639
|
definition,
|
|
4598
|
-
definitionIsLoading
|
|
4599
|
-
reloadDefinition
|
|
4640
|
+
definitionIsLoading
|
|
4600
4641
|
} = useFeatureDefinitionLoader();
|
|
4601
4642
|
|
|
4602
4643
|
// Get form initialization state
|
|
@@ -5058,28 +5099,29 @@ const listingActions = {
|
|
|
5058
5099
|
// Legacy exports have been removed as Redux actions now use the new listingActions object
|
|
5059
5100
|
|
|
5060
5101
|
// Action Types
|
|
5061
|
-
const
|
|
5062
|
-
const
|
|
5063
|
-
const
|
|
5064
|
-
const
|
|
5065
|
-
const
|
|
5066
|
-
const
|
|
5067
|
-
const
|
|
5068
|
-
const
|
|
5069
|
-
const
|
|
5070
|
-
const
|
|
5071
|
-
const
|
|
5072
|
-
const
|
|
5073
|
-
const
|
|
5074
|
-
const
|
|
5075
|
-
const
|
|
5076
|
-
const
|
|
5077
|
-
const
|
|
5078
|
-
const
|
|
5079
|
-
const
|
|
5080
|
-
const
|
|
5081
|
-
const
|
|
5082
|
-
const
|
|
5102
|
+
const REDUCER_PREFIX = values.reducerKey.toUpperCase();
|
|
5103
|
+
const FETCH_LISTING_REQUEST = "".concat(REDUCER_PREFIX, "_FETCH_LISTING_REQUEST");
|
|
5104
|
+
const FETCH_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_FETCH_LISTING_SUCCESS");
|
|
5105
|
+
const FETCH_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_FETCH_LISTING_FAILURE");
|
|
5106
|
+
const FETCH_LISTING_SILENT_SUCCESS = "".concat(REDUCER_PREFIX, "_FETCH_LISTING_SILENT_SUCCESS");
|
|
5107
|
+
const FETCH_LISTING_SILENT_FAILURE = "".concat(REDUCER_PREFIX, "_FETCH_LISTING_SILENT_FAILURE");
|
|
5108
|
+
const REORDER_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_REORDER_LISTING_SUCCESS");
|
|
5109
|
+
const DELETE_LISTING_REQUEST = "".concat(REDUCER_PREFIX, "_DELETE_LISTING_REQUEST");
|
|
5110
|
+
const DELETE_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_DELETE_LISTING_SUCCESS");
|
|
5111
|
+
const DELETE_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_DELETE_LISTING_FAILURE");
|
|
5112
|
+
const UNDELETE_LISTING_REQUEST = "".concat(REDUCER_PREFIX, "_UNDELETE_LISTING_REQUEST");
|
|
5113
|
+
const UNDELETE_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_UNDELETE_LISTING_SUCCESS");
|
|
5114
|
+
const UNDELETE_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_UNDELETE_LISTING_FAILURE");
|
|
5115
|
+
const CREATE_LISTING_REQUEST = "".concat(REDUCER_PREFIX, "_CREATE_LISTING_REQUEST");
|
|
5116
|
+
const CREATE_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_CREATE_LISTING_SUCCESS");
|
|
5117
|
+
const CREATE_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_CREATE_LISTING_FAILURE");
|
|
5118
|
+
const EDIT_LISTING_REQUEST = "".concat(REDUCER_PREFIX, "_EDIT_LISTING_REQUEST");
|
|
5119
|
+
const EDIT_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_EDIT_LISTING_SUCCESS");
|
|
5120
|
+
const EDIT_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_EDIT_LISTING_FAILURE");
|
|
5121
|
+
const TOGGLE_LISTING_SUCCESS = "".concat(REDUCER_PREFIX, "_TOGGLE_LISTING_SUCCESS");
|
|
5122
|
+
const TOGGLE_LISTING_FAILURE = "".concat(REDUCER_PREFIX, "_TOGGLE_LISTING_FAILURE");
|
|
5123
|
+
const SET_SORT_BY = "".concat(REDUCER_PREFIX, "_SET_SORT_BY");
|
|
5124
|
+
const SET_SHOW_DELETED = "".concat(REDUCER_PREFIX, "_SET_SHOW_DELETED");
|
|
5083
5125
|
const fetchListingRequest = () => ({
|
|
5084
5126
|
type: FETCH_LISTING_REQUEST
|
|
5085
5127
|
});
|
|
@@ -5207,7 +5249,7 @@ const undeleteListing = id => {
|
|
|
5207
5249
|
const response = await listingActions.undelete(id, site);
|
|
5208
5250
|
// If API returns the restored listing, use it; otherwise we'll need to refetch
|
|
5209
5251
|
const restoredListing = response.data;
|
|
5210
|
-
if (restoredListing && restoredListing.id) {
|
|
5252
|
+
if (restoredListing !== null && restoredListing !== void 0 && restoredListing.id) {
|
|
5211
5253
|
dispatch(undeleteListingSuccess(restoredListing));
|
|
5212
5254
|
} else {
|
|
5213
5255
|
// Trigger a refetch by dispatching the success with just ID, then fetch updated listings
|
|
@@ -5523,20 +5565,21 @@ const formReducer = function () {
|
|
|
5523
5565
|
switch (type) {
|
|
5524
5566
|
case actionsTypes.SET_INITIAL_VALUES:
|
|
5525
5567
|
{
|
|
5568
|
+
var _payload$featureDefin, _definitionWrapper$de;
|
|
5526
5569
|
// The actual definition data is in payload.featureDefinition.definition
|
|
5527
|
-
const definitionWrapper = payload
|
|
5528
|
-
const definition = definitionWrapper
|
|
5570
|
+
const definitionWrapper = (_payload$featureDefin = payload === null || payload === void 0 ? void 0 : payload.featureDefinition) !== null && _payload$featureDefin !== void 0 ? _payload$featureDefin : payload;
|
|
5571
|
+
const definition = (_definitionWrapper$de = definitionWrapper === null || definitionWrapper === void 0 ? void 0 : definitionWrapper.definition) !== null && _definitionWrapper$de !== void 0 ? _definitionWrapper$de : definitionWrapper;
|
|
5529
5572
|
|
|
5530
5573
|
// Validate and map definition data to form state structure
|
|
5531
5574
|
const mappedValues = {
|
|
5532
|
-
title: definition
|
|
5533
|
-
icon: definition
|
|
5534
|
-
displayName: definition
|
|
5535
|
-
layout: definition
|
|
5575
|
+
title: (definition === null || definition === void 0 ? void 0 : definition.title) || "",
|
|
5576
|
+
icon: (definition === null || definition === void 0 ? void 0 : definition.icon) || "star",
|
|
5577
|
+
displayName: (definition === null || definition === void 0 ? void 0 : definition.displayName) || "",
|
|
5578
|
+
layout: (definition === null || definition === void 0 ? void 0 : definition.layout) || {
|
|
5536
5579
|
gridIcon: undefined,
|
|
5537
5580
|
type: "round"
|
|
5538
5581
|
},
|
|
5539
|
-
fields:
|
|
5582
|
+
fields: Array.isArray(definition === null || definition === void 0 ? void 0 : definition.fields) ? definition.fields : state.fields
|
|
5540
5583
|
};
|
|
5541
5584
|
const newState = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, state), mappedValues), {}, {
|
|
5542
5585
|
_isInitial: false
|
|
@@ -5741,14 +5784,15 @@ const definitionReducer = function () {
|
|
|
5741
5784
|
let definitionId = values.featureId; // Always use hardcoded ID
|
|
5742
5785
|
|
|
5743
5786
|
if (mode === "edit" && data) {
|
|
5787
|
+
var _data$featureDefiniti, _featureDefinitionWra, _featureDefinitionWra2, _definition;
|
|
5744
5788
|
// Extract from API response for edit mode
|
|
5745
5789
|
// Handle nested structure: data.featureDefinition.definition
|
|
5746
|
-
const featureDefinitionWrapper = data
|
|
5747
|
-
definition = featureDefinitionWrapper
|
|
5748
|
-
definitionId = featureDefinitionWrapper
|
|
5790
|
+
const featureDefinitionWrapper = (_data$featureDefiniti = data === null || data === void 0 ? void 0 : data.featureDefinition) !== null && _data$featureDefiniti !== void 0 ? _data$featureDefiniti : data;
|
|
5791
|
+
definition = (_featureDefinitionWra = featureDefinitionWrapper === null || featureDefinitionWrapper === void 0 ? void 0 : featureDefinitionWrapper.definition) !== null && _featureDefinitionWra !== void 0 ? _featureDefinitionWra : featureDefinitionWrapper;
|
|
5792
|
+
definitionId = (_featureDefinitionWra2 = featureDefinitionWrapper === null || featureDefinitionWrapper === void 0 ? void 0 : featureDefinitionWrapper.id) !== null && _featureDefinitionWra2 !== void 0 ? _featureDefinitionWra2 : values.featureId;
|
|
5749
5793
|
|
|
5750
5794
|
// Ensure fields array exists and preserves order property
|
|
5751
|
-
if (definition &&
|
|
5795
|
+
if ((_definition = definition) !== null && _definition !== void 0 && _definition.fields) {
|
|
5752
5796
|
// Create a new array to ensure we preserve all field properties including order
|
|
5753
5797
|
definition.fields = definition.fields.map(field => _objectSpread$3(_objectSpread$3({}, field), {}, {
|
|
5754
5798
|
// Ensure order property exists, fallback to array index if missing
|
|
@@ -5787,7 +5831,7 @@ const definitionReducer = function () {
|
|
|
5787
5831
|
// Optimistically update with new definition
|
|
5788
5832
|
mode: "edit" // Switch to edit mode immediately
|
|
5789
5833
|
}),
|
|
5790
|
-
id: payload
|
|
5834
|
+
id: payload === null || payload === void 0 ? void 0 : payload.id,
|
|
5791
5835
|
error: null
|
|
5792
5836
|
});
|
|
5793
5837
|
case FEATURE_EDIT_REQUEST:
|
|
@@ -7718,12 +7762,12 @@ const Reducers = (() => {
|
|
|
7718
7762
|
})();
|
|
7719
7763
|
const Screens = (() => {
|
|
7720
7764
|
const screens = {};
|
|
7721
|
-
screens[
|
|
7722
|
-
screens[
|
|
7723
|
-
screens[
|
|
7724
|
-
screens[
|
|
7725
|
-
screens[
|
|
7726
|
-
screens[
|
|
7765
|
+
screens["FormOverviewStep"] = FormOverviewStep;
|
|
7766
|
+
screens["FormFieldsStep"] = FormFieldsStep;
|
|
7767
|
+
screens["FormLayoutStep"] = FormLayoutStep;
|
|
7768
|
+
screens["ListingScreen"] = ListingScreen$1;
|
|
7769
|
+
screens["CreateListingPage"] = CreateListingPage;
|
|
7770
|
+
screens["EditListingPage"] = EditListingPage;
|
|
7727
7771
|
return screens;
|
|
7728
7772
|
})();
|
|
7729
7773
|
|