Skip to content

Commit

Permalink
Release 5.8.16
Browse files Browse the repository at this point in the history
### Changelog:
* Fix(frontend): Fixed depend from fk field model setting.

See merge request vst/vst-utils!615
  • Loading branch information
onegreyonewhite committed Dec 5, 2023
2 parents b203b50 + 9c308d4 commit 2d70de9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend_src/vstutils/fields/dynamic/DependFromFkField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class DependFromFkField extends BaseField<unknown, unknown, XOptions> {
mergeDeep({ format, callback_opt }),
this.name,
);
if (!realField.model && this.model) {
realField.model = this.model;
}
if (this.app.store.page) {
realField.prepareFieldForView(this.app.store.page.view.path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,14 @@ describe('DependFromFkField', () => {
expect(fetchMock).toBeCalledTimes(2);
expect(app.store.page.sandbox.value).toBe(true);
});

test('model is set', () => {
const Attribute = app.modelsResolver.get('Attribute');
const PredefinedAttribute = app.modelsResolver.get('PredefinedAttribute');
expect(
Attribute.fields
.get('value')
.getRealField({ key: new PredefinedAttribute({ id: 1, field_type: 'boolean' }) }).model,
).toBe(Attribute);
});
});
2 changes: 1 addition & 1 deletion vstutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pylint: disable=django-not-available
__version__: str = '5.8.15'
__version__: str = '5.8.16'

0 comments on commit 2d70de9

Please sign in to comment.