Skip to content

Detect Lovelace resource type based on file extension#7354

Merged
bramkragten merged 6 commits intohome-assistant:devfrom
spacegaier:res-file-type-detect
Oct 19, 2020
Merged

Detect Lovelace resource type based on file extension#7354
bramkragten merged 6 commits intohome-assistant:devfrom
spacegaier:res-file-type-detect

Conversation

@spacegaier
Copy link
Member

@spacegaier spacegaier commented Oct 15, 2020

Breaking change

Proposed change

Automatically detect the resource type based on the extension. Initially we now start with an empty dropdown. As long as it is empty and as soon as an URL is inserted we will check for extensions "js" and "css" to automatically determine the type.

One the dropdown has a value we no longer update it, even if the URL is changed, but the user can still manually change/override the selection.

CD2C45C7-A4BF-4EBC-A8DA-7F2264655FE9

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@spacegaier spacegaier requested a review from zsarnett October 15, 2020 22:41
@spacegaier spacegaier requested a review from zsarnett October 16, 2020 04:48
@spacegaier
Copy link
Member Author

The fact that we currently allow duplicate URLs is something the backend should correct I guess.

image

@bramkragten bramkragten merged commit 990ae10 into home-assistant:dev Oct 19, 2020
@spacegaier spacegaier deleted the res-file-type-detect branch October 19, 2020 20:23
@bramkragten bramkragten mentioned this pull request Oct 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resources: automatically change resource type dropdown depending on file extension

4 participants