Skip to content

Commit e2a2d29

Browse files
committed
fix: bugs related to frappe-ui update
1 parent 76533e7 commit e2a2d29

File tree

6 files changed

+77
-53
lines changed

6 files changed

+77
-53
lines changed

desk/src/components/SelectDropdown.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</template>
1717
<template #body="{ togglePopover }">
1818
<div
19-
class="p-1 text-ink-gray-6 top-1 absolute w-full bg-white shadow-2xl rounded"
19+
class="p-1 text-ink-gray-6 top-1 absolute w-44 bg-white shadow-2xl rounded"
2020
:class="bodyClass"
2121
>
2222
<div class="max-h-52 overflow-y-auto">
@@ -56,15 +56,14 @@
5656

5757
<script setup lang="ts">
5858
import { Button, FeatherIcon, Popover } from "frappe-ui";
59-
import { PopoverProps } from "frappe-ui/src/components/Popover/types";
6059
6160
const model = defineModel();
6261
6362
interface Props {
6463
options: Array<{ value: string; label: string }>;
6564
targetClass?: string;
6665
bodyClass?: string;
67-
placement?: PopoverProps["placement"];
66+
placement?: string;
6867
}
6968
7069
const props = withDefaults(defineProps<Props>(), {

desk/src/components/Settings/Assignment Rules/AssignmentRuleListItem.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="grid grid-cols-11 items-center gap-4 cursor-pointer hover:bg-gray-50 rounded"
3+
class="grid grid-cols-12 items-center gap-4 cursor-pointer hover:bg-gray-50 rounded"
44
>
55
<div
66
@click="assignmentRulesActiveScreen = { screen: 'view', data: data }"
@@ -14,13 +14,21 @@
1414
{{ data.description }}
1515
</div>
1616
</div>
17-
<div class="col-span-2">
18-
<Select
19-
class="w-max bg-transparent -ml-2 border-0 text-ink-gray-6 focus-visible:!ring-0 bg-none"
20-
:options="priorityOptions"
17+
<div class="col-span-3">
18+
<select
19+
class="w-full h-7 text-base hover:bg-surface-gray-3 rounded-md p-0 pl-2 pr-5 bg-transparent -ml-2 border-0 text-ink-gray-8 focus-visible:!ring-0 bg-none truncate"
2120
v-model="data.priority"
2221
@update:modelValue="onPriorityChange"
23-
/>
22+
@change="onPriorityChange"
23+
>
24+
<option
25+
v-for="option in priorityOptions"
26+
:key="option.value"
27+
:value="option.value"
28+
>
29+
{{ option.label }}
30+
</option>
31+
</select>
2432
</div>
2533
<div class="flex justify-between items-center w-full pr-2 col-span-2">
2634
<div>

desk/src/components/Settings/Assignment Rules/AssignmentRulesListView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
/>
3232
</div>
3333
<div v-else>
34-
<div class="grid grid-cols-11 items-center gap-4 text-sm text-gray-600">
34+
<div class="grid grid-cols-12 items-center gap-4 text-sm text-gray-600">
3535
<div class="col-span-7 ml-2">{{ __("Assignment rule") }}</div>
36-
<div class="col-span-2">{{ __("Priority") }}</div>
36+
<div class="col-span-3">{{ __("Priority") }}</div>
3737
<div class="col-span-2">{{ __("Enabled") }}</div>
3838
</div>
3939
<hr class="mt-2 mx-2" />

desk/src/components/Settings/General/components/TicketSettings.vue

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,37 @@
3535
class="grid grid-cols-2 gap-4 mt-3"
3636
v-if="settingsData.restrictTicketsByAgentGroup"
3737
>
38-
<div
39-
class="flex items-start sm:items-center gap-2"
40-
@click="
41-
() => {
42-
settingsData.doNotRestrictTicketsWithoutAnAgentGroup =
43-
!settingsData.doNotRestrictTicketsWithoutAnAgentGroup;
44-
}
45-
"
46-
>
47-
<Checkbox
48-
:model-value="
49-
settingsData.doNotRestrictTicketsWithoutAnAgentGroup
50-
"
51-
/>
52-
<FormLabel :label="__('Do not restrict tickets without a team')" />
38+
<div class="flex items-start sm:items-center gap-2">
39+
<div class="inline-flex space-x-2 rounded transition">
40+
<input
41+
class="rounded-sm mt-[1px] bg-surface-white border-outline-gray-4 text-ink-gray-9 hover:border-outline-gray-5 focus:ring-offset-0 focus:border-outline-gray-8 active:border-outline-gray-6 transition hover:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3 active:bg-surface-gray-2 w-3.5 h-3.5"
42+
type="checkbox"
43+
id="doNotRestrictTicketsWithoutAnAgentGroup"
44+
v-model="settingsData.doNotRestrictTicketsWithoutAnAgentGroup"
45+
/>
46+
<label
47+
class="block text-sm font-medium text-ink-gray-8 select-none"
48+
for="doNotRestrictTicketsWithoutAnAgentGroup"
49+
>
50+
{{ __("Do not restrict tickets without a team") }}
51+
</label>
52+
</div>
5353
</div>
54-
<div
55-
class="flex items-start sm:items-center gap-2"
56-
@click="
57-
() => {
58-
settingsData.assignWithinTeam = !settingsData.assignWithinTeam;
59-
}
60-
"
61-
>
62-
<Checkbox :model-value="settingsData.assignWithinTeam" />
63-
<FormLabel
64-
:label="__('Restrict agent assignment to selected team')"
65-
/>
54+
<div class="flex items-start sm:items-center gap-2">
55+
<div class="inline-flex space-x-2 rounded transition">
56+
<input
57+
class="rounded-sm mt-[1px] bg-surface-white border-outline-gray-4 text-ink-gray-9 hover:border-outline-gray-5 focus:ring-offset-0 focus:border-outline-gray-8 active:border-outline-gray-6 transition hover:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3 active:bg-surface-gray-2 w-3.5 h-3.5"
58+
type="checkbox"
59+
id="assignWithinTeam"
60+
v-model="settingsData.assignWithinTeam"
61+
/>
62+
<label
63+
class="block text-sm font-medium text-ink-gray-8 select-none"
64+
for="assignWithinTeam"
65+
>
66+
{{ __("Restrict agent assignment to selected team") }}
67+
</label>
68+
</div>
6669
</div>
6770
</div>
6871
</div>
@@ -92,7 +95,7 @@
9295
}
9396
"
9497
target-class="max-w-40"
95-
placement="bottom-end"
98+
placement="bottom-start"
9699
/>
97100
</div>
98101
<div class="flex items-center justify-between">
@@ -128,7 +131,7 @@
128131
:options="ticketTypeList.data"
129132
v-model="settingsData.defaultTicketType"
130133
target-class="max-w-40"
131-
placement="bottom-end"
134+
placement="bottom-start"
132135
/>
133136
</div>
134137
<div>
@@ -160,7 +163,7 @@
160163
}
161164
"
162165
target-class="w-full"
163-
placement="bottom-end"
166+
placement="bottom-start"
164167
/>
165168
</div>
166169
<div class="flex flex-col gap-1.5">

