Skip to content

Commit 7948930

Browse files
committed
!410 - update
1 parent 3d81964 commit 7948930

File tree

7 files changed

+161
-69
lines changed

7 files changed

+161
-69
lines changed

apps/Core/Components/Devtools/Modules/ModulesComponent.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ public function viewAction()
112112
) {
113113
$type = strtolower($this->getData()['type']);
114114

115-
if ($this->getData()['id'] != 0) {
116-
$this->view->type = $type;
115+
$this->view->type = $type;
116+
$this->view->module = null;
117117

118+
if ($this->getData()['id'] != 0) {
118119
if ($type === 'core') {
119120
$core = $this->core->core;
120121

@@ -146,11 +147,10 @@ public function viewAction()
146147
$view['dependencies'] = Json::encode($view['dependencies'], JSON_UNESCAPED_SLASHES);
147148

148149
$this->view->module = $view;
149-
150150
}
151151
}
152-
153-
return;
152+
} else {
153+
$this->view->pick('modules/list');
154154
}
155155
}
156156

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{adminltetags.useTag('content',
2+
[
3+
'component' : component,
4+
'componentName' : componentName,
5+
'componentId' : componentId,
6+
'parentComponentId' : parent,
7+
'sectionId' : 'main',
8+
'contentType' : 'section',
9+
'cardHeader' : true,
10+
'cardFooter' : false,
11+
'cardType' : 'primary',
12+
'cardIcon' : 'th',
13+
'cardTitle' : 'Modules',
14+
'cardAdditionalClass' : 'rounded-0',
15+
'cardBodyInclude' : 'modules/select'
16+
]
17+
)}}

