@reldens/cms 0.72.0 → 0.74.0
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.
|
@@ -295,6 +295,25 @@ window.addEventListener('DOMContentLoaded', () => {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
let duplicateButton = document.querySelector('.button-duplicate');
|
|
299
|
+
if(duplicateButton){
|
|
300
|
+
duplicateButton.addEventListener('click', () => {
|
|
301
|
+
let editForm = document.querySelector('#edit-form');
|
|
302
|
+
if(!editForm){
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
let idValueInput = editForm.querySelector('.entity-id-value');
|
|
306
|
+
if(idValueInput){
|
|
307
|
+
idValueInput.value = '';
|
|
308
|
+
}
|
|
309
|
+
let titleElement = document.querySelector('.entity-edit h2');
|
|
310
|
+
if(titleElement){
|
|
311
|
+
titleElement.textContent = 'Duplicate';
|
|
312
|
+
}
|
|
313
|
+
duplicateButton.classList.add('hidden');
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
298
317
|
// shutdown timer:
|
|
299
318
|
let shuttingDownTimeElement = document.querySelector('.shutting-down .shutting-down-time');
|
|
300
319
|
if(shuttingDownTimeElement){
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
<button class="button button-primary button-submit" type="submit" form="edit-form" name="saveAction" value="save">Save</button>
|
|
5
5
|
<button class="button button-primary button-submit" type="submit" form="edit-form" name="saveAction" value="saveAndContinue">Save and continue...</button>
|
|
6
6
|
<button class="button button-primary button-submit" type="submit" form="edit-form" name="saveAction" value="saveAndGoBack">Save and go back</button>
|
|
7
|
+
{{#idValue}}<button class="button button-secondary button-duplicate" type="button">Duplicate</button>{{/idValue}}
|
|
7
8
|
<a class="button button-secondary button-back" href="{{&entityViewRoute}}">Cancel</a>
|
|
8
9
|
</div>
|
|
9
10
|
<div class="extra-actions">
|
|
10
11
|
{{&extraContent}}
|
|
11
12
|
</div>
|
|
12
13
|
<form name="edit-form" id="edit-form" action="{{&entitySaveRoute}}" method="post"{{&multipartFormData}}>
|
|
13
|
-
<input type="hidden" name="{{&idProperty}}" value="{{&idValue}}"/>
|
|
14
|
+
<input type="hidden" class="entity-id-value" name="{{&idProperty}}" value="{{&idValue}}"/>
|
|
14
15
|
<div class="edit-field">
|
|
15
16
|
<span class="field-name">{{&idPropertyLabel}}</span>
|
|
16
17
|
<span class="field-value">
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
<button class="button button-primary button-submit" type="submit" name="saveAction" value="save">Save</button>
|
|
29
30
|
<button class="button button-primary button-submit" type="submit" name="saveAction" value="saveAndContinue">Save and continue...</button>
|
|
30
31
|
<button class="button button-primary button-submit" type="submit" name="saveAction" value="saveAndGoBack">Save and go back</button>
|
|
32
|
+
{{#idValue}}<button class="button button-secondary button-duplicate" type="button">Duplicate</button>{{/idValue}}
|
|
31
33
|
<a class="button button-secondary button-back" href="{{&entityViewRoute}}">Cancel</a>
|
|
32
34
|
</div>
|
|
33
35
|
</form>
|
|
@@ -346,7 +346,7 @@ class RouterContents
|
|
|
346
346
|
if(!saveResult){
|
|
347
347
|
Logger.error('Save result error.', saveResult, entityDataPatch);
|
|
348
348
|
return this.generateEntityRoute('editPath', driverResource, idProperty, null, id)
|
|
349
|
-
+'
|
|
349
|
+
+'&result=saveEntityStorageError';
|
|
350
350
|
}
|
|
351
351
|
await this.emitEvent('reldens.adminAfterEntitySave', {
|
|
352
352
|
req,
|
|
@@ -774,15 +774,15 @@ class RouterContents
|
|
|
774
774
|
}
|
|
775
775
|
let multiple = resourceProperty.isArray ? 's' : '';
|
|
776
776
|
let allowedTypes = sc.get(resourceProperty, 'allowedTypes', '');
|
|
777
|
+
if('text' === allowedTypes){
|
|
778
|
+
return 'link'+multiple;
|
|
779
|
+
}
|
|
777
780
|
if('' !== allowedTypes){
|
|
778
781
|
let templateName = allowedTypes + multiple;
|
|
779
782
|
if(sc.hasOwn(this.adminFilesContents.fields.view, templateName)){
|
|
780
783
|
return templateName;
|
|
781
784
|
}
|
|
782
785
|
}
|
|
783
|
-
if('text' === allowedTypes){
|
|
784
|
-
return 'link'+multiple
|
|
785
|
-
}
|
|
786
786
|
return 'text';
|
|
787
787
|
}
|
|
788
788
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reldens/cms",
|
|
3
3
|
"scope": "@reldens",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.74.0",
|
|
5
5
|
"description": "Reldens - CMS",
|
|
6
6
|
"author": "Damian A. Pastorini",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@reldens/server-utils": "^0.53.0",
|
|
38
|
-
"@reldens/storage": "^0.
|
|
38
|
+
"@reldens/storage": "^0.103.0",
|
|
39
39
|
"@reldens/utils": "^0.57.0",
|
|
40
40
|
"dotenv": "17.4.2",
|
|
41
41
|
"mustache": "4.2.0"
|