Skip to content
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: replace ticket list item shadow with background #1095

Merged
merged 2 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: ticket list item: replace shadow with background
  • Loading branch information
ssiyad committed Apr 5, 2023
commit 62f8253214599225eb01d72c23184841057e09a6
4 changes: 2 additions & 2 deletions desk/src/components/desk/tickets/TicketSummary.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="leading-loose">
<div class="leading-relaxed">
<router-link :to="toRoute">
<div class="truncate" :class="{ 'font-semibold': !isSeen }">
<div class="whitespace-pre-wrap" :class="{ 'font-semibold': !isSeen }">
{{ subject }}
</div>
</router-link>
Expand Down
107 changes: 65 additions & 42 deletions desk/src/pages/desk/Tickets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,26 @@
:onchange="(e) => toggleAllSelected(e.target.checked)"
/>
</div>
<div class="basis-1/3">Summary</div>
<div class="basis-1/3">Subject</div>
<div class="flex basis-2/3">
<div class="basis-1/5">Assigned To</div>
<div class="basis-1/5">Raised By</div>
<div class="basis-1/5">Type</div>
<div class="basis-1/5">Status</div>
<div class="basis-1/5">
<div class="pl-3">Status</div>
</div>
<div class="basis-1/5">Priority</div>
</div>
</div>
</div>
<div class="overflow-x-scroll px-6 py-2 font-sans text-base">
<div class="divide-y overflow-x-scroll px-6 py-2 font-sans text-base">
<div
v-for="t in ticketList.list.data"
:key="t.name"
class="hover:shadow-around flex w-full items-center rounded-lg border-b px-2 py-1 shadow-black transition-all last-of-type:border-none"
class="flex w-full items-center px-2 py-1 transition-all"
:class="{
'bg-gray-100': selected.has(t.name),
}"
>
<div class="pl-1 pr-4">
<Input
Expand Down Expand Up @@ -106,7 +111,7 @@
:button="{
label: t.status,
iconRight: 'chevron-down',
class: 'bg-white text-gray-500 hover:bg-white',
appearance: 'minimal',
}"
/>
</div>
Expand Down Expand Up @@ -144,50 +149,58 @@
/>
</div>
</div>
<div
v-show="selected.size"
class="fixed inset-x-0 bottom-5 mx-auto w-max font-sans text-base"
<transition
enter-active-class="duration-300 ease-out"
enter-from-class="transform opacity-0"
enter-to-class="opacity-100"
leave-active-class="duration-200 ease-in"
leave-from-class="opacity-100"
leave-to-class="transform opacity-0"
>
<div
class="shadow-around flex items-center rounded-lg border border-gray-300 bg-white px-3 py-2"
v-show="selected.size"
class="fixed inset-x-0 bottom-5 mx-auto w-max font-sans text-base"
>
<div class="w-64">
<div class="inline-block align-middle">
<Input type="checkbox" :value="true" :disabled="true" />
<div
class="shadow-around flex items-center rounded-lg border border-gray-300 bg-white px-3 py-2"
>
<div class="w-64">
<div class="inline-block align-middle">
<Input type="checkbox" :value="true" :disabled="true" />
</div>
<div class="inline-block pl-2 align-middle">
{{ ticketsSelectedText }}
</div>
</div>
<div class="inline-block pl-2 align-middle">
{{ selected.size }}
tickets selected
<div>
<Dropdown
:options="agentsAsDropdownOptions"
:button="{
label: 'Assign',
iconLeft: 'plus-circle',
class: 'bg-white text-gray-500',
}"
/>
</div>
<div class="text-gray-300">&#x007C;</div>
<div>
<Button
label="Select all"
class="bg-white text-gray-500"
:disabled="allSelected"
@click="selectAll"
/>
</div>
<div>
<Button
icon="x"
class="bg-white text-gray-500"
@click="deselectAll"
/>
</div>
</div>
<div>
<Dropdown
:options="agentsAsDropdownOptions"
:button="{
label: 'Assign',
iconLeft: 'plus-circle',
class: 'bg-white text-gray-500',
}"
/>
</div>
<div class="text-gray-300">&#x007C;</div>
<div>
<Button
label="Select all"
class="bg-white text-gray-500"
:disabled="allSelected"
@click="selectAll"
/>
</div>
<div>
<Button
icon="x"
class="bg-white text-gray-500"
@click="deselectAll"
/>
</div>
</div>
</div>
</transition>
<NewTicketDialog
v-model="showNewTicketDialog"
@close="showNewTicketDialog = false"
Expand Down Expand Up @@ -237,6 +250,7 @@ export default {
const ticketList = createListManager({
doctype: "HD Ticket",
pageLength: 20,
orderBy: "modified desc",
});

return {
Expand Down Expand Up @@ -282,6 +296,15 @@ export default {
if (this.$_.isEmpty(this.ticketList.list.data)) return;
return this.ticketList.list.data.length === this.selected.size;
},
ticketsSelectedText() {
/** Number of selected items */
const n = this.selected.size;

/** Singular or Plural */
const s = n > 1 ? "Tickets" : "Ticket";

return `${n} ${s} selected`;
},
filterByPriorityOptions() {
return this.ticketPriorityStore.getNames().map((priority) => ({
label: priority,
Expand Down