Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editable theme check is not robust enough #2360

Closed
tomgreenfield opened this issue Jun 10, 2019 · 0 comments
Closed

Editable theme check is not robust enough #2360

tomgreenfield opened this issue Jun 10, 2019 · 0 comments
Assignees
Labels
S: merged Completed, reviewed, and merged issues

Comments

@tomgreenfield
Copy link
Contributor

We have some legacy themes which are wrongly identified as being editable because they contain more than one property in their schema i.e. both _screenSize and pluginLocations.

themeIsEditable: function(theme) {
var props = theme && theme.get('properties');
if (!props) {
return false;
}
if (Object.keys(props).length === 1) {
if (props.hasOwnProperty('pluginLocations')) {
return false;
}
// For old themes
if (props.hasOwnProperty('_screenSize')) {
return false;
}
}
return true;
},

Since we switched to having all theme variables in a nested object, this function can be greatly simplified to something like:

themeIsEditable: function(theme) {
  var props = theme && theme.get('properties');

  return props && props.variables;
}

Versions

  • Authoring Tool Version: 0.8.1
  • Framework Version: 2.4.0
@canstudios-nicolaw canstudios-nicolaw added this to the Bugpatch milestone Jul 8, 2019
@canstudios-nicolaw canstudios-nicolaw self-assigned this Jul 12, 2019
@canstudios-nicolaw canstudios-nicolaw added the S: in-progress Issues currently being worked on - leave these be! label Jul 12, 2019
@canstudios-nicolaw canstudios-nicolaw added S: awaiting-review Completed issues waiting on reviews S: merged Completed, reviewed, and merged issues and removed S: in-progress Issues currently being worked on - leave these be! S: awaiting-review Completed issues waiting on reviews labels Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: merged Completed, reviewed, and merged issues
Projects
None yet
Development

No branches or pull requests

2 participants