Fix intendation

This commit is contained in:
fayazara 2022-12-12 23:20:08 +05:30
parent c618064b13
commit 228167823c
3 changed files with 51 additions and 17 deletions

View file

@ -18,6 +18,7 @@ import agentMixin from 'dashboard/mixins/agentMixin';
import conversationLabelMixin from 'dashboard/mixins/conversation/labelMixin';
import conversationTeamMixin from 'dashboard/mixins/conversation/teamMixin';
import adminMixin from 'dashboard/mixins/isAdmin';
import { frontendURL } from '../../../helper/URLHelper';
export default {
mixins: [
@ -56,16 +57,27 @@ export default {
methods: {
setCommandbarData(e) {
if (e && e.detail.action.id && e.detail.action.title) {
console.log({ id: e.detail.action.id, title: e.detail.action.id });
const action = e.detail.action;
if (action.type === 'contact') {
this.$refs.ninjakeys.close();
this.$router.push(
frontendURL(`accounts/${this.accountId}/contacts/${action.key}`)
);
} else if (action.type === 'message') {
this.$refs.ninjakeys.close();
this.$router.push(
frontendURL(
`accounts/${this.accountId}/conversations/${action.key}`
)
);
}
} else {
this.$refs.ninjakeys.data = this.hotKeys;
}
this.$refs.ninjakeys.data = this.hotKeys;
},
onChange(ninjaKeyInstance) {
// console.log(ninjaKeyInstance);
},
searchEverything(query) {
console.log(query);
},
},
};
</script>

View file

@ -27,7 +27,7 @@ const GO_TO_COMMANDS = [
icon: ICON_CONVERSATION_DASHBOARD,
builder: searchKey => {
return new Promise(resolve => {
fetch(`/api/v1/accounts/3/conversations/text_search?q=${searchKey}`, {
fetch(`/api/v1/accounts/1/conversations/text_search?q=${searchKey}`, {
headers: {
'Content-Type': 'application/json',
api_access_token: '',
@ -35,13 +35,18 @@ const GO_TO_COMMANDS = [
})
.then(res => res.json())
.then(data => {
const { results } = data;
resolve(
results.payload.contacts.map(result => ({
id: result.id,
title: result.name,
}))
);
const contacts = data.payload.contacts.map(result => ({
id: result.id,
title: result.name,
type: 'contact',
}));
const messages = data.payload.messages.map(result => ({
id: result.conversation_id,
title: result.content,
type: 'message',
}));
const flattened = [...contacts, ...messages];
return resolve(flattened);
})
.catch(error => {
resolve([]);

View file

@ -1783,10 +1783,27 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@lit/reactive-element@^1.0.0", "@lit/reactive-element@^1.1.0":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.1.1.tgz#523b29e529e881fce47bab764ea1b8058fd45796"
integrity sha512-B2JdRMwCGv+VpIRj3CYVQBx3muPDeE8y+HPgWqzrAHsO5/40BpwDFZeplIV790BaTqDVUDvZOKMSbuFM9zWC0w==
"@june-so/analytics-next@^1.36.5":
version "1.36.5"
resolved "https://registry.yarnpkg.com/@june-so/analytics-next/-/analytics-next-1.36.5.tgz#030ba5a7f8fa232597185cdb706e40b7036ca7f8"
integrity sha512-r2sp4VDngeX/ItQrlgmdKpmghg3OmPvhnTOKJ1huaHbFM2uPELpfnMRRngUVzbgbMoMeTf8QtgQVMjnUsl7G1A==
dependencies:
"@lukeed/uuid" "^2.0.0"
"@segment/analytics.js-video-plugins" "^0.2.1"
"@segment/facade" "3.4.7"
"@segment/tsub" "^0.1.9"
dset "^3.0.0"
encoding "^0.1.13"
js-cookie "^2.2.1"
node-fetch "^2.6.1"
spark-md5 "^3.0.1"
tslib "^2.1.0"
unfetch "^4.1.0"
"@lit/reactive-element@^1.3.0", "@lit/reactive-element@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.5.0.tgz#344cc33f2d1491d094b8ef824a9fe31d150d2375"
integrity sha512-fQh9FDK0LPTwDk+0HhSZEtb8K0LTN1wXerwpGrWA+a8tWulYRDLI4vQDWp4GOIsewn0572KYV/oZ3+492D7osA==
"@lukeed/csprng@^1.0.0":
version "1.0.1"