-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
) Why this change? Using uppercase in settings name is not part of our convention so renaming it here.
- Loading branch information
Showing
4 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function migrate(settings) { | ||
if (settings.has("Custom_header_links")) { | ||
settings.set("custom_header_links", settings.get("Custom_header_links")); | ||
settings.delete("Custom_header_links"); | ||
} | ||
|
||
return settings; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/unit/migrations/settings/0001-rename-settings-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { module, test } from "qunit"; | ||
import migrate from "../../../../migrations/settings/0001-rename-settings"; | ||
|
||
module("Unit | Migrations | Settings | 0001-rename-settings", function () { | ||
test("migrate", function (assert) { | ||
const settings = new Map( | ||
Object.entries({ | ||
Custom_header_links: "some,links", | ||
}) | ||
); | ||
|
||
const result = migrate(settings); | ||
|
||
assert.deepEqual( | ||
Array.from(result), | ||
Array.from( | ||
new Map( | ||
Object.entries({ | ||
custom_header_links: "some,links", | ||
}) | ||
) | ||
) | ||
); | ||
}); | ||
}); |
5006125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the settings name resets values to defaults. Or rather, which is a bit more confusing: It uses the new default values, but the old ones are still shown on the ui. I had to copy my previous settings, then reset, then paste the previous settings to show it correctly again on the ui.
Maybe add a note on the meta topic about this change?
5006125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeaaah same here, header completely destroyed overnight, had to re-enter all the settings manually 🚨 🚨 🚨