apps/Core/Views/Default/html/devtools/modules/module/components.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{# {{dump(module)}} #}
1+
{% if module['id'] is defined %}
2+
{% set moduleDependencies = module['dependencies'] %}
3+
{% else %}
4+
{% set moduleDependencies = json_encode([], 16) %}
5+
{% endif %}
26
<form data-validateon="section" id="{{componentId}}-{{sectionId}}-form">
37
<fieldset id="{{componentId}}-{{sectionId}}-fieldset">
48
{{adminltetags.useTag('tabs',
@@ -52,7 +56,7 @@
5256
}
5357

5458
var modules = JSON.parse('{{modulesJson}}');
55-
var moduleDependencies = JSON.parse('{{module["dependencies"]}}');
59+
var moduleDependencies = JSON.parse('{{moduleDependencies}}');
5660

5761
dataCollectionSection =
5862
$.extend(dataCollectionSection, {

apps/Core/Views/Default/html/devtools/modules/module/components/dependencies.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{% if module['id'] is defined %}
2+
{% set moduleDependencies = module['dependencies'] %}
3+
{% else %}
4+
{% set moduleDependencies = json_encode([], 16) %}
5+
{% endif %}
16
<div class="row">
27
<div class="col">
38
{{adminltetags.useTag('fields',
@@ -138,7 +143,7 @@
138143
'fieldBazPostOnUpdate' : true,
139144
'fieldDataInputMaxLength' : 10000,
140145
'fieldTextareaRows' : 32,
141-
'fieldValue' : module['dependencies']
146+
'fieldValue' : moduleDependencies
142147
]
143148
)}}
144149
</div>

apps/Core/Views/Default/html/devtools/modules/module/components/info.html

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
{% if module['id'] is defined %}
2+
{% set moduleId = module['id'] %}
3+
{% set moduleName = module['name'] %}
4+
{% set moduleRoute = module['route'] %}
5+
{% set moduleDisplay_name = module['display_name'] %}
6+
{% set moduleDescription = module['description'] %}
7+
{% set moduleApp_type = module['app_type'] %}
8+
{% set moduleCategory = module['category'] %}
9+
{% set moduleSub_category = module['sub_category'] %}
10+
{% set moduleVersion = module['version'] %}
11+
{% set moduleRepo = module['repo'] %}
12+
{% set moduleClass = module['class'] %}
13+
{% set moduleSettings = module['settings'] %}
14+
{% set moduleMenu_id = module['menu_id'] %}
15+
{% set moduleMenu = module['menu'] %}
16+
{% set moduleApps = module['apps'] %}
17+
{% else %}
18+
{% set moduleId = '' %}
19+
{% set moduleName = '' %}
20+
{% set moduleRoute = '' %}
21+
{% set moduleDisplay_name = '' %}
22+
{% set moduleDescription = '' %}
23+
{% set moduleApp_type = '' %}
24+
{% set moduleCategory = '' %}
25+
{% set moduleSub_category = '' %}
26+
{% set moduleVersion = '' %}
27+
{% set moduleRepo = '' %}
28+
{% set moduleClass = '' %}
29+
{% set moduleSettings = '' %}
30+
{% set moduleMenu_id = '' %}
31+
{% set moduleMenu = '' %}
32+
{% set moduleApps = '' %}
33+
{% endif %}
134
{% if type === 'components' %}
235
{% set title = 'component' %}
336
{% elseif type === 'views' %}
@@ -22,7 +55,7 @@
2255
'fieldBazPostOnUpdate' : true,
2356
'fieldHidden' : true,
2457
'fieldDisabled' : true,
25-
'fieldValue' : module['id']
58+
'fieldValue' : moduleId
2659
]
2760
)}}
2861
{{adminltetags.useTag('fields',
@@ -65,7 +98,7 @@
6598
'fieldBazPostOnUpdate' : true,
6699
'fieldDataInputMinLength' : 1,
67100
'fieldDataInputMaxLength' : 50,
68-
'fieldValue' : module['name']
101+
'fieldValue' : moduleName
69102
]
70103
)}}
71104
</div>
@@ -87,7 +120,7 @@
87120
'fieldBazPostOnUpdate' : true,
88121
'fieldDataInputMinLength' : 1,
89122
'fieldDataInputMaxLength' : 50,
90-
'fieldValue' : module['route']
123+
'fieldValue' : moduleRoute
91124
]
92125
)}}
93126
</div>
@@ -110,7 +143,7 @@
110143
'fieldBazPostOnUpdate' : true,
111144
'fieldDataInputMinLength' : 1,
112145
'fieldDataInputMaxLength' : 50,
113-
'fieldValue' : module['display_name']
146+
'fieldValue' : moduleDisplay_name
114147
]
115148
)}}
116149
</div>
@@ -135,7 +168,7 @@
135168
'fieldBazPostOnUpdate' : true,
136169
'fieldDataInputMaxLength' : 1024,
137170
'fieldTextareaRows' : 2,
138-
'fieldValue' : module['description']
171+
'fieldValue' : moduleDescription
139172
]
140173
)}}
141174
</div>
@@ -158,7 +191,7 @@
158191
'fieldBazPostOnUpdate' : true,
159192
'fieldDataInputMinLength' : 1,
160193
'fieldDataInputMaxLength' : 50,
161-
'fieldValue' : module['app_type']
194+
'fieldValue' : moduleApp_type
162195
]
163196
)}}
164197
</div>
@@ -179,7 +212,7 @@
179212
'fieldBazPostOnUpdate' : true,
180213
'fieldDataInputMinLength' : 1,
181214
'fieldDataInputMaxLength' : 50,
182-
'fieldValue' : module['category']
215+
'fieldValue' : moduleCategory
183216
]
184217
)}}
185218
</div>
@@ -200,7 +233,7 @@
200233
'fieldBazPostOnUpdate' : true,
201234
'fieldDataInputMinLength' : 1,
202235
'fieldDataInputMaxLength' : 50,
203-
'fieldValue' : module['sub_category']
236+
'fieldValue' : moduleSub_category
204237
]
205238
)}}
206239
</div>
@@ -223,7 +256,7 @@
223256
'fieldBazPostOnUpdate' : true,
224257
'fieldDataInputMinLength' : 1,
225258
'fieldDataInputMaxLength' : 50,
226-
'fieldValue' : module['version']
259+
'fieldValue' : moduleVersion
227260
]
228261
)}}
229262
</div>
@@ -244,7 +277,7 @@
244277
'fieldBazPostOnUpdate' : true,
245278
'fieldDataInputMinLength' : 1,
246279
'fieldDataInputMaxLength' : 1024,
247-
'fieldValue' : module['repo']
280+
'fieldValue' : moduleRepo
248281
]
249282
)}}
250283
</div>
@@ -268,7 +301,7 @@
268301
'fieldBazPostOnUpdate' : true,
269302
'fieldDataInputMinLength' : 1,
270303
'fieldDataInputMaxLength' : 2048,
271-
'fieldValue' : module['class']
304+
'fieldValue' : moduleClass
272305
]
273306
)}}
274307
</div>
@@ -298,7 +331,7 @@
298331
'fieldBazPostOnUpdate' : true,
299332
'fieldDataInputMaxLength' : 1024,
300333
'fieldTextareaRows' : rows,
301-
'fieldValue' : module['settings']
334+
'fieldValue' : moduleSettings
302335
]
303336
)}}
304337
</div>
@@ -322,7 +355,7 @@
322355
'fieldBazPostOnUpdate' : true,
323356
'fieldDataInputMinLength' : 1,
324357
'fieldDataInputMaxLength' : 50,
325-
'fieldValue' : module['menu_id']
358+
'fieldValue' : moduleMenu_id
326359
]
327360
)}}
328361
</div>
@@ -344,7 +377,7 @@
344377
'fieldBazPostOnUpdate' : true,
345378
'fieldDataInputMaxLength' : 2048,
346379
'fieldTextareaRows' : 2,
347-
'fieldValue' : module['menu']
380+
'fieldValue' : moduleMenu
348381
]
349382
)}}
350383
</div>
@@ -369,7 +402,7 @@
369402
'fieldBazPostOnUpdate' : true,
370403
'fieldDataInputMaxLength' : 2048,
371404
'fieldTextareaRows' : 2,
372-
'fieldValue' : module['apps']
405+
'fieldValue' : moduleApps
373406
]
374407
)}}
375408
</div>

