@plusscommunities/pluss-feature-builder-web-b 1.0.2-beta.2 → 1.0.2-beta.4
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 +406 -451
- package/package.json +1 -1
- package/rollup.config.js +1 -0
- package/src/components/SidebarLayout.jsx +2 -64
- package/src/components/SidebarLayout.module.css +0 -40
- package/src/index.js +6 -6
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import React, { useEffect
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
2
|
import { useSelector } from "react-redux";
|
|
3
3
|
import { withRouter } from "react-router";
|
|
4
|
-
import { HubSidebar
|
|
4
|
+
import { HubSidebar } from "./index.js";
|
|
5
5
|
import {
|
|
6
6
|
selectWizardMode,
|
|
7
7
|
selectCurrentStep,
|
|
8
8
|
selectIsStepComplete,
|
|
9
9
|
selectIsStepAccessible,
|
|
10
|
-
selectStepProgress,
|
|
11
10
|
selectIsEditMode,
|
|
12
11
|
selectIsCreateMode,
|
|
13
|
-
selectDefinition,
|
|
14
|
-
selectDefinitionId,
|
|
15
12
|
} from "../selectors/featureBuilderSelectors";
|
|
16
13
|
import { goToStep } from "../actions/wizardActions";
|
|
17
14
|
import { useDispatch } from "react-redux";
|
|
18
|
-
import { PlussCore } from "../feature.config";
|
|
19
15
|
import { values } from "../values.config";
|
|
20
16
|
import styles from "./SidebarLayout.module.css";
|
|
21
17
|
|
|
22
|
-
const { Helper, Session } = PlussCore;
|
|
23
|
-
const { getUrl } = Helper;
|
|
24
|
-
const { authedFunction } = Session;
|
|
25
|
-
|
|
26
18
|
/**
|
|
27
19
|
* Sidebar Layout component for feature builder wizard
|
|
28
20
|
* Provides navigation sidebar with step progression, completion tracking
|
|
29
|
-
* Includes delete functionality for feature definitions
|
|
30
21
|
* Manages step accessibility based on wizard mode and validation state
|
|
31
22
|
*
|
|
32
23
|
* @param {Object} props - Component props
|
|
@@ -48,14 +39,6 @@ const SideBarInner = (props) => {
|
|
|
48
39
|
const isEditMode = useSelector(selectIsEditMode);
|
|
49
40
|
const isCreateMode = useSelector(selectIsCreateMode);
|
|
50
41
|
const currentStep = useSelector(selectCurrentStep);
|
|
51
|
-
const stepProgress = useSelector(selectStepProgress);
|
|
52
|
-
const definition = useSelector(selectDefinition);
|
|
53
|
-
const definitionId = useSelector(selectDefinitionId);
|
|
54
|
-
const auth = useSelector((state) => state.auth);
|
|
55
|
-
|
|
56
|
-
// Delete functionality state
|
|
57
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
|
58
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
59
42
|
|
|
60
43
|
const goTo = (url) => history.push(url);
|
|
61
44
|
|
|
@@ -139,34 +122,6 @@ const SideBarInner = (props) => {
|
|
|
139
122
|
},
|
|
140
123
|
];
|
|
141
124
|
|
|
142
|
-
// Delete functionality handlers
|
|
143
|
-
const handleDeleteClick = () => {
|
|
144
|
-
setShowDeleteConfirm(true);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const handleConfirmDelete = async () => {
|
|
148
|
-
if (!definition) return;
|
|
149
|
-
|
|
150
|
-
setIsDeleting(true);
|
|
151
|
-
try {
|
|
152
|
-
await authedFunction({
|
|
153
|
-
method: "POST",
|
|
154
|
-
url: getUrl("feature-builder", "definition/update/delete"),
|
|
155
|
-
data: { id: definitionId, site: auth.site },
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// Redirect to welcome screen after deletion
|
|
159
|
-
history.push("/feature-builder/definition/overview");
|
|
160
|
-
} finally {
|
|
161
|
-
setIsDeleting(false);
|
|
162
|
-
setShowDeleteConfirm(false);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const handleCancelDelete = () => {
|
|
167
|
-
setShowDeleteConfirm(false);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
125
|
// Add effect to manually attach click handlers since HubSidebar might not use onclick properly
|
|
171
126
|
useEffect(() => {
|
|
172
127
|
const attachClickHandlers = () => {
|
|
@@ -263,28 +218,11 @@ const SideBarInner = (props) => {
|
|
|
263
218
|
/>
|
|
264
219
|
)}
|
|
265
220
|
|
|
266
|
-
{/* Dev Delete Button - Absolute positioned at bottom of sidebar */}
|
|
267
|
-
{shouldShowSidebar && (
|
|
268
|
-
<button onClick={handleDeleteClick} className={styles.devDeleteButton}>
|
|
269
|
-
DELETE FEATURE DEF
|
|
270
|
-
</button>
|
|
271
|
-
)}
|
|
272
|
-
|
|
273
221
|
<div className="hub-contentWrapper">
|
|
274
222
|
<div className={styles.fullWidthContainer}>
|
|
275
223
|
<div className={styles.contentContainer}>{children}</div>
|
|
276
224
|
</div>
|
|
277
225
|
</div>
|
|
278
|
-
|
|
279
|
-
{/* Delete Confirmation Popup */}
|
|
280
|
-
<DeleteConfirmationPopup
|
|
281
|
-
isOpen={showDeleteConfirm}
|
|
282
|
-
listing={definition}
|
|
283
|
-
onConfirm={handleConfirmDelete}
|
|
284
|
-
onCancel={handleCancelDelete}
|
|
285
|
-
isDeleting={isDeleting}
|
|
286
|
-
deleteType="featureDefinition"
|
|
287
|
-
/>
|
|
288
226
|
</div>
|
|
289
227
|
);
|
|
290
228
|
};
|
|
@@ -103,43 +103,3 @@
|
|
|
103
103
|
:global(.hub-sideBar-section:last-child) {
|
|
104
104
|
border-bottom: none;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
/* Delete button styling - bold red for development */
|
|
108
|
-
.deleteButton {
|
|
109
|
-
color: #dc3545 !important;
|
|
110
|
-
font-weight: bold !important;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
:global(.sideNav-item.deleteButton) {
|
|
114
|
-
color: #dc3545 !important;
|
|
115
|
-
font-weight: bold !important;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:global(.sideNav-item.deleteButton:hover) {
|
|
119
|
-
background-color: rgba(220, 53, 69, 0.1) !important;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:global(.sideNav-item.deleteButton i) {
|
|
123
|
-
color: #dc3545 !important;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Development delete button */
|
|
127
|
-
.devDeleteButton {
|
|
128
|
-
position: absolute;
|
|
129
|
-
bottom: 20px;
|
|
130
|
-
left: 20px;
|
|
131
|
-
background-color: #ff0000;
|
|
132
|
-
color: #ffffff;
|
|
133
|
-
border: none;
|
|
134
|
-
padding: 8px 12px;
|
|
135
|
-
border-radius: 4px;
|
|
136
|
-
cursor: pointer;
|
|
137
|
-
font-size: 12px;
|
|
138
|
-
font-weight: bold;
|
|
139
|
-
z-index: 1000;
|
|
140
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.devDeleteButton:hover {
|
|
144
|
-
background-color: #cc0000;
|
|
145
|
-
}
|
package/src/index.js
CHANGED
|
@@ -18,12 +18,12 @@ export const Reducers = (() => {
|
|
|
18
18
|
export const Screens = (() => {
|
|
19
19
|
const screens = {};
|
|
20
20
|
|
|
21
|
-
screens[
|
|
22
|
-
screens[
|
|
23
|
-
screens[
|
|
24
|
-
screens[
|
|
25
|
-
screens[
|
|
26
|
-
screens[
|
|
21
|
+
screens[values.screenFormOverviewStep] = FormOverviewStep;
|
|
22
|
+
screens[values.screenFormFieldsStep] = FormFieldsStep;
|
|
23
|
+
screens[values.screenFormLayoutStep] = FormLayoutStep;
|
|
24
|
+
screens[values.screenListingScreen] = ListingScreen;
|
|
25
|
+
screens[values.pageCreateListing] = CreateListingPage;
|
|
26
|
+
screens[values.pageEditListing] = EditListingPage;
|
|
27
27
|
return screens;
|
|
28
28
|
})();
|
|
29
29
|
|