-
Notifications
You must be signed in to change notification settings - Fork 246
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
develop to master #1794
develop to master #1794
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,93 @@ | ||
<template> | ||
<Dialog | ||
v-model="show" | ||
:options="{ | ||
size: 'xl', | ||
actions: [ | ||
{ | ||
label: !isNew ? 'Update' : 'Create', | ||
variant: 'solid', | ||
onClick: () => updateItem(), | ||
}, | ||
], | ||
}" | ||
> | ||
<template #body-title> | ||
<div class="flex items-center gap-3"> | ||
<h3 class="text-2xl font-semibold leading-6 text-gray-900"> | ||
{{ !isNew ? "Edit Canned Response" : "Create Canned Response" }} | ||
</h3> | ||
</div> | ||
</template> | ||
<template #body-content> | ||
<div class="flex flex-col gap-4"> | ||
<div> | ||
<div class="mb-1.5 text-sm text-gray-600">{{ "Title" }}</div> | ||
<TextInput | ||
v-model="title" | ||
variant="outline" | ||
:placeholder="'Customer Query Resolved'" | ||
/> | ||
</div> | ||
<div> | ||
<div class="mb-1.5 text-sm text-gray-600">{{ "Message" }}</div> | ||
<TextEditor | ||
ref="content" | ||
variant="outline" | ||
editor-class="!prose-sm overflow-auto min-h-[180px] max-h-80 py-1.5 px-2 rounded border border-gray-300 bg-white hover:border-gray-400 hover:shadow-sm focus:bg-white focus:border-gray-500 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400 text-gray-800 transition-colors" | ||
:bubble-menu="true" | ||
:content="message" | ||
:placeholder="'Your query has been resolved. Thank you for reaching out.'" | ||
@change="(val) => (message = val)" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
</Dialog> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, defineModel } from "vue"; | ||
import { TextEditor, call, TextInput } from "frappe-ui"; | ||
|
||
const props = defineProps({ | ||
name: { | ||
type: String, | ||
required: false, | ||
default: null, | ||
}, | ||
isNew: { | ||
type: Boolean, | ||
required: false, | ||
default: false, | ||
}, | ||
}); | ||
|
||
const show = defineModel(); | ||
const title = defineModel("title"); | ||
const message = defineModel("message"); | ||
const emit = defineEmits(["update"]); | ||
|
||
async function updateItem() { | ||
if (props.name) { | ||
await call("frappe.client.set_value", { | ||
doctype: "HD Canned Response", | ||
name: props.name, | ||
fieldname: { | ||
title: title.value, | ||
message: message.value, | ||
}, | ||
}); | ||
} else { | ||
await call("frappe.client.insert", { | ||
doc: { | ||
doctype: "HD Canned Response", | ||
title: title.value, | ||
message: message.value, | ||
}, | ||
}); | ||
} | ||
emit("update"); | ||
show.value = false; | ||
} | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as AddNewCannedResponseDialog } from "./AddNewCannedResponseDialog.vue"; | ||
export { default as CannedResponseInfo } from "./CannedResponseInfo.vue"; | ||
export { default as CannedResponseModal } from "./CannedResponseModal.vue"; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,4 +6,38 @@ | |||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
class HDCannedResponse(Document): | ||||||||||||||||||||||
pass | ||||||||||||||||||||||
def default_list_data(): | ||||||||||||||||||||||
|
||||||||||||||||||||||
columns = [ | ||||||||||||||||||||||
{ | ||||||||||||||||||||||
'label': 'Title', | ||||||||||||||||||||||
'type': 'Data', | ||||||||||||||||||||||
'key': 'title', | ||||||||||||||||||||||
'width': '5rem', | ||||||||||||||||||||||
}, | ||||||||||||||||||||||
{ | ||||||||||||||||||||||
'label': 'Message', | ||||||||||||||||||||||
'type': 'Text Editor', | ||||||||||||||||||||||
'key': 'message', | ||||||||||||||||||||||
'width': '25rem', | ||||||||||||||||||||||
Comment on lines
+19
to
+22
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. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||||||
}, | ||||||||||||||||||||||
{ | ||||||||||||||||||||||
'label': 'Owner', | ||||||||||||||||||||||
'type': 'Link', | ||||||||||||||||||||||
'key': 'owner', | ||||||||||||||||||||||
'width': '5rem', | ||||||||||||||||||||||
Comment on lines
+25
to
+28
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. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||||||
}, | ||||||||||||||||||||||
{ | ||||||||||||||||||||||
'label': 'Modified On', | ||||||||||||||||||||||
'type': 'Datetime', | ||||||||||||||||||||||
'key': 'modified', | ||||||||||||||||||||||
'width': '5rem', | ||||||||||||||||||||||
} | ||||||||||||||||||||||
Comment on lines
+31
to
+35
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. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||||||
] | ||||||||||||||||||||||
rows = [ | ||||||||||||||||||||||
"title", | ||||||||||||||||||||||
"message", | ||||||||||||||||||||||
"owner", | ||||||||||||||||||||||
"modified" | ||||||||||||||||||||||
] | ||||||||||||||||||||||
return {'columns': columns, 'rows': rows} | ||||||||||||||||||||||
Comment on lines
+37
to
+43
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. [black-format] reported by reviewdog 🐶
Suggested change
|
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.
[black-format] reported by reviewdog 🐶