Files
chatwoot/app/javascript/shared/constants/messages.js
Shivam Mishra 105f9a27d2 feat: more CSAT filters (#7038)
* refactor: use grid instead of flex

* refactor: let the parent layout decide the spacing

* feat: add a separate date-range component

* refactor: use new date-range component

* fix: destructure all options

* refactor: separate group by component

* refactor: better handle group by data

* fix: defaul group by

* refactor: variable naming

* refactor: use DATE_RANGE_OPTIONS directly

* chore: update platform in gemfile.lock

* refactor: trigger fetch on filter change

* refactor: remove redundant method

* refactor: simplify methods and emitting

* refactor: simplify filter logic

* refactor: simplify fetching

* refactor: imports

* refactor: prop name

* refactor: CSAT response to use new APIs

* refactor: use common filter event

* refactor: use computed value for validGroupBy

* refactor: better function names

* refactor: rename prop

* refactor: remove redundant props

* refactor: separate agents filter component

* feat: add labels filter

* feat: add inboxes filter

* fix: event

* refactor: send label and inbox along with request payload

* feat: add inbox filter

* feat: add inbox to download

* refactor: use request payload from computed property

* refactor: params

* feat: add team to csat filters

* feat: add team to csat filters

* feat: add filter for rating

* feat: reverse options

* feat: add labels for ratings and translations

* feat: update translation

* fix: margin and spacing

* fix: trailing whitespace

* feat: add tests for filters

* chore: move files

* feat: add try catch with alerts

* feat: update import

* fix: imports

* Updates broken imports

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-05-18 22:50:46 +05:30

149 lines
2.9 KiB
JavaScript

export const MESSAGE_STATUS = {
FAILED: 'failed',
SENT: 'sent',
DELIVERED: 'delivered',
READ: 'read',
PROGRESS: 'progress',
};
export const MESSAGE_TYPE = {
INCOMING: 0,
OUTGOING: 1,
ACTIVITY: 2,
TEMPLATE: 3,
};
export const CONVERSATION_STATUS = {
OPEN: 'open',
RESOLVED: 'resolved',
PENDING: 'pending',
SNOOZED: 'snoozed',
};
export const CONVERSATION_PRIORITY = {
URGENT: 'urgent',
HIGH: 'high',
LOW: 'low',
MEDIUM: 'medium',
};
export const CONVERSATION_PRIORITY_ORDER = {
urgent: 1,
high: 2,
medium: 3,
low: 4,
null: 5,
};
// Size in mega bytes
export const MAXIMUM_FILE_UPLOAD_SIZE = 40;
export const MAXIMUM_FILE_UPLOAD_SIZE_TWILIO_SMS_CHANNEL = 5;
export const ALLOWED_FILE_TYPES =
'image/*,' +
'audio/*,' +
'video/*,' +
'.3gpp,' +
'text/csv, text/plain, application/json, application/pdf, text/rtf,' +
'application/zip, application/x-7z-compressed application/vnd.rar application/x-tar,' +
'application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/vnd.oasis.opendocument.text,' +
'application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
'application/vnd.openxmlformats-officedocument.wordprocessingml.document,';
export const ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP =
'image/png, image/jpeg,' +
'audio/mpeg, audio/opus, audio/ogg, audio/amr,' +
'video/mp4,' +
'application/pdf,';
export const CSAT_RATINGS = [
{
key: 'disappointed',
translationKey: 'CSAT.RATINGS.POOR',
emoji: '😞',
value: 1,
color: '#FDAD2A',
},
{
key: 'expressionless',
translationKey: 'CSAT.RATINGS.FAIR',
emoji: '😑',
value: 2,
color: '#FFC532',
},
{
key: 'neutral',
translationKey: 'CSAT.RATINGS.AVERAGE',
emoji: '😐',
value: 3,
color: '#FCEC56',
},
{
key: 'grinning',
translationKey: 'CSAT.RATINGS.GOOD',
emoji: '😀',
value: 4,
color: '#6FD86F',
},
{
key: 'smiling',
emoji: '😍',
translationKey: 'CSAT.RATINGS.EXCELLENT',
value: 5,
color: '#44CE4B',
},
];
export const AUDIO_FORMATS = {
WEBM: 'audio/webm',
OGG: 'audio/ogg',
WAV: 'audio/wav',
};
export const MESSAGE_VARIABLES = [
{
label: 'Conversation Id',
key: 'conversation.id',
},
{
label: 'Contact Id',
key: 'contact.id',
},
{
label: 'Contact name',
key: 'contact.name',
},
{
label: 'Contact first name',
key: 'contact.first_name',
},
{
label: 'Contact last name',
key: 'contact.last_name',
},
{
label: 'Contact email',
key: 'contact.email',
},
{
label: 'Contact phone',
key: 'contact.phone',
},
{
label: 'Agent name',
key: 'agent.name',
},
{
label: 'Agent first name',
key: 'agent.first_name',
},
{
label: 'Agent last name',
key: 'agent.last_name',
},
{
label: 'Agent email',
key: 'agent.email',
},
];