apps/Core/Views/Default/html/devtools/modules/select.html

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,48 @@
2020
]
2121
)}}
2222
</div>
23+
<div class="col">
24+
{{adminltetags.useTag('buttons',
25+
[
26+
'componentId' : componentId,
27+
'sectionId' : sectionId,
28+
'buttonType' : 'DropdownSplitButtons',
29+
'dropdownButtonId' : 'main',
30+
'dropdownButtonTitle' : 'Add New Module',
31+
'dropdownButtonIcon' : 'plus',
32+
'dropdownButtonAdditionalClass' : 'text-uppercase',
33+
'buttonPosition' : 'right',
34+
'dropdownAlign' : 'right',
35+
'buttons' :
36+
{
37+
'components' : {
38+
'title' : 'Component',
39+
'type' : 'primary',
40+
'additionalClass' : 'contentAjaxLink',
41+
'url' : links.url('devtools/modules/q/module/true/type/components/id/0')
42+
},
43+
'packages' : {
44+
'title' : 'Package',
45+
'type' : 'primary',
46+
'additionalClass' : 'contentAjaxLink',
47+
'url' : links.url('devtools/modules/q/module/true/type/packages/id/0')
48+
},
49+
'middlewares' : {
50+
'title' : 'Middleware',
51+
'type' : 'primary',
52+
'additionalClass' : 'contentAjaxLink',
53+
'url' : links.url('devtools/modules/q/module/true/type/middlewares/id/0')
54+
},
55+
'views' : {
56+
'title' : 'View',
57+
'type' : 'primary',
58+
'additionalClass' : 'contentAjaxLink',
59+
'url' : links.url('devtools/modules/q/module/true/type/views/id/0')
60+
}
61+
}
62+
]
63+
)}}
64+
</div>
2365
</div>
2466
<div class="row">
2567
<div class="col">
@@ -132,17 +174,19 @@
132174
});
133175

134176
dataCollectionSectionForm['funcs']['loadAjax'] = function(id = null, label = null, includecoremodules = false) {
177+
//eslint-disable-next-line
178+
console.log(dataCollectionSectionForm['vars']['url']);
135179
if (id && label) {
136180
if (dataCollectionSectionForm['vars']['url'].includes('/q/')) {
137-
dataCollectionSectionForm['vars']['url'] = dataCollectionSectionForm['vars']['url'] + '/module/true/type/' + label + '/id/' + id;
181+
dataCollectionSectionForm['vars']['url'] = '{{links.url("module/true/type/' + label + '/id/' + id + '")}}';
138182
} else {
139-
dataCollectionSectionForm['vars']['url'] = dataCollectionSectionForm['vars']['url'] + '/q/module/true/type/' + label + '/id/' + id;
183+
dataCollectionSectionForm['vars']['url'] = '{{links.url("devtools/modules/q/module/true/type/' + label + '/id/' + id + '")}}';
140184
}
141185
} else if (includecoremodules) {
142186
if (dataCollectionSectionForm['vars']['url'].includes('/q/')) {
143-
dataCollectionSectionForm['vars']['url'] = dataCollectionSectionForm['vars']['url'] + '/includecoremodules/true';
187+
dataCollectionSectionForm['vars']['url'] = '{{links.url("includecoremodules/true")}}';
144188
} else {
145-
dataCollectionSectionForm['vars']['url'] = dataCollectionSectionForm['vars']['url'] + '/q/includecoremodules/true';
189+
dataCollectionSectionForm['vars']['url'] = '{{links.url("devtools/modules/q/includecoremodules/true")}}';
146190
}
147191
} else {
148192
dataCollectionSectionForm['vars']['url'] = window['dataCollection']['env']['currentRoute'];

0 commit comments

Comments
 (0)