alchemy-chimera 1.2.1 → 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,7 @@
1
+ ## 1.2.2 (2023-02-26)
2
+
3
+ * Fix default menu items not being rendered properly
4
+
1
5
  ## 1.2.1 (2022-12-23)
2
6
 
3
7
  * Show field descriptions under the field title
@@ -304,7 +304,6 @@ al-field-translatable {
304
304
 
305
305
  height: 3rem;
306
306
  display: flex;
307
- flex-flow: column;
308
307
  justify-content: center;
309
308
  align-items: center;
310
309
 
@@ -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.0.5
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.2.1
29
+ * @version 1.2.2
30
30
  *
31
31
  * @param {Conduit} conduit
32
32
  */
@@ -95,16 +95,23 @@ ChimeraStatic.setAction(function sidebar(conduit) {
95
95
  models.sortByPath(1, 'model_name');
96
96
 
97
97
  for (let model of models) {
98
- widgets.push({
98
+ let entry = {
99
99
  type : 'link',
100
100
  config : {
101
- route : 'Chimera.Editor#index',
102
- parameters: [
103
- {name: 'model', value: model.type_name},
104
- ],
105
- content: model.title
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
106
109
  }
107
- });
110
+ };
111
+
112
+ console.log(entry)
113
+
114
+ widgets.push(entry);
108
115
  }
109
116
  }
110
117
 
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.1",
4
+ "version": "1.2.2",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",