Skip to content

feat: init onboarding #2284

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

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion desk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"autoprefixer": "^10.4.13",
"dayjs": "^1.11.7",
"echarts": "^5.4.1",
"frappe-ui": "0.1.122",
"frappe-ui": "0.1.134",
"lodash": "^4.17.21",
"lucide-static": "^0.276.0",
"mime": "^3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions desk/src/components/AssignmentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { ref, computed } from "vue";
import { createResource } from "frappe-ui";
import { UserAvatar, SearchComplete } from "@/components";
import { useUserStore } from "@/stores/user";
import { useOnboarding } from "frappe-ui/frappe";

const props = defineProps({
assignees: {
Expand All @@ -82,6 +83,7 @@ const show = defineModel();
const emit = defineEmits(["update"]);

const { getUser } = useUserStore();
const { updateOnboardingStep } = useOnboarding("helpdesk");

const error = ref("");

Expand All @@ -97,6 +99,7 @@ const addAssignee = (value) => {
},
onSuccess: () => {
emit("update");
updateOnboardingStep("assign_to_agent");
},
});
emit("update");
Expand Down
17 changes: 11 additions & 6 deletions desk/src/components/CommentTextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,26 @@
</TextEditor>
</template>
<script setup lang="ts">
import { computed, ref, onMounted } from "vue";
import {
TextEditorFixedMenu,
TextEditor,
FileUploader,
TextEditor,
TextEditorFixedMenu,
createResource,
} from "frappe-ui";
import { useOnboarding } from "frappe-ui/frappe";
import { computed, onMounted, ref } from "vue";

import { AttachmentIcon } from "@/components/icons/";
import { AttachmentItem } from "@/components/";
import { AttachmentIcon } from "@/components/icons/";
import { useAgentStore } from "@/stores/agent";
import { useStorage } from "@vueuse/core";

import { PreserveVideoControls } from "@/tiptap-extensions";
import { isContentEmpty, textEditorMenuButtons, getFontFamily } from "@/utils";
import { getFontFamily, isContentEmpty, textEditorMenuButtons } from "@/utils";
import { useStorage } from "@vueuse/core";

const { updateOnboardingStep } = useOnboarding("helpdesk");
const { agents: agentsList } = useAgentStore();

onMounted(() => {
agentsList.fetch();
});
Expand Down Expand Up @@ -168,6 +172,7 @@ async function submitComment() {
},
}),
onSuccess: () => {
updateOnboardingStep("comment_on_ticket");
emit("submit");
loading.value = false;
attachments.value = [];
Expand Down
8 changes: 3 additions & 5 deletions desk/src/components/CommunicationArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@
<script setup lang="ts">
import { ref } from "vue";

import { EmailEditor, CommentTextEditor } from "@/components";
import { EmailIcon, CommentIcon } from "@/components/icons/";
import { CommentTextEditor, EmailEditor } from "@/components";
import { CommentIcon, EmailIcon } from "@/components/icons/";
import { showCommentBox, showEmailBox } from "@/pages/ticket/modalStates";

const emit = defineEmits(["update"]);
const content = defineModel("content");
const doc = defineModel();

const showEmailBox = ref(false);
const showCommentBox = ref(false);

const emailEditorRef = ref(null);
const commentTextEditorRef = ref(null);

Expand Down
34 changes: 19 additions & 15 deletions desk/src/components/EmailEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,29 @@
</template>

<script setup lang="ts">
import { ref, computed, nextTick } from "vue";
import {
AttachmentItem,
CannedResponseSelectorModal,
MultiSelectInput,
} from "@/components";
import { AttachmentIcon, EmailIcon } from "@/components/icons";
import { PreserveVideoControls } from "@/tiptap-extensions";
import {
createToast,
getFontFamily,
isContentEmpty,
textEditorMenuButtons,
validateEmail,
} from "@/utils";
import { useStorage } from "@vueuse/core";
import {
FileUploader,
TextEditor,
TextEditorFixedMenu,
createResource,
} from "frappe-ui";
import {
createToast,
validateEmail,
textEditorMenuButtons,
isContentEmpty,
getFontFamily,
} from "@/utils";
import {
MultiSelectInput,
AttachmentItem,
CannedResponseSelectorModal,
} from "@/components";
import { AttachmentIcon, EmailIcon } from "@/components/icons";
import { PreserveVideoControls } from "@/tiptap-extensions";
import { useOnboarding } from "frappe-ui/frappe";
import { computed, nextTick, ref } from "vue";

const editorRef = ref(null);
const showCannedResponseSelectorModal = ref(false);
Expand Down Expand Up @@ -199,6 +200,8 @@ const emit = defineEmits(["submit", "discard"]);
const doc = defineModel();

const newEmail = useStorage("emailBoxContent" + doc.value.name, "");
const { updateOnboardingStep } = useOnboarding("helpdesk");

const attachments = ref([]);
const emailEmpty = computed(() => {
return isContentEmpty(newEmail.value);
Expand Down Expand Up @@ -236,6 +239,7 @@ const sendMail = createResource({
onSuccess: () => {
resetState();
emit("submit");
updateOnboardingStep("reply_on_ticket");
},
debounce: 300,
});
Expand Down
2 changes: 1 addition & 1 deletion desk/src/components/ListViewBuilder.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<!-- View Controls -->
<div
class="flex items-center justify-between gap-2 px-5 pb-4 pt-3"
class="flex items-center justify-between gap-2 px-5 pb-4 pt-3 pl-6"
v-if="showViewControls"
>
<QuickFilters v-if="!isMobileView" class="flex-1" />
Expand Down
4 changes: 4 additions & 0 deletions desk/src/components/Settings/EmailAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import {
validateInputs,
incomingOutgoingFields,
} from "./emailConfig";
import { useOnboarding } from "frappe-ui/frappe";
import EmailProviderIcon from "./EmailProviderIcon.vue";
import { EmailService, EmailAccount, EmailStep } from "@/types";

Expand All @@ -114,6 +115,8 @@ interface E {

const emit = defineEmits<E>();

const { updateOnboardingStep } = useOnboarding("helpdesk");

const state: Reactive<EmailAccount> = reactive({
service: "",
email_account_name: "",
Expand Down Expand Up @@ -152,6 +155,7 @@ const addEmailRes = createResource({
iconClasses: "text-green-600",
});
emit("update:step", "email-list");
updateOnboardingStep("setup_email_account");
},
onError: () => {
error.value = "Failed to create email account, Invalid credentials";
Expand Down
2 changes: 1 addition & 1 deletion desk/src/components/Settings/EmailProviderIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script setup lang="ts">
interface P {
serviceName: string;
serviceName?: string;
logo?: string;
selected?: boolean;
}
Expand Down
26 changes: 18 additions & 8 deletions desk/src/components/Settings/SettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,34 @@
</Dialog>
</template>
<script setup lang="ts">
import { ModelRef, ref } from "vue";
import { Dialog } from "frappe-ui";
import LucideMail from "~icons/lucide/mail";
import { markRaw, ModelRef, ref } from "vue";
import ImageUp from "~icons/lucide/image-up";
import EmailConfig from "./EmailConfig.vue";
import LucideMail from "~icons/lucide/mail";
import Branding from "./Branding.vue";
import EmailConfig from "./EmailConfig.vue";
const props = withDefaults(
defineProps<{
defaultTab?: number;
}>(),
{
defaultTab: 0,
}
);

let tabs = [
{
label: "Email Accounts",
icon: LucideMail,
component: EmailConfig,
icon: markRaw(LucideMail),
component: markRaw(EmailConfig),
},
{
label: "Branding",
icon: ImageUp,
component: Branding,
icon: markRaw(ImageUp),
component: markRaw(Branding),
},
];
const show: ModelRef<boolean> = defineModel();
const activeTab = ref(tabs[0]);
// tabs[props.defaultTab
const activeTab = ref(tabs[props.defaultTab]);
</script>
5 changes: 4 additions & 1 deletion desk/src/components/desk/global/AddNewAgentsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<script>
import { Dialog, Input, FeatherIcon } from "frappe-ui";
import { ref } from "@vue/reactivity";
import { useOnboarding } from "frappe-ui/frappe";

export default {
name: "AddNewAgentsDialog",
Expand All @@ -96,11 +97,12 @@ export default {
const inviteQueue = ref([]);

const currentInputIsValidEmail = ref(false);

const { updateOnboardingStep } = useOnboarding("helpdesk");
return {
searchInput,
inviteQueue,
currentInputIsValidEmail,
updateOnboardingStep,
};
},
methods: {
Expand Down Expand Up @@ -176,6 +178,7 @@ export default {
this.currentInputIsValidEmail = false;
this.searchInput = "";
this.inviteQueue = [];
this.updateOnboardingStep("invite_agents");

this.$toast({
title: "Invites Sent Successfully!",
Expand Down
59 changes: 59 additions & 0 deletions desk/src/components/icons/InviteCustomer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10 11C12.2091 11 14 9.20914 14 7C14 4.79086 12.2091 3 10 3C7.79086 3 6 4.79086 6 7C6 9.20914 7.79086 11 10 11Z"
stroke="black"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M10.3 15H7C5.93913 15 4.92172 15.4214 4.17157 16.1716C3.42143 16.9217 3 17.9391 3 19V21H11.5"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M22.166 13.834H14.8327C14.3264 13.834 13.916 14.2444 13.916 14.7507V20.2507C13.916 20.7569 14.3264 21.1673 14.8327 21.1673H22.166C22.6723 21.1673 23.0827 20.7569 23.0827 20.2507V14.7507C23.0827 14.2444 22.6723 13.834 22.166 13.834Z"
stroke="black"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M23.0827 15.209L18.9714 17.8215C18.8299 17.9101 18.6663 17.9572 18.4993 17.9572C18.3324 17.9572 18.1688 17.9101 18.0273 17.8215L13.916 15.209"
stroke="black"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<g clip-path="url(#clip0_368_1881)">
<path
d="M16.667 5H21.3337"
stroke="black"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M19 2.66699V7.33366"
stroke="black"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_368_1881">
<rect width="8" height="8" fill="white" transform="translate(15 1)" />
</clipPath>
</defs>
</svg>
</template>
1 change: 1 addition & 0 deletions desk/src/components/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export { default as OrganizationsIcon } from "./OrganizationsIcon.vue";
export { default as UnpinIcon } from "./UnpinIcon.vue";
export { default as PinIcon } from "./PinIcon.vue";
export { default as FrappeCloudIcon } from "./FrappeCloudIcon.vue";
export { default as InviteCustomer } from "./InviteCustomer.vue";
Loading
Loading