jamespot-front-business 1.1.39 → 1.1.41

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/esm.js CHANGED
@@ -3,26 +3,6 @@ import { combineReducers as combineReducers$1 } from 'redux';
3
3
  import jamespot, { jEnsure, formatImgUrl, UserLevel, StudioApplicationStatus } from 'jamespot-user-api';
4
4
  import { v4 } from 'uuid';
5
5
 
6
- const adapter$1 = createEntityAdapter({
7
- selectId: (app) => app.name,
8
- sortComparer: (a, b) => a.label.localeCompare(b.label),
9
- });
10
- const slice$3 = createSlice({
11
- name: 'applications',
12
- initialState: adapter$1.getInitialState(),
13
- reducers: {
14
- addOne: adapter$1.addOne,
15
- addMany: adapter$1.addMany,
16
- setAll: adapter$1.setAll,
17
- },
18
- });
19
- const selectors$2 = adapter$1.getSelectors((state) => state.entities.applications);
20
- const Application = {
21
- slice: slice$3,
22
- actions: Object.assign({}, slice$3.actions),
23
- selectors: selectors$2,
24
- };
25
-
26
6
  /******************************************************************************
27
7
  Copyright (c) Microsoft Corporation.
28
8
 
@@ -60,6 +40,195 @@ function __awaiter(thisArg, _arguments, P, generator) {
60
40
  });
61
41
  }
62
42
 
43
+ const toastAdapter = createEntityAdapter({
44
+ selectId: (toast) => toast.id,
45
+ });
46
+ const slice$3 = createSlice({
47
+ name: 'toasts',
48
+ initialState: toastAdapter.getInitialState(),
49
+ reducers: {
50
+ addOne: toastAdapter.addOne,
51
+ removeOne: toastAdapter.removeOne,
52
+ },
53
+ });
54
+ const randomId = () => Math.random().toString(16).slice(2);
55
+ const addMessage = (_a, type, timeout) => {
56
+ var { id = randomId() } = _a, toast = __rest(_a, ["id"]);
57
+ if (type === void 0) { type = 'success'; }
58
+ if (timeout === void 0) { timeout = 3000; }
59
+ return (dispatch) => {
60
+ dispatch(slice$3.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
61
+ setTimeout(() => {
62
+ dispatch(slice$3.actions.removeOne(id));
63
+ }, timeout);
64
+ return id;
65
+ };
66
+ };
67
+ const actions = {
68
+ addMessage,
69
+ success: (toast, timeout) => addMessage(toast, 'success', timeout),
70
+ warning: (toast, timeout) => addMessage(toast, 'warning', timeout),
71
+ error: (toast, timeout) => addMessage(toast, 'error', timeout),
72
+ };
73
+ const selectors$2 = toastAdapter.getSelectors((state) => state.toasts);
74
+ const Toast = {
75
+ slice: slice$3,
76
+ actions: Object.assign(Object.assign({}, actions), slice$3.actions),
77
+ selectors: selectors$2,
78
+ };
79
+
80
+ const getAnimationsRTHandlers = function (dispatch) {
81
+ const addAnimationHandler = function (message) {
82
+ if (message.namespace === 'ANIMATIONS' &&
83
+ message.function === 'add') {
84
+ dispatch(fetchCurrentAnimation());
85
+ dispatch(fetchCurrentAnimationApp());
86
+ }
87
+ };
88
+ const deleteAnimationHandler = function (message) {
89
+ if (message.namespace === 'ANIMATIONS' &&
90
+ message.function === 'delete') {
91
+ dispatch(fetchCurrentAnimation());
92
+ dispatch(fetchCurrentAnimationApp());
93
+ }
94
+ };
95
+ const toggleIsActiveAnimationHandler = function (message) {
96
+ if (message.namespace === 'ANIMATIONS' &&
97
+ message.function === 'toggle') {
98
+ dispatch(fetchCurrentAnimation());
99
+ }
100
+ };
101
+ return [
102
+ {
103
+ namespace: 'ANIMATIONS',
104
+ function: 'add',
105
+ handler: addAnimationHandler,
106
+ },
107
+ {
108
+ namespace: 'ANIMATIONS',
109
+ function: 'delete',
110
+ handler: deleteAnimationHandler,
111
+ },
112
+ {
113
+ namespace: 'ANIMATIONS',
114
+ function: 'toggle',
115
+ handler: toggleIsActiveAnimationHandler,
116
+ },
117
+ ];
118
+ };
119
+
120
+ const initialState$k = {
121
+ animationConfiguration: null,
122
+ isActiveForCurrentUser: false,
123
+ isInitialized: false,
124
+ isToggleLoading: false,
125
+ };
126
+ const animationsSlice = createSlice({
127
+ name: 'animations',
128
+ initialState: initialState$k,
129
+ reducers: {},
130
+ extraReducers: (builder) => {
131
+ builder.addCase(fetchCurrentAnimation.fulfilled, (state, action) => {
132
+ state.isActiveForCurrentUser = action.payload.isActiveForCurrentUser;
133
+ state.animationConfiguration = action.payload.animationConfiguration;
134
+ state.isInitialized = action.payload.isInitialized;
135
+ });
136
+ builder.addCase(fetchCurrentAnimationApp.fulfilled, (state, action) => {
137
+ state.animationConfigurationApp = action.payload;
138
+ });
139
+ builder.addCase(toggleAnimationIsActive.pending, (state) => {
140
+ state.isToggleLoading = true;
141
+ });
142
+ builder.addCase(toggleAnimationIsActive.fulfilled, (state) => {
143
+ state.isToggleLoading = false;
144
+ });
145
+ builder.addCase(toggleAnimationIsActive.rejected, (state) => {
146
+ state.isToggleLoading = false;
147
+ });
148
+ },
149
+ });
150
+ const fetchCurrentAnimation = createAsyncThunk('animations/fetchCurrentAnimation', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
151
+ try {
152
+ const animationConfiguration = (yield extra.jApi.animations.GetCurrentAnimation()).result;
153
+ const isActiveForCurrentUser = (yield extra.jApi.animations.GetAnimationActive()).result;
154
+ return { animationConfiguration, isActiveForCurrentUser, isInitialized: true };
155
+ }
156
+ catch (_) {
157
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
158
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve animation' });
159
+ }
160
+ }));
161
+ const fetchCurrentAnimationApp = createAsyncThunk('animations/fetchCurrentAnimationApp', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
162
+ try {
163
+ return (yield extra.jApi.animations.GetCurrentAnimationApp()).result;
164
+ }
165
+ catch (_) {
166
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
167
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve animation' });
168
+ }
169
+ }));
170
+ const deleteCurrentAnimation = createAsyncThunk('animations/deleteCurrentAnimation', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
171
+ try {
172
+ yield extra.jApi.animations.DeleteAnimation();
173
+ return;
174
+ }
175
+ catch (_) {
176
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
177
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot delete animation' });
178
+ }
179
+ }));
180
+ const saveCurrentAnimation = createAsyncThunk('animations/saveCurrentAnimation', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
181
+ try {
182
+ yield extra.jApi.animations.SaveAnimationConfiguration(params);
183
+ return;
184
+ }
185
+ catch (_) {
186
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
187
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot update animation' });
188
+ }
189
+ }));
190
+ const toggleAnimationIsActive = createAsyncThunk('animations/toggleAnimationIsActive', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
191
+ try {
192
+ yield extra.jApi.animations.ToggleAnimationActive();
193
+ return;
194
+ }
195
+ catch (_) {
196
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
197
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot update animation' });
198
+ }
199
+ }));
200
+ const selectCurrentAnimation = (state) => state.animations.animationConfiguration;
201
+ const isActiveAnimation = (state) => state.animations.isActiveForCurrentUser;
202
+ const isToggleLoading = (state) => state.animations.isToggleLoading;
203
+ const selectAnimationConfigurationApp = (state) => state.animations.animationConfigurationApp;
204
+ const animationsReducer = animationsSlice.reducer;
205
+ const Animations = {
206
+ slice: animationsSlice,
207
+ actions: { saveCurrentAnimation, fetchCurrentAnimation, deleteCurrentAnimation, toggleAnimationIsActive, fetchCurrentAnimationApp },
208
+ selectors: { selectCurrentAnimation, isActiveAnimation, isToggleLoading, selectAnimationConfigurationApp },
209
+ getAnimationsRTHandlers
210
+ };
211
+
212
+ const adapter$1 = createEntityAdapter({
213
+ selectId: (app) => app.name,
214
+ sortComparer: (a, b) => a.label.localeCompare(b.label),
215
+ });
216
+ const slice$2 = createSlice({
217
+ name: 'applications',
218
+ initialState: adapter$1.getInitialState(),
219
+ reducers: {
220
+ addOne: adapter$1.addOne,
221
+ addMany: adapter$1.addMany,
222
+ setAll: adapter$1.setAll,
223
+ },
224
+ });
225
+ const selectors$1 = adapter$1.getSelectors((state) => state.entities.applications);
226
+ const Application = {
227
+ slice: slice$2,
228
+ actions: Object.assign({}, slice$2.actions),
229
+ selectors: selectors$1,
230
+ };
231
+
63
232
  const initialState$j = {
64
233
  entities: [],
65
234
  loading: 'idle',
@@ -195,43 +364,6 @@ const AssetReservation = {
195
364
  },
196
365
  };
197
366
 
198
- const toastAdapter = createEntityAdapter({
199
- selectId: (toast) => toast.id,
200
- });
201
- const slice$2 = createSlice({
202
- name: 'toasts',
203
- initialState: toastAdapter.getInitialState(),
204
- reducers: {
205
- addOne: toastAdapter.addOne,
206
- removeOne: toastAdapter.removeOne,
207
- },
208
- });
209
- const randomId = () => Math.random().toString(16).slice(2);
210
- const addMessage = (_a, type, timeout) => {
211
- var { id = randomId() } = _a, toast = __rest(_a, ["id"]);
212
- if (type === void 0) { type = 'success'; }
213
- if (timeout === void 0) { timeout = 3000; }
214
- return (dispatch) => {
215
- dispatch(slice$2.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
216
- setTimeout(() => {
217
- dispatch(slice$2.actions.removeOne(id));
218
- }, timeout);
219
- return id;
220
- };
221
- };
222
- const actions = {
223
- addMessage,
224
- success: (toast, timeout) => addMessage(toast, 'success', timeout),
225
- warning: (toast, timeout) => addMessage(toast, 'warning', timeout),
226
- error: (toast, timeout) => addMessage(toast, 'error', timeout),
227
- };
228
- const selectors$1 = toastAdapter.getSelectors((state) => state.toasts);
229
- const Toast = {
230
- slice: slice$2,
231
- actions: Object.assign(Object.assign({}, actions), slice$2.actions),
232
- selectors: selectors$1,
233
- };
234
-
235
367
  const initialState$g = {
236
368
  loading: 'idle',
237
369
  comments: [],
@@ -1656,6 +1788,22 @@ const widgetArticleTitleContent = {
1656
1788
  backgroundColor: 'transparent',
1657
1789
  };
1658
1790
 
1791
+ const widgetApiDefinition = {
1792
+ label: 'WIDGET_Api',
1793
+ description: 'WIDGET_Api_Description',
1794
+ name: 'widget-api',
1795
+ img: '/img/fast-intranet/widget-text.png',
1796
+ available: true,
1797
+ panel: {
1798
+ useWrapper: false,
1799
+ useEditor: true,
1800
+ useWidgets: false,
1801
+ },
1802
+ };
1803
+ const widgetApiContent = {
1804
+ url: '',
1805
+ };
1806
+
1659
1807
  const widgetArticleSliderDefinition = {
1660
1808
  label: 'WIDGET_Slider',
1661
1809
  description: 'WIDGET_Slider_Description',
@@ -1702,6 +1850,8 @@ function content(name) {
1702
1850
  default:
1703
1851
  case 'widget-article-attachment':
1704
1852
  return Object.assign({}, widgetArticleAttachmentContent);
1853
+ case 'widget-api':
1854
+ return Object.assign({}, widgetApiContent);
1705
1855
  case 'widget-article-slider':
1706
1856
  return Object.assign({}, widgetArticleSliderContent);
1707
1857
  case 'widget-article-gallery':
@@ -1750,6 +1900,8 @@ function widgetDefinition(name) {
1750
1900
  return widgetArticleTitleDefinition;
1751
1901
  case 'widget-article-image':
1752
1902
  return widgetArticleImageDefinition;
1903
+ case 'widget-api':
1904
+ return widgetApiDefinition;
1753
1905
  case 'widget-article-button':
1754
1906
  return widgetArticleButtonDefinition;
1755
1907
  }
@@ -2069,6 +2221,20 @@ const AppColumnsDefaultTypes = [
2069
2221
  AppFormItemTypes.DESCRIPTION,
2070
2222
  ];
2071
2223
  const AppFormPrimaryList = [AppFormItemTypes.DESCRIPTION];
2224
+ const AppFormFixedList$1 = [
2225
+ ExtraAppFieldsItemViews.TITLE,
2226
+ ExtraAppFieldsItemViews.PUBLISHTO,
2227
+ ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS,
2228
+ ExtraAppFieldsItemViews.RECEIVEACOPY,
2229
+ ExtraAppFieldsItemViews.USER,
2230
+ ExtraAppFieldsItemViews.CREATIONDATE,
2231
+ ];
2232
+ const AppFormNoAsFieldList = [
2233
+ ExtraAppFieldsItemViews.USER,
2234
+ ExtraAppFieldsItemViews.TITLE,
2235
+ ];
2236
+ const AppFormFieldOnlyInView = [AppFormItemTypes.CODEHTML];
2237
+ const AppFormNonPrimaryList = AppFormNoAsFieldList.concat(AppFormFieldOnlyInView).concat(AppFormPrimaryList);
2072
2238
 
2073
2239
  var StatusType;
2074
2240
  (function (StatusType) {
@@ -2253,7 +2419,7 @@ function migrateJson(v1Json) {
2253
2419
  : { propertyOptions: _renderSelectOptions((_g = v1FormItemProperties.options) !== null && _g !== void 0 ? _g : []) } }, baseProperty));
2254
2420
  }
2255
2421
  if (v1FormItemProperties.code) {
2256
- v2Properties.push(Object.assign({ propertyType: AppFieldFormPropertyTypes.RICHTEXT, value: v1FormItemProperties.code.html || v1FormItemProperties.code.text || '' }, baseProperty));
2422
+ v2Properties.push(Object.assign({ propertyType: AppFieldFormPropertyTypes.RICHTEXT, value: { html: v1FormItemProperties.code.html, text: v1FormItemProperties.code.text } }, baseProperty));
2257
2423
  }
2258
2424
  if (Object.prototype.hasOwnProperty.call(v1FormItemProperties, 'digits')) {
2259
2425
  v2Properties.push(Object.assign({ propertyType: AppFieldFormPropertyTypes.CHECKBOX, value: v1FormItemProperties.digits || false, checkBoxOptions: [{ label: 'APPSTUDIO_FormEditProps_Digits', value: v1FormItemProperties.digits }] }, baseProperty));
@@ -2333,6 +2499,7 @@ function migrateJson(v1Json) {
2333
2499
  }
2334
2500
 
2335
2501
  function InstalledAppStudioAdapter(serverApp, serverApps) {
2502
+ var _a, _b, _c, _d;
2336
2503
  const { version, dateCreation } = serverApp.manifest;
2337
2504
  const appTypeServer = serverApp.typeModel;
2338
2505
  const views = Object.assign({}, ...viewsList.map((view) => ({
@@ -2342,7 +2509,7 @@ function InstalledAppStudioAdapter(serverApp, serverApps) {
2342
2509
  idApp: serverApp.idApp,
2343
2510
  status: _formatStatus(serverApp),
2344
2511
  studioVersion: 2,
2345
- manifest: Object.assign({ appShortName: serverApp.name, appName: serverApp.label, description: serverApp.description, author: serverApp.author, cssColor: appTypeServer.cssColor, cssClass: { label: appTypeServer.cssClass, value: appTypeServer.cssClass }, version: version, dateCreation: dateCreation, checkAccess: serverApp.checkAccess, attrExposed: serverApp.attrExposed, viewSolr: serverApp.view, typeLabel: appTypeServer.typeLabel }, (serverApp.articlesCount && { articlesCount: serverApp.articlesCount })),
2512
+ manifest: Object.assign({ appShortName: serverApp.name, appName: serverApp.label, description: serverApp.description, author: serverApp.author, cssColor: (_a = appTypeServer.cssColor) !== null && _a !== void 0 ? _a : '#392994', cssClass: { label: (_b = appTypeServer.cssClass) !== null && _b !== void 0 ? _b : 'star', value: (_c = appTypeServer.cssClass) !== null && _c !== void 0 ? _c : 'star' }, version: version, dateCreation: dateCreation, checkAccess: serverApp.checkAccess, attrExposed: serverApp.attrExposed, viewSolr: serverApp.view, typeLabel: (_d = appTypeServer.typeLabel) !== null && _d !== void 0 ? _d : {} }, (serverApp.articlesCount && { articlesCount: serverApp.articlesCount })),
2346
2513
  fields: [],
2347
2514
  views,
2348
2515
  installFor: serverApp.accessRightObjectList,
@@ -2411,19 +2578,19 @@ function appToXml(studioApp) {
2411
2578
  const { manifest, views, audience, installFor } = studioApp;
2412
2579
  return `<?xml version='1.0' encoding='utf-8'?>
2413
2580
  <Application>
2414
- ${createAppManifest(manifest, views, audience, installFor)}
2581
+ ${createAppManifest(manifest, views, audience, installFor, studioApp.idApp)}
2415
2582
  <Types>
2416
2583
  <objecttype
2417
2584
  label="${manifest.typeLabel}"
2418
2585
  labelPlural="${manifest.typeLabel}"
2419
2586
  labelLinkSingular="${manifest.typeLabel}"
2420
2587
  labelLinkPlural="${manifest.typeLabel}"
2421
- name="${manifest.appShortName}"
2588
+ name="${studioApp.idApp}"
2422
2589
  classImpl="JPBEContent"
2423
2590
  classCodeLocation="jamespot/jpro/objs/JPBEContent.php"
2424
2591
  cssClass="${manifest.cssClass.value}"
2425
2592
  cssColor="${manifest.cssColor}"
2426
- searchtab="${manifest.appShortName}"
2593
+ searchtab="${studioApp.idApp}"
2427
2594
  searchtablabel="${manifest.typeLabel}"
2428
2595
  buttonlabel="${manifest.typeLabel}"
2429
2596
  extends="article">
@@ -2434,14 +2601,14 @@ function appToXml(studioApp) {
2434
2601
  </Types>
2435
2602
  </Application>`;
2436
2603
  }
2437
- function createAppManifest(manifest, views, audience, installFor) {
2604
+ function createAppManifest(manifest, views, audience, installFor, idApp) {
2438
2605
  var _a;
2439
2606
  return `<Manifest>
2440
2607
  <ShowImport>true</ShowImport>
2441
- <AppShortName>${manifest.appShortName}</AppShortName>
2608
+ <AppShortName>${idApp}</AppShortName>
2442
2609
  <AppName>${manifest.appName}</AppName>
2443
2610
  <Description>${manifest.description}</Description>
2444
- <Version>${manifest.version}</Version>
2611
+ <Version>${manifest.version + 1}</Version>
2445
2612
  <ManifestVersion>1.0</ManifestVersion>
2446
2613
  <StudioVersion>2</StudioVersion>
2447
2614
  <DateCreation>${manifest.dateCreation.toString().split('T')[0]}</DateCreation>
@@ -2450,7 +2617,7 @@ function createAppManifest(manifest, views, audience, installFor) {
2450
2617
  <Categories>N.A.</Categories>
2451
2618
  <Editor>Jamespot</Editor>
2452
2619
  <EditorUrl>https://www.fr.jamespot.com/</EditorUrl>
2453
- <Type>${manifest.appShortName}</Type>
2620
+ <Type>${idApp}</Type>
2454
2621
  ${renderAppView(manifest.viewSolr, views.list)}
2455
2622
  ${renderAppSearch(views.filter)}
2456
2623
  ${renderAudience(audience, installFor)}
@@ -2458,7 +2625,7 @@ function createAppManifest(manifest, views, audience, installFor) {
2458
2625
  </Manifest>`;
2459
2626
  }
2460
2627
  function renderAppView(viewSolr, listView) {
2461
- if (viewSolr === 'solr') {
2628
+ if (viewSolr === STUDIO_VIEW.SOLR) {
2462
2629
  let xml = '<AppView>solr</AppView>';
2463
2630
  const formItemIdInList = [];
2464
2631
  Object.entries(listView).forEach(([fieldId, field]) => {
@@ -2479,10 +2646,20 @@ function renderAppSearch(searchView) {
2479
2646
  }
2480
2647
  function getAttrNameFormItem(field, fieldId) {
2481
2648
  function fieldType() {
2649
+ if (field.type === ExtraAppFieldsItemViews.TITLE)
2650
+ return 'title';
2651
+ if (field.type === ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS)
2652
+ return 'sendAlert';
2653
+ if (field.type === ExtraAppFieldsItemViews.RECEIVEACOPY)
2654
+ return 'alertAuthor';
2655
+ if (field.type === ExtraAppFieldsItemViews.PUBLISHTO)
2656
+ return 'publishTo';
2482
2657
  if (field.type === ExtraAppFieldsItemViews.USER)
2483
2658
  return 'idUser';
2484
2659
  if (field.type === ExtraAppFieldsItemViews.CREATIONDATE)
2485
2660
  return 'dateCreation';
2661
+ if (field.type === AppFormItemTypes.DESCRIPTION)
2662
+ return 'description';
2486
2663
  return field.type;
2487
2664
  }
2488
2665
  return (AppColumnsDefaultTypes.includes(field.type) ? fieldType() : uuid2Alpha(fieldId)).toLowerCase();
@@ -2507,7 +2684,7 @@ function renderCustomFields(fields) {
2507
2684
  const filteredCustomFields = customFields === null || customFields === void 0 ? void 0 : customFields.filter((field) => field.type !== AppFormItemTypes.IMAGE);
2508
2685
  if (filteredCustomFields.length === 0)
2509
2686
  return '';
2510
- const articlesTablesItems = filteredCustomFields.filter((f) => f.type !== AppFormItemTypes.TAGS);
2687
+ const articlesTablesItems = filteredCustomFields.filter((f) => f.type !== AppFormItemTypes.TAGS && !AppFormNonPrimaryList.includes(f.type));
2511
2688
  const linksTableItems = filteredCustomFields.filter((f) => f.type === AppFormItemTypes.TAGS);
2512
2689
  return `<custom>
2513
2690
  ${articlesTablesItems.length > 0
@@ -2516,7 +2693,7 @@ function renderCustomFields(fields) {
2516
2693
  </articlemstable>`
2517
2694
  : ''}
2518
2695
  ${linksTableItems.length > 0
2519
- ? `<linkstable>
2696
+ ? `<linkstable tablename="tag_links" sqlNameColumn="name" sqlSrcIdColumn="srcId" sqlSrcTypeColumn="srcType" sqlTargetIdColumn="targetId" sqlTargetTypeColumn="targetType">
2520
2697
  ${linksTableItems.map((field) => formItem2xml(field)).join('')}
2521
2698
  </linkstable>`
2522
2699
  : ''}</custom>`;
@@ -2534,7 +2711,7 @@ function formItem2xml(field) {
2534
2711
  solr.indexed="true"
2535
2712
  solr.stored="true"
2536
2713
  solr.searchable="true"
2537
- solr.multiValued="${field.type === AppFormItemTypes.TAGS || (field.type === AppFormItemTypes.CHECKBOX && true) || false}"
2714
+ solr.multiValued="${field.type === AppFormItemTypes.TAGS || field.type === AppFormItemTypes.CHECKBOX ? true : false}"
2538
2715
  teaser="true"
2539
2716
  display="true"
2540
2717
  >
@@ -2580,14 +2757,16 @@ function renderWidget(fieldType, fieldProperties) {
2580
2757
  </widget>`;
2581
2758
  }
2582
2759
  case AppFormItemTypes.RADIO: {
2583
- const optionEditor = fieldProperties === null || fieldProperties === void 0 ? void 0 : fieldProperties.find((property) => property.propertyType === AppFieldFormPropertyTypes.CHECKBOX);
2760
+ const optionEditor = fieldProperties === null || fieldProperties === void 0 ? void 0 : fieldProperties.find((property) => property.propertyType === AppFieldFormPropertyTypes.OPTIONS_EDITOR);
2584
2761
  if (!optionEditor)
2585
2762
  return '';
2586
2763
  const options = optionEditor.value.propertyOptions;
2587
2764
  return `<widget form="radio">
2765
+ <options>
2588
2766
  ${options
2589
2767
  .map((option) => `<option value="${option.value}" label="${option.title}"></option>`)
2590
2768
  .join('')}
2769
+ </options>
2591
2770
  </widget>`;
2592
2771
  }
2593
2772
  case AppFormItemTypes.TOGGLE:
@@ -2609,14 +2788,14 @@ function renderWidget(fieldType, fieldProperties) {
2609
2788
  </widget>`;
2610
2789
  }
2611
2790
  case AppFormItemTypes.CHECKBOX: {
2612
- const optionEditor = fieldProperties === null || fieldProperties === void 0 ? void 0 : fieldProperties.find((property) => property.propertyType === AppFieldFormPropertyTypes.CHECKBOX);
2791
+ const optionEditor = fieldProperties === null || fieldProperties === void 0 ? void 0 : fieldProperties.find((property) => property.propertyType === AppFieldFormPropertyTypes.OPTIONS_EDITOR);
2613
2792
  if (!optionEditor)
2614
2793
  return '';
2615
2794
  const options = optionEditor.value.propertyOptions;
2616
2795
  return `<widget form="checkbox" multiple="1">
2617
2796
  <options>
2618
2797
  ${options
2619
- .map((option) => `<option value="${option.value}" label="${option.label}"></option>`)
2798
+ .map((option) => `<option value="${option.value}" label="${option.title}"></option>`)
2620
2799
  .join('')}
2621
2800
  </options>
2622
2801
  </widget>`;
@@ -2624,7 +2803,7 @@ function renderWidget(fieldType, fieldProperties) {
2624
2803
  case AppFormItemTypes.ADDFILEATTACHMENT:
2625
2804
  return `<widget form="file" type="fileArticle" multiple="1"></widget>`;
2626
2805
  case AppFormItemTypes.URL:
2627
- return `<widget form="url"`;
2806
+ return `<widget form="url"></widget>`;
2628
2807
  case AppFormItemTypes.EMAIL:
2629
2808
  return `<widget form="email"></widget>`;
2630
2809
  case ExtraAppFieldsItemViews.USER:
@@ -2637,7 +2816,7 @@ function renderWidget(fieldType, fieldProperties) {
2637
2816
  <param key="namespace" value="jamespot"></param>
2638
2817
  <param key="types" value="user"></param>
2639
2818
  <param key="views" value="user"></param>
2640
- <param key="jcomplete-url" value="/?action=ajax&amp;group=autocomplete&amp;export function=user"></param>
2819
+ <param key="jcomplete-url" value="/?action=ajax&amp;group=autocomplete&amp;function=user"></param>
2641
2820
  </params>
2642
2821
  </widget>`;
2643
2822
  case AppFormItemTypes.CONTENTLINK: {
@@ -2651,7 +2830,7 @@ function renderWidget(fieldType, fieldProperties) {
2651
2830
  <param key="namespace" value="jamespot"></param>
2652
2831
  <param key="types" value="${type}"></param>
2653
2832
  <param key="views" value="article"></param>
2654
- <param key="jcomplete-url" value="/?action=ajax&amp;group=autocomplete&amp;export function=article&amp;types=[]=${type}"></param>
2833
+ <param key="jcomplete-url" value="/?action=ajax&amp;group=autocomplete&amp;function=article&amp;types=[]=${type}"></param>
2655
2834
  </params>
2656
2835
  </widget>`;
2657
2836
  }
@@ -2771,7 +2950,7 @@ function renderDisplays(studioApp) {
2771
2950
  }
2772
2951
  });
2773
2952
  if (toRet.length > 0) {
2774
- toRet = `<displays type="${studioApp.manifest.appShortName}">${toRet}</displays>`;
2953
+ toRet = `<displays type="${studioApp.idApp}">${toRet}</displays>`;
2775
2954
  }
2776
2955
  return toRet;
2777
2956
  }
@@ -2789,6 +2968,8 @@ function getDisplayName(fieldId, view) {
2789
2968
  return 'idUser';
2790
2969
  case ExtraAppFieldsItemViews.CREATIONDATE:
2791
2970
  return 'dateCreation';
2971
+ case AppFormItemTypes.DESCRIPTION:
2972
+ return 'description';
2792
2973
  default:
2793
2974
  return uuid2Alpha(fieldId);
2794
2975
  }
@@ -2861,14 +3042,7 @@ function renderDisplayAttr(fieldId, view) {
2861
3042
  else {
2862
3043
  switch (view.type) {
2863
3044
  case AppFormItemTypes.CODEHTML: {
2864
- const content = {
2865
- ref: attrName,
2866
- fixedValue: {
2867
- html: view.value.html,
2868
- text: view.value.text,
2869
- },
2870
- };
2871
- xml += `<html><![CDATA[ <!-- <JAMESPOT.STUDIO.CODEHTML>${JSON.stringify(content)}</JAMESPOT.STUDIO.CODEHTML><JAMESPOT.STUDIO.FIELD_POS></JAMESPOT.STUDIO.FIELD_POS>-->]]></html>`;
3045
+ xml += `<html><![CDATA[ <!-- <JAMESPOT.STUDIO.CODEHTML>${view.value}</JAMESPOT.STUDIO.CODEHTML><JAMESPOT.STUDIO.FIELD_POS>${view.pos}</JAMESPOT.STUDIO.FIELD_POS>-->${view.value}]]></html>`;
2872
3046
  break;
2873
3047
  }
2874
3048
  case AppFormItemTypes.IMAGE:
@@ -2928,7 +3102,7 @@ const saveCurrentStudioApp = createAsyncThunk('studio/saveCurrentStudioApp', (_,
2928
3102
  return rejectWithValue(error);
2929
3103
  }
2930
3104
  }));
2931
- const installStudioApp = createAsyncThunk('studio/installApp', (_, { extra, rejectWithValue, getState, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
3105
+ const installStudioApp = createAsyncThunk('studio/installApp', ({ callback }, { extra, rejectWithValue, getState, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
2932
3106
  const jApi = extra.jApi;
2933
3107
  const error = { error: 1, errorMsg: 'Error saving application' };
2934
3108
  const currentStudioApp = getState().studio.currentStudioApp.currentStudioApp;
@@ -2938,7 +3112,9 @@ const installStudioApp = createAsyncThunk('studio/installApp', (_, { extra, reje
2938
3112
  const xml = appToXml(currentStudioApp);
2939
3113
  try {
2940
3114
  yield jApi.application.install(xml);
2941
- dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
3115
+ dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Installed' }));
3116
+ if (callback)
3117
+ callback();
2942
3118
  return;
2943
3119
  }
2944
3120
  catch (_) {
@@ -3067,7 +3243,7 @@ function createNewStudioApp$1({ author, appName }) {
3067
3243
  },
3068
3244
  version: 0.1,
3069
3245
  dateCreation: new Date().toISOString(),
3070
- viewSolr: 'solr',
3246
+ viewSolr: STUDIO_VIEW.SOLR,
3071
3247
  checkAccess: false,
3072
3248
  accessRightList: '',
3073
3249
  attrExposed: [],
@@ -3105,7 +3281,7 @@ const fetchStudioAppsList = createAsyncThunk('studio/appsList', (_, { extra, rej
3105
3281
  throw rejectWithValue({ error: 1, errorMsg: 'Error retrieving applications' });
3106
3282
  }
3107
3283
  }));
3108
- const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName }, { extra, dispatch, rejectWithValue, getState }) => __awaiter(void 0, void 0, void 0, function* () {
3284
+ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName, callback }, { extra, dispatch, rejectWithValue, getState }) => __awaiter(void 0, void 0, void 0, function* () {
3109
3285
  var _a;
3110
3286
  const jApi = extra.jApi;
3111
3287
  const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
@@ -3114,6 +3290,8 @@ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName }, {
3114
3290
  yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
3115
3291
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
3116
3292
  dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
3293
+ if (callback)
3294
+ callback();
3117
3295
  return newStudioApp;
3118
3296
  }
3119
3297
  catch (_) {
@@ -3207,7 +3385,10 @@ const StudioAppsListSlice = createSlice({
3207
3385
  state.deleteStudioAppStatus = 'idle';
3208
3386
  }
3209
3387
  state.studioAppsList = state.studioAppsList.reduce((acc, app) => {
3210
- const { idApp, status } = action.meta.arg;
3388
+ const { idApp } = action.meta.arg;
3389
+ let { status } = action.meta.arg;
3390
+ if (status === APP_STATUS_TYPE.INSTALLED)
3391
+ status = APP_STATUS_TYPE.SUSPENDED;
3211
3392
  if (app.idApp === idApp && app.status === status)
3212
3393
  return acc;
3213
3394
  if (app.inWorkVersion &&
@@ -3326,5 +3507,5 @@ const studio = {
3326
3507
  },
3327
3508
  };
3328
3509
 
3329
- export { APP_STATUS_TYPE, AUDIENCE, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormItemTypes, AppFormPrimaryList, AppFormUniqueList, Application, AssetReservation, Bookmark, Comment, ExtraAppFieldsItemViews, Faq, MODE_EDIT, MODE_VIEW, MapExtraFieldsWithView, Model, Network, Platform, STUDIO_VIEW, Share, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, jland, slice, studio, updateWidgetContent, viewsList };
3510
+ export { APP_STATUS_TYPE, AUDIENCE, Animations, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormFieldOnlyInView, AppFormFixedList$1 as AppFormFixedList, AppFormItemTypes, AppFormNoAsFieldList, AppFormNonPrimaryList, AppFormPrimaryList, AppFormUniqueList, Application, AssetReservation, Bookmark, Comment, ExtraAppFieldsItemViews, Faq, MODE_EDIT, MODE_VIEW, MapExtraFieldsWithView, Model, Network, Platform, STUDIO_VIEW, Share, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, animationsReducer, animationsSlice, deleteCurrentAnimation, fetchCurrentAnimation, fetchCurrentAnimationApp, jland, saveCurrentAnimation, slice, studio, toggleAnimationIsActive, updateWidgetContent, viewsList };
3330
3511
  //# sourceMappingURL=esm.js.map