@kaspernj/api-maker 1.0.288 → 1.0.290
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/package.json
CHANGED
package/src/table/table.jsx
CHANGED
|
@@ -185,6 +185,13 @@ class ApiMakerTable extends React.PureComponent {
|
|
|
185
185
|
"showNoRecordsFoundContent"
|
|
186
186
|
)
|
|
187
187
|
|
|
188
|
+
if (collection && collection.args.modelClass != modelClass) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
`Model class from collection '${collection.args.modelClass.modelClassData().name}' ` +
|
|
191
|
+
`didn't match model class on table: '${modelClass.modelClassData().name}'`
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
188
195
|
return (
|
|
189
196
|
<div className={this.className()}>
|
|
190
197
|
{preload !== undefined &&
|
|
@@ -365,6 +372,7 @@ class ApiMakerTable extends React.PureComponent {
|
|
|
365
372
|
<input
|
|
366
373
|
className="btn btn-primary live-table--submit-filter-button"
|
|
367
374
|
type="submit"
|
|
375
|
+
style={{marginTop: "8px"}}
|
|
368
376
|
value={filterSubmitLabel || I18n.t("js.api_maker_bootstrap.live_table.filter")}
|
|
369
377
|
/>
|
|
370
378
|
}
|
package/src/with-model.jsx
CHANGED
|
@@ -76,6 +76,7 @@ export default (WrappedComponent, modelClassArg, argsArg = {}) => {
|
|
|
76
76
|
const ModelClass = digg(this, "modelClass")
|
|
77
77
|
const query = await ModelClass.ransack({id_eq: modelId})
|
|
78
78
|
|
|
79
|
+
if (!modelId) throw new Error(`No model ID was given: ${modelId} by '${this.paramsVariableName}' in query params: ${Object.keys(this.props.match.params).join(", ")}`)
|
|
79
80
|
if (this.args.abilities) query.abilities(this.args.abilities)
|
|
80
81
|
if (this.args.preload) query.preload(this.args.preload)
|
|
81
82
|
if (this.args.select) query.select(this.args.select)
|