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

Update notification text #390

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
65 changes: 57 additions & 8 deletions src/list/NotificationList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,65 @@
super();
this.valueKey = 'target_url';
this.renderOption = (notification: Notification): TemplateResult => {
const styles: StyleInfo = {
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'flex-start',
};
let icon = null;
let body = null;
const color = '#333';

Check warning on line 125 in src/list/NotificationList.ts

View check run for this annotation

Codecov / codecov/patch

src/list/NotificationList.ts#L123-L125

Added lines #L123 - L125 were not covered by tests

if (!notification.is_seen) {
styles['fontWeight'] = '400';
if (notification.type === 'incident:started') {
if (notification.incident.type === 'org:flagged') {
icon = Icon.incidents;
body =
'Your workspace was flagged, please contact support for assistance.';
} else if (notification.incident.type === 'org:suspended') {
icon = Icon.incidents;
body =
'Your workspace was suspended, please contact support for assistance.';
} else if (notification.incident.type === 'channel:disconnected') {
icon = Icon.channel;
body = 'Your android channel is not connected';
} else if (notification.incident.type === 'webhooks:unhealthy') {
icon = Icon.webhook;
body = 'Your webhook calls are not working properly.';
}
} else if (notification.type === 'import:finished') {
if (notification.import.type === 'contact') {
icon = Icon.contact_import;
body = `Imported ${notification.import.num_records.toLocaleString()} contacts`;
}
} else if (notification.type === 'export:finished') {
if (notification.export.type === 'contact') {
icon = Icon.contact_export;
body = 'Exported contacts';
} else if (notification.export.type === 'message') {
icon = Icon.message_export;
body = 'Exported messages';
}
} else if (notification.type === 'tickets:activity') {
icon = Icon.tickets;
body = 'New ticket activity';
} else if (notification.type === 'tickets:opened') {
icon = Icon.tickets;
body = 'New unassigned ticket';

Check warning on line 161 in src/list/NotificationList.ts

View check run for this annotation

Codecov / codecov/patch

src/list/NotificationList.ts#L127-L161

Added lines #L127 - L161 were not covered by tests
}
return html` ${getNotification(notification)} `;
return html`<div

Check warning on line 163 in src/list/NotificationList.ts

View check run for this annotation

Codecov / codecov/patch

src/list/NotificationList.ts#L163

Added line #L163 was not covered by tests
style="color:${color};display:flex;align-items:flex-start;flex-direction:row;font-weight:${notification.is_seen
? 300
: 400}"
>
${icon
? html`<div style="margin-right:0.6em">
<temba-icon name="${icon}"></temba-icon>
</div>`
: null}
<div style="display:flex;flex-direction:column">
<div style="line-height:1.1em">${body}</div>
<temba-date
style="font-size:80%"
value=${notification.created_on}
display="duration"
></temba-date>
</div>
</div>`;
};
}

Expand Down
7 changes: 4 additions & 3 deletions src/vectoricon/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// for cache busting we dynamically generate a fingerprint, use yarn svg to update
export const SVG_FINGERPRINT = '66c82f285562aa77cfca6afe6800468e';
export const SVG_FINGERPRINT = '963a11882da2ee8b18c878e911d8eaf1';

// only icons below are included in the sprite sheet
export enum Icon {
Expand Down Expand Up @@ -75,8 +75,8 @@ export enum Icon {
contact = 'user-01',
contact_archived = 'archive',
contact_blocked = 'message-x-square',
contact_export = 'users-down',
contact_import = 'users-up',
contact_export = 'download-cloud-01',
contact_import = 'upload-cloud-01',
contact_stopped = 'slash-octagon',
contact_updated = 'user-edit',
contacts = 'user-01',
Expand Down Expand Up @@ -126,6 +126,7 @@ export enum Icon {
menu = 'menu-01',
menu_collapse = 'chevron-left-double',
message = 'message-square-02',
message_export = 'download-cloud-01',
messages = 'message-square-02',
missing = 'maximize-02',
missed_call = 'phone-x',
Expand Down
2 changes: 1 addition & 1 deletion static/svg/index.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading