refactor(settings)!: rename Switch to SettingsSwitch

Vue.js components should have multi-word names.
This commit is contained in:
2026-08-09 13:09:39 +02:00
committed by Gitea
parent c2a4ac77c7
commit 9ef4077916
4 changed files with 7 additions and 7 deletions
@@ -18,7 +18,7 @@ limitations under the License.
import Selection from './Selection.vue';
import SettingsInput from './SettingsInput.vue';
import SettingsPageLink from './SettingsPageLink.vue';
import Switch from './Switch.vue';
import SettingsSwitch from './SettingsSwitch.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
@@ -43,7 +43,7 @@ const props = defineProps({
:key="setting"
class="setting"
>
<Switch
<SettingsSwitch
v-if="setting.type === 'bool'"
:setting="setting"
:path="`${props.path}.${setting.name}`"
@@ -18,7 +18,7 @@ import Selection from '../Selection.vue';
import SettingsInput from '../SettingsInput.vue';
import SettingsPage from '../SettingsPage.vue';
import SettingsPageLink from '../SettingsPageLink.vue';
import Switch from '../Switch.vue';
import SettingsSwitch from '../SettingsSwitch.vue';
import { mountComponent } from '@/test-utils/mountComponent.js';
import { describe, expect, test } from 'vitest';
@@ -108,7 +108,7 @@ describe('SettingsPage', () => {
exampleSettings.forEach((expectedSetting, index) => {
const settingWrapper = settingsWrappers[index];
const switchSetting = settingWrapper.findComponent(Switch);
const switchSetting = settingWrapper.findComponent(SettingsSwitch);
const inputSetting = settingWrapper.findComponent(SettingsInput);
const selectionSetting = settingWrapper.findComponent(Selection);
const settingsPageLink = settingWrapper.findComponent(SettingsPageLink);
@@ -15,7 +15,7 @@ limitations under the License.
*/
import { useSettingsStore } from '../../stores/settingsStore.js';
import Switch from '../Switch.vue';
import SettingsSwitch from '../SettingsSwitch.vue';
import { mountComponent } from '@/test-utils/mountComponent.js';
import { describe, expect, test } from 'vitest';
import { nextTick } from 'vue';
@@ -26,7 +26,7 @@ const getWrapper = function getWrapper({
translations = {},
piniaOptions = {}
} = {}) {
return mountComponent(Switch, {
return mountComponent(SettingsSwitch, {
attrs: {
setting: {
type: 'bool',
@@ -39,7 +39,7 @@ const getWrapper = function getWrapper({
}, translations, [], piniaOptions);
};
describe('Switch', () => {
describe('SettingsSwitch', () => {
test('shows value from store', async () => {
const wrapper = getWrapper();