alchemy-chimera 1.0.5 → 1.1.1

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,15 @@
1
+ ## 1.1.1 (2022-10-12)
2
+
3
+ * Add more alchemy-field options
4
+ * Disable translations when getting records from the chimera api
5
+ * Style inline translatable fields
6
+ * Style inline enum field view
7
+ * Fix sidebar routes not being marked as active
8
+
9
+ ## 1.1.0 (2022-07-23)
10
+
11
+ * Upgrade `alchemy-acl` and `alchemy-form`
12
+
1
13
  ## 1.0.5 (2022-07-06)
2
14
 
3
15
  * Fix page title containing 'undefined'
@@ -5,6 +5,7 @@ body {
5
5
  font-family: 'Roboto', sans-serif;
6
6
  }
7
7
 
8
+ .default-form-editor,
8
9
  .chimera-wrapper {
9
10
  --sidebar-bg-color: #4a4e58;
10
11
  --text-color: #475466;
@@ -24,7 +25,9 @@ body {
24
25
  --color-active: #3699FF;
25
26
  --color-text: #475466;
26
27
  --color-input-border: #CCD7E6;
28
+ }
27
29
 
30
+ .chimera-wrapper {
28
31
  display: flex;
29
32
  min-height: 100vh;
30
33
  width: 100%;
@@ -232,7 +235,8 @@ alchemy-widgets-navigation {
232
235
  color: white;
233
236
 
234
237
  &:hover,
235
- &.active-link {
238
+ &.active-link,
239
+ &.active-sublink {
236
240
  background-color: rgba(190, 190, 190, 0.5);
237
241
  }
238
242
  }
@@ -266,6 +270,71 @@ alchemy-widgets-navigation {
266
270
  opacity: 0;
267
271
  }
268
272
 
273
+ .alchemy-field-enum.alchemy-field-value {
274
+ margin: auto;
275
+ background: #777;
276
+ display: inline-block;
277
+ padding: 6px;
278
+ border-radius: 7px;
279
+ color: white;
280
+ }
281
+
282
+ alchemy-field-translatable {
283
+ .prefix-buttons {
284
+ width: 100%;
285
+ border-bottom: 1px solid var(--color-box-border);
286
+ display: flex;
287
+
288
+ button {
289
+ flex: 10;
290
+ font-size: 16px;
291
+ font-weight: 500;
292
+ color: var(--button-text-color);
293
+ letter-spacing: 0px;
294
+ background: transparent;
295
+ border: none;
296
+ cursor: pointer;
297
+
298
+ height: 3rem;
299
+ display: flex;
300
+ flex-flow: column;
301
+ justify-content: center;
302
+ align-items: center;
303
+
304
+ &.active {
305
+ box-shadow: inset 0 -2px var(--color-active);
306
+ }
307
+
308
+ &:hover {
309
+ background-color: var(--button-bg-hover-color);
310
+ }
311
+ }
312
+ }
313
+ }
314
+
315
+ alchemy-field[mode="inline"] {
316
+ alchemy-field-translatable {
317
+ .prefix-buttons {
318
+ button {
319
+ height: 2rem;
320
+ font-size: 14px;
321
+ }
322
+ }
323
+
324
+ .entries {
325
+
326
+ }
327
+ }
328
+
329
+ alchemy-field-translatable-entry {
330
+ display: block;
331
+ padding: 9px;
332
+ background: rgba(190,190,190,0.1);
333
+ min-height: 37px;
334
+ }
335
+ }
336
+
337
+ .default-form-editor,
269
338
  .chimera-wrapper {
270
339
 
271
340
  alchemy-table .aft-column-filters input {
@@ -280,7 +349,19 @@ alchemy-widgets-navigation {
280
349
  }
281
350
  }
282
351
 
283
- alchemy-field:not([view-type="view_inline"]):not([view-type="inline"]) {
352
+ alchemy-field {
353
+ .wrapped-inline {
354
+ > .field {
355
+ padding: 0 !important;
356
+ }
357
+ }
358
+ }
359
+
360
+ alchemy-field[mode="inline"] {
361
+ border: none;
362
+ }
363
+
364
+ alchemy-field:not([mode="inline"]) {
284
365
  border: 1px solid var(--color-box-border);
285
366
  background-color: white;
286
367
  border-radius: 4px;
@@ -297,39 +378,6 @@ alchemy-widgets-navigation {
297
378
  border-bottom: 1px solid var(--color-box-border);
298
379
  }
299
380
 
300
- alchemy-field-translatable {
301
- .prefix-buttons {
302
- width: 100%;
303
- border-bottom: 1px solid var(--color-box-border);
304
- display: flex;
305
-
306
- button {
307
- flex: 10;
308
- font-size: 16px;
309
- font-weight: 500;
310
- color: var(--button-text-color);
311
- letter-spacing: 0px;
312
- background: transparent;
313
- border: none;
314
- cursor: pointer;
315
-
316
- height: 3rem;
317
- display: flex;
318
- flex-flow: column;
319
- justify-content: center;
320
- align-items: center;
321
-
322
- &.active {
323
- box-shadow: inset 0 -2px var(--color-active);
324
- }
325
-
326
- &:hover {
327
- background-color: var(--button-bg-hover-color);
328
- }
329
- }
330
- }
331
- }
332
-
333
381
  .field {
334
382
  display: flex;
335
383
  padding: 1rem;
package/config/routes.js CHANGED
@@ -2,6 +2,8 @@
2
2
  // By default this will be /chimera
3
3
  let chimera_section = Router.section('chimera', '/' + alchemy.plugins.chimera.base_path);
4
4
 
5
+ chimera_section.requirePermission('chimera');
6
+
5
7
  // Link to the dashboard
6
8
  chimera_section.add({
7
9
  title : __('chimera', 'Dashboard'),
@@ -16,7 +18,7 @@ chimera_section.add({
16
18
  name : 'Chimera.Editor#index',
17
19
  methods : 'get',
18
20
  paths : '/editor/{model}/index',
19
- breadcrumb : 'chimera.editor.{model}.index'
21
+ breadcrumb : 'chimera.editor.{model}'
20
22
  });
21
23
 
22
24
  // Editor add action
@@ -227,7 +227,7 @@ Editor.setAction(async function trash(conduit, model_name, pk_val) {
227
227
  *
228
228
  * @author Jelle De Loecker <jelle@elevenways.be>
229
229
  * @since 1.0.0
230
- * @version 1.0.5
230
+ * @version 1.1.1
231
231
  *
232
232
  * @param {Conduit} conduit
233
233
  * @param {String} model_name
@@ -237,6 +237,8 @@ Editor.setAction(async function records(conduit, model_name) {
237
237
  let body = conduit.body,
238
238
  model = this.getModel(model_name),
239
239
  crit = model.find();
240
+
241
+ model.disableTranslations();
240
242
 
241
243
  let page_size = body.page_size,
242
244
  fields = body.fields,
@@ -299,12 +301,12 @@ Editor.setAction(async function records(conduit, model_name) {
299
301
 
300
302
  let trash_action = new Classes.Alchemy.Form.Action.Url({
301
303
  name : 'trash',
302
- icon : 'trash',
303
- placement : ['context'],
304
- url : alchemy.routeUrl('Chimera.Editor#trash', {
305
- model : model_name,
306
- pk : record.$pk,
307
- })
304
+ icon : 'trash',
305
+ placement : ['context'],
306
+ url : alchemy.routeUrl('Chimera.Editor#trash', {
307
+ model : model_name,
308
+ pk : record.$pk,
309
+ })
308
310
  });
309
311
 
310
312
  record.$hold.actions = [
@@ -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.0.2
68
+ * @version 1.1.1
69
69
  *
70
70
  * @param {String} action
71
71
  * @param {Conduit} conduit
@@ -94,7 +94,13 @@ Config.setMethod(function getWidgetConfig(action, conduit) {
94
94
  type : 'alchemy_field',
95
95
  config : {
96
96
  field : field.name,
97
+ purpose : field.options.purpose,
98
+ mode : field.options.mode,
99
+ readonly : field.options.readonly,
97
100
  view : field.options.view,
101
+ wrapper : field.options.wrapper,
102
+ data_src : field.options.data_src,
103
+ title : field.options.title,
98
104
  widget_settings : field.options.widget_settings || {},
99
105
  }
100
106
  });
@@ -131,7 +137,7 @@ Config.setMethod(function getWidgetConfig(action, conduit) {
131
137
  "type": "alchemy_form",
132
138
  "config": {
133
139
  model : this.ModelClass.type_name,
134
- view_type : 'edit',
140
+ purpose : 'edit',
135
141
  widgets : field_widgets
136
142
  }
137
143
  }
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.0.5",
4
+ "version": "1.1.1",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",
@@ -11,9 +11,10 @@
11
11
  ],
12
12
  "repository": "11ways/alchemy-chimera",
13
13
  "peerDependencies": {
14
- "alchemy-acl" : "~0.7.0",
15
- "alchemymvc" : "~1.2.4",
16
- "alchemy-widget": "~0.1.2"
14
+ "alchemy-acl" : "~0.8.0",
15
+ "alchemymvc" : "~1.2.4",
16
+ "alchemy-form" : "~0.1.11",
17
+ "alchemy-widget" : "~0.1.5"
17
18
  },
18
19
  "license": "MIT",
19
20
  "engines": {