@plusscommunities/pluss-feature-builder-app-d 1.0.1-beta.3
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/module/actions/featureBuilderActions.js +106 -0
- package/dist/module/actions/featureBuilderActions.js.map +1 -0
- package/dist/module/actions/featureBuilderStringsActions.js +106 -0
- package/dist/module/actions/featureBuilderStringsActions.js.map +1 -0
- package/dist/module/actions/index.js +12 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +7 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/components/FeatureDetailScreen.js +725 -0
- package/dist/module/components/FeatureDetailScreen.js.map +1 -0
- package/dist/module/components/FeatureListItem.js +174 -0
- package/dist/module/components/FeatureListItem.js.map +1 -0
- package/dist/module/components/FeatureListScreen.js +159 -0
- package/dist/module/components/FeatureListScreen.js.map +1 -0
- package/dist/module/components/FieldRenderer.js +218 -0
- package/dist/module/components/FieldRenderer.js.map +1 -0
- package/dist/module/components/FileDownload.js +74 -0
- package/dist/module/components/FileDownload.js.map +1 -0
- package/dist/module/components/WidgetGrid.js +158 -0
- package/dist/module/components/WidgetGrid.js.map +1 -0
- package/dist/module/components/WidgetLarge.js +274 -0
- package/dist/module/components/WidgetLarge.js.map +1 -0
- package/dist/module/components/WidgetSmall.js +315 -0
- package/dist/module/components/WidgetSmall.js.map +1 -0
- package/dist/module/components/common/index.js +25 -0
- package/dist/module/components/common/index.js.map +1 -0
- package/dist/module/components/layouts/CondensedList.js +195 -0
- package/dist/module/components/layouts/CondensedList.js.map +1 -0
- package/dist/module/components/layouts/FeatureImageList.js +172 -0
- package/dist/module/components/layouts/FeatureImageList.js.map +1 -0
- package/dist/module/components/layouts/RoundImageList.js +198 -0
- package/dist/module/components/layouts/RoundImageList.js.map +1 -0
- package/dist/module/components/layouts/SquareImageList.js +185 -0
- package/dist/module/components/layouts/SquareImageList.js.map +1 -0
- package/dist/module/config/index.js +10 -0
- package/dist/module/config/index.js.map +1 -0
- package/dist/module/core.config.js +17 -0
- package/dist/module/core.config.js.map +1 -0
- package/dist/module/feature.config.js +113 -0
- package/dist/module/feature.config.js.map +1 -0
- package/dist/module/index.js +24 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/Colors.js +25 -0
- package/dist/module/js/Colors.js.map +1 -0
- package/dist/module/js/FieldTypes.js +123 -0
- package/dist/module/js/FieldTypes.js.map +1 -0
- package/dist/module/js/NavigationService.js +10 -0
- package/dist/module/js/NavigationService.js.map +1 -0
- package/dist/module/js/Styles.js +3 -0
- package/dist/module/js/Styles.js.map +1 -0
- package/dist/module/js/helpers.js +29 -0
- package/dist/module/js/helpers.js.map +1 -0
- package/dist/module/js/index.js +24 -0
- package/dist/module/js/index.js.map +1 -0
- package/dist/module/js/spacing.js +29 -0
- package/dist/module/js/spacing.js.map +1 -0
- package/dist/module/js/types.js +254 -0
- package/dist/module/js/types.js.map +1 -0
- package/dist/module/reducers/featureBuilderReducer.js +75 -0
- package/dist/module/reducers/featureBuilderReducer.js.map +1 -0
- package/dist/module/utils/featureSelectors.js +9 -0
- package/dist/module/utils/featureSelectors.js.map +1 -0
- package/dist/module/values.config.a.js +96 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +96 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +96 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +96 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.js +96 -0
- package/dist/module/values.config.js.map +1 -0
- package/dist/module/webapi/featureBuilderAPI.js +59 -0
- package/dist/module/webapi/featureBuilderAPI.js.map +1 -0
- package/dist/module/webapi/helper.js +4 -0
- package/dist/module/webapi/helper.js.map +1 -0
- package/dist/module/webapi/index.js +8 -0
- package/dist/module/webapi/index.js.map +1 -0
- package/package.json +62 -0
- package/src/actions/featureBuilderActions.js +112 -0
- package/src/actions/featureBuilderStringsActions.js +114 -0
- package/src/actions/index.js +12 -0
- package/src/actions/types.js +7 -0
- package/src/components/FeatureDetailScreen.js +817 -0
- package/src/components/FeatureListItem.js +198 -0
- package/src/components/FeatureListScreen.js +160 -0
- package/src/components/FieldRenderer.js +272 -0
- package/src/components/FileDownload.js +79 -0
- package/src/components/WidgetGrid.js +181 -0
- package/src/components/WidgetLarge.js +305 -0
- package/src/components/WidgetSmall.js +344 -0
- package/src/components/common/index.js +25 -0
- package/src/components/layouts/CondensedList.js +230 -0
- package/src/components/layouts/FeatureImageList.js +193 -0
- package/src/components/layouts/RoundImageList.js +219 -0
- package/src/components/layouts/SquareImageList.js +205 -0
- package/src/config/index.js +10 -0
- package/src/core.config.js +29 -0
- package/src/feature.config.js +127 -0
- package/src/index.js +27 -0
- package/src/js/Colors.js +30 -0
- package/src/js/FieldTypes.js +131 -0
- package/src/js/NavigationService.js +12 -0
- package/src/js/Styles.js +3 -0
- package/src/js/helpers.js +30 -0
- package/src/js/index.js +24 -0
- package/src/js/spacing.js +30 -0
- package/src/js/types.js +253 -0
- package/src/reducers/featureBuilderReducer.js +64 -0
- package/src/utils/featureSelectors.js +8 -0
- package/src/values.config.a.js +104 -0
- package/src/values.config.b.js +104 -0
- package/src/values.config.c.js +104 -0
- package/src/values.config.d.js +104 -0
- package/src/values.config.js +104 -0
- package/src/webapi/featureBuilderAPI.js +65 -0
- package/src/webapi/helper.js +4 -0
- package/src/webapi/index.js +8 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { values } from "../values.config";
|
|
2
|
+
import { FeatureBuilderActionTypes } from "../actions/featureBuilderActions";
|
|
3
|
+
|
|
4
|
+
const initialState = {
|
|
5
|
+
feature: null,
|
|
6
|
+
listings: [],
|
|
7
|
+
loading: false,
|
|
8
|
+
error: null,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const featureBuilderReducer = (state = initialState, action) => {
|
|
12
|
+
switch (action.type) {
|
|
13
|
+
case FeatureBuilderActionTypes.LOADING:
|
|
14
|
+
return { ...state, loading: true, error: null };
|
|
15
|
+
|
|
16
|
+
case FeatureBuilderActionTypes.LOAD_SUCCESS:
|
|
17
|
+
const { feature, listings } = action.payload;
|
|
18
|
+
return {
|
|
19
|
+
...state,
|
|
20
|
+
loading: false,
|
|
21
|
+
feature: feature,
|
|
22
|
+
listings: listings,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
case FeatureBuilderActionTypes.FAILURE:
|
|
26
|
+
return { ...state, loading: false, error: action.payload };
|
|
27
|
+
|
|
28
|
+
default:
|
|
29
|
+
return state;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default featureBuilderReducer;
|
|
34
|
+
|
|
35
|
+
// --- Selectors ---
|
|
36
|
+
|
|
37
|
+
// Use values.reducerKey to access the correct state slice for multi-instance support
|
|
38
|
+
export const selectFeature = (state) => {
|
|
39
|
+
return state[values.reducerKey]?.feature;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const selectFeatureDefinition = (state) => {
|
|
43
|
+
return state[values.reducerKey]?.feature;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const selectListings = (state) => {
|
|
47
|
+
return state[values.reducerKey]?.listings || [];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const selectListingsForFeature = (state) => {
|
|
51
|
+
return state[values.reducerKey]?.listings || [];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Legacy Helpers for Widgets
|
|
55
|
+
export const selectActiveFeatureDefinitions = (state) => {
|
|
56
|
+
return state[values.reducerKey]?.feature ? [state[values.reducerKey].feature] : [];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const selectFeaturesWithListings = (state) => {
|
|
60
|
+
const feature = state[values.reducerKey]?.feature;
|
|
61
|
+
const listings = state[values.reducerKey]?.listings;
|
|
62
|
+
if (!feature || !listings) return [];
|
|
63
|
+
return [{ definition: feature, listings: listings }];
|
|
64
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const values = {
|
|
2
|
+
// Feature identification
|
|
3
|
+
featureKey: "feature-builder-a",
|
|
4
|
+
featureName: "Feature A",
|
|
5
|
+
targetFeatureDefinitionId: "feature-builder-a-default",
|
|
6
|
+
|
|
7
|
+
// Redux state management
|
|
8
|
+
reducerKey: "featureBuilderA", // Redux state slice name (must be unique per instance)
|
|
9
|
+
|
|
10
|
+
// API routing
|
|
11
|
+
apiNamespace: "feature-builder-a", // API endpoint prefix for multi-instance routing
|
|
12
|
+
|
|
13
|
+
// Notifications
|
|
14
|
+
notificationKey: "feature-builder-a", // Key for notifications.dataUpdated[...]
|
|
15
|
+
|
|
16
|
+
// Default brand colors (single source of truth)
|
|
17
|
+
colors: {
|
|
18
|
+
defaultBrandMain: "#FF6363",
|
|
19
|
+
defaultBrandDark: "#D13636",
|
|
20
|
+
defaultBrandLight: "#FCE1E1",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Screen names
|
|
24
|
+
screens: {
|
|
25
|
+
featureList: "FeatureBuilderListA",
|
|
26
|
+
featureDetail: "FeatureBuilderDetailA",
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// API endpoints
|
|
30
|
+
api: {
|
|
31
|
+
getDefinitions: "definition/get/all",
|
|
32
|
+
getListings: "listing/get/all",
|
|
33
|
+
getSingleListing: "listing/get/single",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Layout types
|
|
37
|
+
layoutTypes: {
|
|
38
|
+
round: "round",
|
|
39
|
+
square: "square",
|
|
40
|
+
condensed: "condensed",
|
|
41
|
+
feature: "feature",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Field types
|
|
45
|
+
fieldTypes: {
|
|
46
|
+
string: "string",
|
|
47
|
+
number: "number",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
image: "image",
|
|
50
|
+
pdf: "pdf",
|
|
51
|
+
link: "link",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Mandatory field IDs
|
|
55
|
+
mandatoryFields: {
|
|
56
|
+
title: "mandatory-title",
|
|
57
|
+
featureImage: "mandatory-feature-image",
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Action types (with suffix to prevent collisions between instances)
|
|
61
|
+
actions: {
|
|
62
|
+
LOADING: "FB_LOADING_A",
|
|
63
|
+
LOAD_SUCCESS: "FB_LOAD_SUCCESS_A",
|
|
64
|
+
FAILURE: "FB_FAILURE_A",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Navigation
|
|
68
|
+
navigation: {
|
|
69
|
+
gridMenu: {
|
|
70
|
+
icon: "settings",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
navigate: "FeatureBuilderListA",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// Default values
|
|
77
|
+
defaults: {
|
|
78
|
+
itemsPerWidget: 2,
|
|
79
|
+
loadingTimeout: 30000, // 30 seconds
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Widget configuration
|
|
83
|
+
widget: {
|
|
84
|
+
maxItems: 2,
|
|
85
|
+
itemMinWidth: 120,
|
|
86
|
+
itemMaxWidth: 150,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// UI dimensions
|
|
90
|
+
dimensions: {
|
|
91
|
+
cardHeight: 125,
|
|
92
|
+
imageSize: 95,
|
|
93
|
+
imageBorderRadius: 47.5,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Common text labels
|
|
97
|
+
labels: {
|
|
98
|
+
emptyState: "No custom features available",
|
|
99
|
+
defaultTitle: "Untitled",
|
|
100
|
+
attachments: "Attachments",
|
|
101
|
+
viewAll: "View All",
|
|
102
|
+
featureImage: "Feature Image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const values = {
|
|
2
|
+
// Feature identification
|
|
3
|
+
featureKey: "feature-builder-b",
|
|
4
|
+
featureName: "Feature B",
|
|
5
|
+
targetFeatureDefinitionId: "feature-builder-b-default",
|
|
6
|
+
|
|
7
|
+
// Redux state management
|
|
8
|
+
reducerKey: "featureBuilderB", // Redux state slice name (must be unique per instance)
|
|
9
|
+
|
|
10
|
+
// API routing
|
|
11
|
+
apiNamespace: "feature-builder-b", // API endpoint prefix for multi-instance routing
|
|
12
|
+
|
|
13
|
+
// Notifications
|
|
14
|
+
notificationKey: "feature-builder-b", // Key for notifications.dataUpdated[...]
|
|
15
|
+
|
|
16
|
+
// Default brand colors (single source of truth)
|
|
17
|
+
colors: {
|
|
18
|
+
defaultBrandMain: "#4A90E2",
|
|
19
|
+
defaultBrandDark: "#2C5F8E",
|
|
20
|
+
defaultBrandLight: "#D6E8F9",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Screen names
|
|
24
|
+
screens: {
|
|
25
|
+
featureList: "FeatureBuilderListB",
|
|
26
|
+
featureDetail: "FeatureBuilderDetailB",
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// API endpoints
|
|
30
|
+
api: {
|
|
31
|
+
getDefinitions: "definition/get/all",
|
|
32
|
+
getListings: "listing/get/all",
|
|
33
|
+
getSingleListing: "listing/get/single",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Layout types
|
|
37
|
+
layoutTypes: {
|
|
38
|
+
round: "round",
|
|
39
|
+
square: "square",
|
|
40
|
+
condensed: "condensed",
|
|
41
|
+
feature: "feature",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Field types
|
|
45
|
+
fieldTypes: {
|
|
46
|
+
string: "string",
|
|
47
|
+
number: "number",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
image: "image",
|
|
50
|
+
pdf: "pdf",
|
|
51
|
+
link: "link",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Mandatory field IDs
|
|
55
|
+
mandatoryFields: {
|
|
56
|
+
title: "mandatory-title",
|
|
57
|
+
featureImage: "mandatory-feature-image",
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Action types (with suffix to prevent collisions between instances)
|
|
61
|
+
actions: {
|
|
62
|
+
LOADING: "FB_LOADING_B",
|
|
63
|
+
LOAD_SUCCESS: "FB_LOAD_SUCCESS_B",
|
|
64
|
+
FAILURE: "FB_FAILURE_B",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Navigation
|
|
68
|
+
navigation: {
|
|
69
|
+
gridMenu: {
|
|
70
|
+
icon: "settings",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
navigate: "FeatureBuilderListB",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// Default values
|
|
77
|
+
defaults: {
|
|
78
|
+
itemsPerWidget: 2,
|
|
79
|
+
loadingTimeout: 30000, // 30 seconds
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Widget configuration
|
|
83
|
+
widget: {
|
|
84
|
+
maxItems: 2,
|
|
85
|
+
itemMinWidth: 120,
|
|
86
|
+
itemMaxWidth: 150,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// UI dimensions
|
|
90
|
+
dimensions: {
|
|
91
|
+
cardHeight: 125,
|
|
92
|
+
imageSize: 95,
|
|
93
|
+
imageBorderRadius: 47.5,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Common text labels
|
|
97
|
+
labels: {
|
|
98
|
+
emptyState: "No custom features available",
|
|
99
|
+
defaultTitle: "Untitled",
|
|
100
|
+
attachments: "Attachments",
|
|
101
|
+
viewAll: "View All",
|
|
102
|
+
featureImage: "Feature Image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const values = {
|
|
2
|
+
// Feature identification
|
|
3
|
+
featureKey: "feature-builder-c",
|
|
4
|
+
featureName: "Feature C",
|
|
5
|
+
targetFeatureDefinitionId: "feature-builder-c-default",
|
|
6
|
+
|
|
7
|
+
// Redux state management
|
|
8
|
+
reducerKey: "featureBuilderC", // Redux state slice name (must be unique per instance)
|
|
9
|
+
|
|
10
|
+
// API routing
|
|
11
|
+
apiNamespace: "feature-builder-c", // API endpoint prefix for multi-instance routing
|
|
12
|
+
|
|
13
|
+
// Notifications
|
|
14
|
+
notificationKey: "feature-builder-c", // Key for notifications.dataUpdated[...]
|
|
15
|
+
|
|
16
|
+
// Default brand colors (single source of truth)
|
|
17
|
+
colors: {
|
|
18
|
+
defaultBrandMain: "#50C878",
|
|
19
|
+
defaultBrandDark: "#3A9B5C",
|
|
20
|
+
defaultBrandLight: "#D6F5E0",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Screen names
|
|
24
|
+
screens: {
|
|
25
|
+
featureList: "FeatureBuilderListC",
|
|
26
|
+
featureDetail: "FeatureBuilderDetailC",
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// API endpoints
|
|
30
|
+
api: {
|
|
31
|
+
getDefinitions: "definition/get/all",
|
|
32
|
+
getListings: "listing/get/all",
|
|
33
|
+
getSingleListing: "listing/get/single",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Layout types
|
|
37
|
+
layoutTypes: {
|
|
38
|
+
round: "round",
|
|
39
|
+
square: "square",
|
|
40
|
+
condensed: "condensed",
|
|
41
|
+
feature: "feature",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Field types
|
|
45
|
+
fieldTypes: {
|
|
46
|
+
string: "string",
|
|
47
|
+
number: "number",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
image: "image",
|
|
50
|
+
pdf: "pdf",
|
|
51
|
+
link: "link",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Mandatory field IDs
|
|
55
|
+
mandatoryFields: {
|
|
56
|
+
title: "mandatory-title",
|
|
57
|
+
featureImage: "mandatory-feature-image",
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Action types (with suffix to prevent collisions between instances)
|
|
61
|
+
actions: {
|
|
62
|
+
LOADING: "FB_LOADING_C",
|
|
63
|
+
LOAD_SUCCESS: "FB_LOAD_SUCCESS_C",
|
|
64
|
+
FAILURE: "FB_FAILURE_C",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Navigation
|
|
68
|
+
navigation: {
|
|
69
|
+
gridMenu: {
|
|
70
|
+
icon: "settings",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
navigate: "FeatureBuilderListC",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// Default values
|
|
77
|
+
defaults: {
|
|
78
|
+
itemsPerWidget: 2,
|
|
79
|
+
loadingTimeout: 30000, // 30 seconds
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Widget configuration
|
|
83
|
+
widget: {
|
|
84
|
+
maxItems: 2,
|
|
85
|
+
itemMinWidth: 120,
|
|
86
|
+
itemMaxWidth: 150,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// UI dimensions
|
|
90
|
+
dimensions: {
|
|
91
|
+
cardHeight: 125,
|
|
92
|
+
imageSize: 95,
|
|
93
|
+
imageBorderRadius: 47.5,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Common text labels
|
|
97
|
+
labels: {
|
|
98
|
+
emptyState: "No custom features available",
|
|
99
|
+
defaultTitle: "Untitled",
|
|
100
|
+
attachments: "Attachments",
|
|
101
|
+
viewAll: "View All",
|
|
102
|
+
featureImage: "Feature Image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const values = {
|
|
2
|
+
// Feature identification
|
|
3
|
+
featureKey: "feature-builder-d",
|
|
4
|
+
featureName: "Feature D",
|
|
5
|
+
targetFeatureDefinitionId: "feature-builder-d-default",
|
|
6
|
+
|
|
7
|
+
// Redux state management
|
|
8
|
+
reducerKey: "featureBuilderD", // Redux state slice name (must be unique per instance)
|
|
9
|
+
|
|
10
|
+
// API routing
|
|
11
|
+
apiNamespace: "feature-builder-d", // API endpoint prefix for multi-instance routing
|
|
12
|
+
|
|
13
|
+
// Notifications
|
|
14
|
+
notificationKey: "feature-builder-d", // Key for notifications.dataUpdated[...]
|
|
15
|
+
|
|
16
|
+
// Default brand colors (single source of truth)
|
|
17
|
+
colors: {
|
|
18
|
+
defaultBrandMain: "#FFA500",
|
|
19
|
+
defaultBrandDark: "#CC8400",
|
|
20
|
+
defaultBrandLight: "#FFE8CC",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Screen names
|
|
24
|
+
screens: {
|
|
25
|
+
featureList: "FeatureBuilderListD",
|
|
26
|
+
featureDetail: "FeatureBuilderDetailD",
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// API endpoints
|
|
30
|
+
api: {
|
|
31
|
+
getDefinitions: "definition/get/all",
|
|
32
|
+
getListings: "listing/get/all",
|
|
33
|
+
getSingleListing: "listing/get/single",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Layout types
|
|
37
|
+
layoutTypes: {
|
|
38
|
+
round: "round",
|
|
39
|
+
square: "square",
|
|
40
|
+
condensed: "condensed",
|
|
41
|
+
feature: "feature",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Field types
|
|
45
|
+
fieldTypes: {
|
|
46
|
+
string: "string",
|
|
47
|
+
number: "number",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
image: "image",
|
|
50
|
+
pdf: "pdf",
|
|
51
|
+
link: "link",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Mandatory field IDs
|
|
55
|
+
mandatoryFields: {
|
|
56
|
+
title: "mandatory-title",
|
|
57
|
+
featureImage: "mandatory-feature-image",
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Action types (with suffix to prevent collisions between instances)
|
|
61
|
+
actions: {
|
|
62
|
+
LOADING: "FB_LOADING_D",
|
|
63
|
+
LOAD_SUCCESS: "FB_LOAD_SUCCESS_D",
|
|
64
|
+
FAILURE: "FB_FAILURE_D",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Navigation
|
|
68
|
+
navigation: {
|
|
69
|
+
gridMenu: {
|
|
70
|
+
icon: "settings",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
navigate: "FeatureBuilderListD",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// Default values
|
|
77
|
+
defaults: {
|
|
78
|
+
itemsPerWidget: 2,
|
|
79
|
+
loadingTimeout: 30000, // 30 seconds
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Widget configuration
|
|
83
|
+
widget: {
|
|
84
|
+
maxItems: 2,
|
|
85
|
+
itemMinWidth: 120,
|
|
86
|
+
itemMaxWidth: 150,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// UI dimensions
|
|
90
|
+
dimensions: {
|
|
91
|
+
cardHeight: 125,
|
|
92
|
+
imageSize: 95,
|
|
93
|
+
imageBorderRadius: 47.5,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Common text labels
|
|
97
|
+
labels: {
|
|
98
|
+
emptyState: "No custom features available",
|
|
99
|
+
defaultTitle: "Untitled",
|
|
100
|
+
attachments: "Attachments",
|
|
101
|
+
viewAll: "View All",
|
|
102
|
+
featureImage: "Feature Image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export const values = {
|
|
2
|
+
// Feature identification
|
|
3
|
+
featureKey: "feature-builder-d",
|
|
4
|
+
featureName: "Feature D",
|
|
5
|
+
targetFeatureDefinitionId: "feature-builder-d-default",
|
|
6
|
+
|
|
7
|
+
// Redux state management
|
|
8
|
+
reducerKey: "featureBuilderD", // Redux state slice name (must be unique per instance)
|
|
9
|
+
|
|
10
|
+
// API routing
|
|
11
|
+
apiNamespace: "feature-builder-d", // API endpoint prefix for multi-instance routing
|
|
12
|
+
|
|
13
|
+
// Notifications
|
|
14
|
+
notificationKey: "feature-builder-d", // Key for notifications.dataUpdated[...]
|
|
15
|
+
|
|
16
|
+
// Default brand colors (single source of truth)
|
|
17
|
+
colors: {
|
|
18
|
+
defaultBrandMain: "#FFA500",
|
|
19
|
+
defaultBrandDark: "#CC8400",
|
|
20
|
+
defaultBrandLight: "#FFE8CC",
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Screen names
|
|
24
|
+
screens: {
|
|
25
|
+
featureList: "FeatureBuilderListD",
|
|
26
|
+
featureDetail: "FeatureBuilderDetailD",
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// API endpoints
|
|
30
|
+
api: {
|
|
31
|
+
getDefinitions: "definition/get/all",
|
|
32
|
+
getListings: "listing/get/all",
|
|
33
|
+
getSingleListing: "listing/get/single",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Layout types
|
|
37
|
+
layoutTypes: {
|
|
38
|
+
round: "round",
|
|
39
|
+
square: "square",
|
|
40
|
+
condensed: "condensed",
|
|
41
|
+
feature: "feature",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Field types
|
|
45
|
+
fieldTypes: {
|
|
46
|
+
string: "string",
|
|
47
|
+
number: "number",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
image: "image",
|
|
50
|
+
pdf: "pdf",
|
|
51
|
+
link: "link",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Mandatory field IDs
|
|
55
|
+
mandatoryFields: {
|
|
56
|
+
title: "mandatory-title",
|
|
57
|
+
featureImage: "mandatory-feature-image",
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Action types (with suffix to prevent collisions between instances)
|
|
61
|
+
actions: {
|
|
62
|
+
LOADING: "FB_LOADING_D",
|
|
63
|
+
LOAD_SUCCESS: "FB_LOAD_SUCCESS_D",
|
|
64
|
+
FAILURE: "FB_FAILURE_D",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Navigation
|
|
68
|
+
navigation: {
|
|
69
|
+
gridMenu: {
|
|
70
|
+
icon: "settings",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
navigate: "FeatureBuilderListD",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// Default values
|
|
77
|
+
defaults: {
|
|
78
|
+
itemsPerWidget: 2,
|
|
79
|
+
loadingTimeout: 30000, // 30 seconds
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Widget configuration
|
|
83
|
+
widget: {
|
|
84
|
+
maxItems: 2,
|
|
85
|
+
itemMinWidth: 120,
|
|
86
|
+
itemMaxWidth: 150,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// UI dimensions
|
|
90
|
+
dimensions: {
|
|
91
|
+
cardHeight: 125,
|
|
92
|
+
imageSize: 95,
|
|
93
|
+
imageBorderRadius: 47.5,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Common text labels
|
|
97
|
+
labels: {
|
|
98
|
+
emptyState: "No custom features available",
|
|
99
|
+
defaultTitle: "Untitled",
|
|
100
|
+
attachments: "Attachments",
|
|
101
|
+
viewAll: "View All",
|
|
102
|
+
featureImage: "Feature Image",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getUrl } from "./helper";
|
|
2
|
+
import { authedFunction } from "../js";
|
|
3
|
+
import { values } from "../values.config";
|
|
4
|
+
|
|
5
|
+
// Helper function for constructing URLs
|
|
6
|
+
const getFeatureBuilderUrl = (action, query = null) => {
|
|
7
|
+
return getUrl(values.apiNamespace, action, query);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const featureBuilderAPI = {
|
|
11
|
+
// Fetch all feature definitions
|
|
12
|
+
getFeatureDefinitions: (site) => {
|
|
13
|
+
const url = getFeatureBuilderUrl(values.api.getDefinitions, { site });
|
|
14
|
+
|
|
15
|
+
const request = {
|
|
16
|
+
method: "GET",
|
|
17
|
+
url,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return authedFunction(request)
|
|
21
|
+
.then((response) => {
|
|
22
|
+
return response;
|
|
23
|
+
})
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
throw error;
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// Fetch listings for all features or specific feature
|
|
30
|
+
getFeatureListings: (site, featureDefinitionId = null) => {
|
|
31
|
+
const queryParams = { site };
|
|
32
|
+
if (featureDefinitionId) {
|
|
33
|
+
queryParams.featureDefinitionId = featureDefinitionId;
|
|
34
|
+
}
|
|
35
|
+
const url = getFeatureBuilderUrl(values.api.getListings, queryParams);
|
|
36
|
+
|
|
37
|
+
const request = {
|
|
38
|
+
method: "GET",
|
|
39
|
+
url,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return authedFunction(request)
|
|
43
|
+
.then((response) => {
|
|
44
|
+
return response;
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
throw error;
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// Fetch a single listing by ID
|
|
52
|
+
getSingleListing: (site, listingId) => {
|
|
53
|
+
if (!listingId) {
|
|
54
|
+
return Promise.reject(new Error("Listing ID is required"));
|
|
55
|
+
}
|
|
56
|
+
const url = getFeatureBuilderUrl(values.api.getSingleListing, {
|
|
57
|
+
site,
|
|
58
|
+
id: listingId,
|
|
59
|
+
});
|
|
60
|
+
return authedFunction({
|
|
61
|
+
method: "GET",
|
|
62
|
+
url,
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Apis } from "../core.config";
|
|
2
|
+
|
|
3
|
+
export const userActions = Apis.userActions;
|
|
4
|
+
export const contactActions = Apis.contactActions;
|
|
5
|
+
export const eventActions = Apis.eventActions;
|
|
6
|
+
|
|
7
|
+
// TODO: Add custom web apis below for example,
|
|
8
|
+
// export * from './activityActions';
|