desk/src/components/Settings/Sla/SlaPriorityListItem.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@
3737
</template>
3838
</Popover>
3939
</div>
40-
<div v-else>
41-
<Select
42-
class="w-full bg-transparent cursor-pointer border-0 focus-visible:!ring-0 bg-none"
43-
:options="priorityOptions"
40+
<div v-else class="ml-2">
41+
<select
42+
class="w-full h-7 text-base hover:bg-surface-gray-3 rounded-md p-0 pl-2 pr-5 bg-transparent -ml-2 border-0 text-ink-gray-8 focus-visible:!ring-0 bg-none truncate"
4443
v-model="props.row[column.key]"
45-
/>
44+
>
45+
<option
46+
v-for="option in priorityOptions"
47+
:key="option.value"
48+
:value="option.value"
49+
>
50+
{{ option.label }}
51+
</option>
52+
</select>
4653
</div>
4754
</div>
4855
<div class="flex justify-end">
@@ -63,7 +70,7 @@
6370
import DurationPicker from "@/components/frappe-ui/DurationPicker.vue";
6471
import { slaData } from "@/stores/sla";
6572
import { ConfirmDelete } from "@/utils";
66-
import { Button, Checkbox, Dropdown, Popover, Select } from "frappe-ui";
73+
import { Button, Checkbox, Dropdown, Popover } from "frappe-ui";
6774
import { inject, ref } from "vue";
6875
import EditResponseResolutionModal from "./Modals/EditResponseResolutionModal.vue";
6976
import { formatTimeHMS } from "./utils";

desk/src/components/Settings/Sla/SlaWorkDaysListItem.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,19 @@
1313
<div v-if="column.key === 'start_time' || column.key === 'end_time'">
1414
{{ formatTime(props.row[column.key]) }}
1515
</div>
16-
<div v-else>
17-
<Select
18-
class="bg-transparent cursor-pointer border-0 focus-visible:!ring-0 bg-none"
19-
:options="workDayOptions"
16+
<div v-else class="ml-2">
17+
<select
18+
class="w-full h-7 text-base hover:bg-surface-gray-3 rounded-md p-0 pl-2 pr-5 bg-transparent -ml-2 border-0 text-ink-gray-8 focus-visible:!ring-0 bg-none truncate"
2019
v-model="props.row[column.key]"
21-
/>
20+
>
21+
<option
22+
v-for="option in workDayOptions"
23+
:key="option.value"
24+
:value="option.value"
25+
>
26+
{{ option.label }}
27+
</option>
28+
</select>
2229
</div>
2330
</div>
2431
<div class="flex justify-end">
@@ -40,7 +47,7 @@
4047

4148
<script setup lang="ts">
4249
import { ref } from "vue";
43-
import { Button, Dropdown, Select } from "frappe-ui";
50+
import { Button, Dropdown } from "frappe-ui";
4451
import WorkDayModal from "./Modals/WorkDayModal.vue";
4552
import { ConfirmDelete, getGridTemplateColumnsForTable } from "@/utils";
4653
import { slaData } from "@/stores/sla";

0 commit comments

Comments
 (0)