-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): setting to force push when time discrepancy occurs (#…
- Loading branch information
1 parent
7f4a194
commit 644c0d5
Showing
10 changed files
with
168 additions
and
30 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
46 changes: 46 additions & 0 deletions
46
frontend/app/src/components/settings/general/AskUserUponSizeDiscrepancySetting.vue
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,46 @@ | ||
<script setup lang="ts"> | ||
withDefaults( | ||
defineProps<{ | ||
dialog?: boolean; | ||
confirm?: boolean; | ||
}>(), | ||
{ dialog: false, confirm: false }, | ||
); | ||
const value = ref(false); | ||
const { askUserUponSizeDiscrepancy } = storeToRefs(useGeneralSettingsStore()); | ||
watchImmediate(askUserUponSizeDiscrepancy, (askUser) => { | ||
set(value, !get(askUser)); | ||
}); | ||
const { t } = useI18n(); | ||
</script> | ||
|
||
<template> | ||
<SettingsOption | ||
#default="{ error, success, updateImmediate }" | ||
setting="askUserUponSizeDiscrepancy" | ||
> | ||
<RuiCheckbox | ||
v-if="confirm" | ||
:value="value" | ||
:label="t('sync_indicator.setting.ask_user_upon_size_discrepancy.confirm_label')" | ||
color="primary" | ||
:success-messages="success" | ||
:error-messages="error" | ||
@input="updateImmediate(!$event)" | ||
/> | ||
<RuiSwitch | ||
v-else | ||
:value="value" | ||
:size="dialog ? 'sm' : undefined" | ||
:class="{ '[&_span]:text-sm [&_span]:mt-0.5': dialog }" | ||
:label="t('sync_indicator.setting.ask_user_upon_size_discrepancy.label')" | ||
color="primary" | ||
:success-messages="success" | ||
:error-messages="error" | ||
@input="updateImmediate(!$event)" | ||
/> | ||
</SettingsOption> | ||
</template> |
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,56 @@ | ||
<script setup lang="ts"> | ||
import { useBreakpoint } from '@rotki/ui-library-compat'; | ||
const props = defineProps<{ | ||
value: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(e: 'input', value: boolean): void; | ||
}>(); | ||
const vModel = useSimpleVModel(props, emit); | ||
const { t } = useI18n(); | ||
const { isMdAndUp } = useBreakpoint(); | ||
</script> | ||
|
||
<template> | ||
<RuiMenu | ||
v-model="vModel" | ||
:popper="{ placement: isMdAndUp ? 'right-start' : 'bottom-end' }" | ||
:close-on-content-click="false" | ||
> | ||
<template #activator="{ on }"> | ||
<RuiButton | ||
variant="text" | ||
icon | ||
size="sm" | ||
class="!p-2" | ||
v-on="on" | ||
> | ||
<RuiIcon | ||
size="20" | ||
name="settings-4-line" | ||
/> | ||
</RuiButton> | ||
</template> | ||
<div class="p-4 w-[18rem] max-w-[calc(100vw-1rem)]"> | ||
<div> | ||
<div class="text-body-1 font-medium mb-3"> | ||
{{ t('sync_indicator.setting.title') }} | ||
</div> | ||
<AskUserUponSizeDiscrepancySetting dialog /> | ||
</div> | ||
|
||
<div class="flex justify-end"> | ||
<RuiButton | ||
color="primary" | ||
variant="outlined" | ||
@click="vModel = false" | ||
> | ||
{{ t('common.actions.close') }} | ||
</RuiButton> | ||
</div> | ||
</div> | ||
</RuiMenu> | ||
</template> |
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
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
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