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

Fix reading of asset type from schema #2416

Closed
tomgreenfield opened this issue Aug 21, 2019 · 2 comments
Closed

Fix reading of asset type from schema #2416

tomgreenfield opened this issue Aug 21, 2019 · 2 comments
Assignees
Labels
S: merged Completed, reviewed, and merged issues
Milestone

Comments

@tomgreenfield
Copy link
Contributor

Expected Behaviour

As part of the scaffold refactor in version 0.6, we strived to standardise the schema input types. This included removing the need to scrub strings with regular expressions, and instead allowing an object to specfiy options. For an asset, the desired schema includes a media field:

"_photo": {
  "type": "string",
  "default": "",
  "title": "Photo",
  "inputType": {
    "type": "Asset",
    "media": "image"
  },
  "help": "Select a photo"
}

Actual Behaviour

Although the scaffold can already handle it, asset management errors with the new schema:

assetManagementModalView.js:28 Uncaught TypeError: this.options.assetType.replace is not a function

There are also some tweaks needed to the new theme editor.

Steps to Reproduce

  1. Update an asset field to use the new inputType
  2. Click Select an asset on the form

Versions

  • Authoring Tool Version: 0.9
@canstudios-nicolaw
Copy link
Contributor

@tomgreenfield Please could you be a bit more explicit about step 1 on the reproduce instructions? Would help with testing

@tomgreenfield
Copy link
Contributor Author

For example, this input type:

"inputType": "Asset:image"

would be updated to:

"inputType": {
  "type": "Asset",
  "media": "image"
}

@tomgreenfield tomgreenfield added the S: merged Completed, reviewed, and merged issues label Oct 1, 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