Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oxixes committed Jan 22, 2025
1 parent 9cbb66b commit 00c828b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wirecloud/platform/context/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ class Meta:
db_table = 'wirecloud_constant'

def __str__(self):
return self.concept.concept
return self.concept
2 changes: 1 addition & 1 deletion src/wirecloud/platform/context/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_constant_context_values():

constants = Constant.objects.all()
for constant in constants:
res[constant.concept.concept] = constant.value
res[constant.concept] = constant.value

return res

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
const on_workspace_unload = function on_workspace_unload(workspace) {
// This must be always the case
// if (this.model === workspace) {
this.model.operators.forEach((operator) => {
operator.unload(true);
});

this.model = null;
this.editButton.enabled = false;
this.editButton.active = false;
Expand Down
15 changes: 15 additions & 0 deletions src/wirecloud/platform/static/js/wirecloud/wiring/Operator.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,21 @@
return Promise.resolve(this);
}

/**
* Unload the operator.
*/
unload(onlyv2 = false) {
if (!this.loaded) {
return;
}

if (onlyv2 && this.meta.macversion <= 1) {
return;
}

on_unload.call(this);
}

/**
* @returns {Wirecloud.wiring.Operator}
*/
Expand Down

0 comments on commit 00c828b

Please sign in to comment.