alchemy-chimera 1.2.0 → 1.2.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 1.2.2 (2023-02-26)
|
|
2
|
+
|
|
3
|
+
* Fix default menu items not being rendered properly
|
|
4
|
+
|
|
5
|
+
## 1.2.1 (2022-12-23)
|
|
6
|
+
|
|
7
|
+
* Show field descriptions under the field title
|
|
8
|
+
* Prevent images inside al-field widget editor from being too tall
|
|
9
|
+
* Use `al-button` & `hawkejs_template` for the save button
|
|
10
|
+
|
|
1
11
|
## 1.2.0 (2022-11-02)
|
|
2
12
|
|
|
3
13
|
* Update to `alchemy-form` v0.2.0
|
|
@@ -200,6 +200,10 @@ body {
|
|
|
200
200
|
margin-bottom: 1rem;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
.form-field-info {
|
|
204
|
+
background-color: #F4F5F9;
|
|
205
|
+
}
|
|
206
|
+
|
|
203
207
|
.form-field-info label,
|
|
204
208
|
.form-field-info al-label {
|
|
205
209
|
display: block;
|
|
@@ -300,7 +304,6 @@ al-field-translatable {
|
|
|
300
304
|
|
|
301
305
|
height: 3rem;
|
|
302
306
|
display: flex;
|
|
303
|
-
flex-flow: column;
|
|
304
307
|
justify-content: center;
|
|
305
308
|
align-items: center;
|
|
306
309
|
|
|
@@ -379,6 +382,18 @@ al-field[mode="inline"] {
|
|
|
379
382
|
font-weight: 500;
|
|
380
383
|
color: var(--color-title);
|
|
381
384
|
border-bottom: 1px solid var(--color-box-border);
|
|
385
|
+
display: flex;
|
|
386
|
+
flex-flow: column;
|
|
387
|
+
|
|
388
|
+
[data-he-name="field-description"] {
|
|
389
|
+
line-height: 1;
|
|
390
|
+
margin-bottom: 1rem;
|
|
391
|
+
color:gray;
|
|
392
|
+
|
|
393
|
+
&:empty {
|
|
394
|
+
display: none;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
382
397
|
}
|
|
383
398
|
|
|
384
399
|
.field {
|
|
@@ -549,4 +564,13 @@ al-field[mode="inline"] {
|
|
|
549
564
|
background: initial;
|
|
550
565
|
}
|
|
551
566
|
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
al-field {
|
|
570
|
+
// Don't let images in widgets take up more then 1/4th of the screen height
|
|
571
|
+
al-widget {
|
|
572
|
+
img {
|
|
573
|
+
max-height: 25vh;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
552
576
|
}
|
|
@@ -125,7 +125,7 @@ Editor.setAction(async function add(conduit, model_name) {
|
|
|
125
125
|
*
|
|
126
126
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
127
127
|
* @since 0.1.0
|
|
128
|
-
* @version 1.
|
|
128
|
+
* @version 1.2.2
|
|
129
129
|
*
|
|
130
130
|
* @param {Conduit} conduit
|
|
131
131
|
* @param {String} model_name
|
|
@@ -138,6 +138,11 @@ Editor.setAction(async function edit(conduit, model_name, pk_val) {
|
|
|
138
138
|
model.translateItems = false;
|
|
139
139
|
|
|
140
140
|
let record = await model.findByPk(pk_val);
|
|
141
|
+
|
|
142
|
+
if (!record) {
|
|
143
|
+
return conduit.notFound('Unable to find record with primary key "' + pk_val + '"');
|
|
144
|
+
}
|
|
145
|
+
|
|
141
146
|
let message_type = conduit.param('message');
|
|
142
147
|
|
|
143
148
|
record.keepPrivateFields();
|
|
@@ -26,7 +26,7 @@ ChimeraStatic.setAction(function dashboard(conduit) {
|
|
|
26
26
|
*
|
|
27
27
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
28
28
|
* @since 1.0.0
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.2.2
|
|
30
30
|
*
|
|
31
31
|
* @param {Conduit} conduit
|
|
32
32
|
*/
|
|
@@ -64,8 +64,11 @@ ChimeraStatic.setAction(function sidebar(conduit) {
|
|
|
64
64
|
widgets.push({
|
|
65
65
|
type : 'link',
|
|
66
66
|
config : {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
link_type : 'href',
|
|
68
|
+
link_settings : {
|
|
69
|
+
href : entry.href,
|
|
70
|
+
},
|
|
71
|
+
text: title
|
|
69
72
|
}
|
|
70
73
|
});
|
|
71
74
|
} else {
|
|
@@ -73,11 +76,14 @@ ChimeraStatic.setAction(function sidebar(conduit) {
|
|
|
73
76
|
widgets.push({
|
|
74
77
|
type : 'link',
|
|
75
78
|
config : {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
link_type : 'route',
|
|
80
|
+
link_settings: {
|
|
81
|
+
route : 'Chimera.Editor#index',
|
|
82
|
+
parameters: [
|
|
83
|
+
{name: 'model', value: model.constructor.type_name},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
text: title
|
|
81
87
|
}
|
|
82
88
|
});
|
|
83
89
|
}
|
|
@@ -89,16 +95,23 @@ ChimeraStatic.setAction(function sidebar(conduit) {
|
|
|
89
95
|
models.sortByPath(1, 'model_name');
|
|
90
96
|
|
|
91
97
|
for (let model of models) {
|
|
92
|
-
|
|
98
|
+
let entry = {
|
|
93
99
|
type : 'link',
|
|
94
100
|
config : {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
link_type: 'route',
|
|
102
|
+
link_settings: {
|
|
103
|
+
route : 'Chimera.Editor#index',
|
|
104
|
+
parameters: [
|
|
105
|
+
{name: 'model', value: model.type_name},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
text: model.title
|
|
100
109
|
}
|
|
101
|
-
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
console.log(entry)
|
|
113
|
+
|
|
114
|
+
widgets.push(entry);
|
|
102
115
|
}
|
|
103
116
|
}
|
|
104
117
|
|
package/lib/chimera_config.js
CHANGED
|
@@ -65,7 +65,7 @@ Config.setMethod(function getFieldSet(name) {
|
|
|
65
65
|
*
|
|
66
66
|
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
67
67
|
* @since 1.0.0
|
|
68
|
-
* @version 1.2.
|
|
68
|
+
* @version 1.2.1
|
|
69
69
|
*
|
|
70
70
|
* @param {String} action
|
|
71
71
|
* @param {Conduit} conduit
|
|
@@ -154,9 +154,28 @@ Config.setMethod(function getWidgetConfig(action, conduit) {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
action_widgets.push({
|
|
157
|
-
type : '
|
|
157
|
+
type : 'hawkejs_template',
|
|
158
158
|
config : {
|
|
159
|
-
|
|
159
|
+
sourcecode : `
|
|
160
|
+
<al-button class="btn btn-submit" behaviour="submit">
|
|
161
|
+
<al-state state-name="default">
|
|
162
|
+
<al-icon icon-style="duotone" icon-name="floppy-disk"></al-icon>
|
|
163
|
+
{%t "save" %}
|
|
164
|
+
</al-state>
|
|
165
|
+
<al-state state-name="error">
|
|
166
|
+
<al-icon icon-style="duotone" icon-name="skull" icon-flags="shake"></al-icon>
|
|
167
|
+
{%t "error" action="save" %}
|
|
168
|
+
</al-state>
|
|
169
|
+
<al-state state-name="done">
|
|
170
|
+
<al-icon icon-style="duotone" icon-name="badge-check" icon-flags="beat"></al-icon>
|
|
171
|
+
{%t "saved" %}
|
|
172
|
+
</al-state>
|
|
173
|
+
<al-state state-name="busy">
|
|
174
|
+
<al-icon icon-style="duotone" icon-name="spinner" icon-flags="spin"></al-icon>
|
|
175
|
+
{%t "saving" %}
|
|
176
|
+
</al-state>
|
|
177
|
+
</al-button>
|
|
178
|
+
`
|
|
160
179
|
}
|
|
161
180
|
});
|
|
162
181
|
|
|
@@ -191,7 +210,7 @@ Config.setMethod(function getWidgetConfig(action, conduit) {
|
|
|
191
210
|
]
|
|
192
211
|
}
|
|
193
212
|
},
|
|
194
|
-
{
|
|
213
|
+
/*{
|
|
195
214
|
type: 'column',
|
|
196
215
|
config: {
|
|
197
216
|
wrapper_class_names: 'toc-col',
|
|
@@ -206,7 +225,7 @@ Config.setMethod(function getWidgetConfig(action, conduit) {
|
|
|
206
225
|
}
|
|
207
226
|
]
|
|
208
227
|
}
|
|
209
|
-
}
|
|
228
|
+
}*/
|
|
210
229
|
]
|
|
211
230
|
}
|
|
212
231
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy-chimera",
|
|
3
3
|
"description": "Chimera plugin for Alchemy MVC",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"author": "Jelle De Loecker <jelle@elevenways.be>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"alchemy",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"repository": "11ways/alchemy-chimera",
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"alchemy-acl" : "~0.8.3",
|
|
15
|
-
"alchemymvc" : "
|
|
16
|
-
"alchemy-form" : "~0.2.
|
|
17
|
-
"alchemy-widget" : "~0.2.
|
|
15
|
+
"alchemymvc" : ">=1.2.7",
|
|
16
|
+
"alchemy-form" : "~0.2.1",
|
|
17
|
+
"alchemy-widget" : "~0.2.1"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"engines": {
|