-
Notifications
You must be signed in to change notification settings - Fork 159
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 highlighting of the currently selected language #8972
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||
export interface SettingValue { | ||||||
identifier: { | ||||||
bundle: string | ||||||
extension: string | ||||||
setting: string | ||||||
} | ||||||
value: { | ||||||
accountUuid: string | ||||||
bundleId: string | ||||||
id: string | ||||||
resource: { | ||||||
type: string | ||||||
} | ||||||
settingId: string | ||||||
boolValue?: boolean | ||||||
listValue?: { | ||||||
values: { | ||||||
stringValue: string | ||||||
}[] | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
export interface AccountBundleSetting { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
description: string | ||||||
displayName: string | ||||||
id: string | ||||||
name: string | ||||||
resource: { | ||||||
type: string | ||||||
} | ||||||
singleChoiceValue?: { | ||||||
options: Record<string, any>[] | ||||||
} | ||||||
boolValue?: Record<string, any> | ||||||
} | ||||||
|
||||||
export interface AccountBundle { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
displayName: string | ||||||
extension: string | ||||||
id: string | ||||||
name: string | ||||||
resource: { | ||||||
type: string | ||||||
} | ||||||
settings: AccountBundleSetting[] | ||||||
type: string | ||||||
} | ||||||
|
||||||
export interface LanguageOption { | ||||||
label: string | ||||||
value: string | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,6 +124,7 @@ | |
<script lang="ts"> | ||
import { mapActions } from 'vuex' | ||
import EditPasswordModal from '../components/EditPasswordModal.vue' | ||
import { AccountBundle, LanguageOption, SettingValue } from '../helpers/settings' | ||
import { computed, defineComponent, onMounted, unref, ref } from 'vue' | ||
import { | ||
useCapabilityGraphPersonalDataExport, | ||
|
@@ -140,7 +141,7 @@ import { isPersonalSpaceResource } from 'web-client/src/helpers' | |
import AppLoadingSpinner from 'web-pkg/src/components/AppLoadingSpinner.vue' | ||
|
||
export default defineComponent({ | ||
name: 'Personal', | ||
name: 'AccountPage', | ||
components: { | ||
AppLoadingSpinner, | ||
EditPasswordModal, | ||
|
@@ -152,10 +153,10 @@ export default defineComponent({ | |
const { $gettext } = language | ||
const clientService = useClientService() | ||
const configurationManager = useConfigurationManager() | ||
const valuesList = ref() | ||
const bundlesList = ref() | ||
const selectedLanguageValue = ref() | ||
const disableEmailNotificationsValue = ref() | ||
const valuesList = ref<SettingValue[]>() | ||
const bundlesList = ref<AccountBundle>() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the bundles list not of type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you 💪 |
||
const selectedLanguageValue = ref<LanguageOption>() | ||
const disableEmailNotificationsValue = ref<boolean>() | ||
|
||
// FIXME: Use graph capability when we have it | ||
const isSettingsServiceSupported = useCapabilitySpacesEnabled() | ||
|
@@ -202,7 +203,7 @@ export default defineComponent({ | |
title: $gettext('Unable to load account data…'), | ||
status: 'danger' | ||
}) | ||
bundlesList.value = [] | ||
bundlesList.value = undefined | ||
} | ||
}).restartable() | ||
|
||
|
@@ -223,8 +224,7 @@ export default defineComponent({ | |
?.singleChoiceValue.options | ||
return languageOptions?.map((l) => ({ | ||
label: l.displayValue, | ||
value: l.value.stringValue, | ||
default: l.default | ||
value: l.value.stringValue | ||
})) | ||
}) | ||
|
||
|
@@ -279,7 +279,7 @@ export default defineComponent({ | |
} | ||
} | ||
|
||
const updateSelectedLanguage = async (option) => { | ||
const updateSelectedLanguage = async (option: LanguageOption) => { | ||
try { | ||
const value = await saveValue({ | ||
identifier: 'language', | ||
|
@@ -309,7 +309,7 @@ export default defineComponent({ | |
} | ||
} | ||
|
||
const updateDisableEmailNotifications = async (option) => { | ||
const updateDisableEmailNotifications = async (option: boolean) => { | ||
try { | ||
await saveValue({ | ||
identifier: 'disable-email-notifications', | ||
|
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.