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: check for invalid speedometer names #110

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

Trainermitch
Copy link
Contributor

@Trainermitch Trainermitch commented Dec 9, 2023

Deleting a speedometer with the same name as an existing speedometer results in an underlying object js exception. This is because this.detailObject.findIndex() inside deleteSpeedometer() deletes the first speedometer matching the name of the selected speedometer. I have changed speedometer-select.js to check for these invalid names (mostly used the same code from range-color-profile-name.js). This also makes it consistent with deleting and adding range profiles.

Checks

  • I have thoroughly tested all of the code I have modified/added/removed to ensure something else did not break
  • I have followed semantic commit messages e.g. feat: Add foo, chore: Update bar, etc...
  • My branch has a clear history of changes that can be easy to follow when being reviewed commit-by-commit
  • My branch is functionally complete; the only changes to be done will be those potentially requested in code review
  • All changes requested in review have been fixuped into my original commits.
  • Fully tokenized all my strings (no hardcoded English strings!!) and supplied bulk JSON strings below

POEditor JSON Strings (if needed)

[
	{
		"term": "#Settings_Speedometer_InvalidName",
		"definition": "Invalid speedometer name!"
	}
]

scripts/pages/settings/speedometer.js Outdated Show resolved Hide resolved
scripts/modals/popups/speedometer-select.js Outdated Show resolved Hide resolved
scripts/modals/popups/speedometer-select.js Show resolved Hide resolved
Copy link
Member

@tsa96 tsa96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Trainermitch
Copy link
Contributor Author

Also, do I just need to supply the tokenized string or do I need to actually add it somewhere?

layout/modals/popups/speedometer-select.xml Outdated Show resolved Hide resolved
@tsa96
Copy link
Member

tsa96 commented Dec 9, 2023

Also, do I just need to supply the tokenized string or do I need to actually add it somewhere?

No just the token and string, whoever approves it will add it to POEditor (requires POEditor admin)

@tsa96
Copy link
Member

tsa96 commented Dec 9, 2023

Looks good. @Gocnak I've added the string to POEditor already, merge when you're happy!

Copy link
Member

@Gocnak Gocnak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, good stuff

@Gocnak Gocnak merged commit 7cbe54c into momentum-mod:master Dec 9, 2023
1 check passed
@Trainermitch Trainermitch deleted the issue-1 branch December 9, 2023 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants