Skip to content

Commit

Permalink
Merge pull request #3060 from glific/minor-fixes
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
akanshaaa19 authored Sep 4, 2024
2 parents 4f5156e + c894a57 commit 261cba3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/containers/Template/Template.test.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,6 @@ export const getSpendSendTemplate = {
export const updateSessiontemplate = {
request: {
query: UPDATE_TEMPLATE,
variables: {
id: '1',
input: {
translations:
'{"2":{"status":"approved","languageId":{"localized":true,"locale":"hi","label":"Hindi","id":"2","__typename":"Language"},"label":"hey","isHsm":false,"body":"hindi translations","MessageMedia":null},"undefined":{"status":"approved","languageId":null,"label":"title","body":"message","MessageMedia":{"type":"IMAGE","sourceUrl":"https://images.ctfassets.net/hrltx12pl8hq/28ECAQiPJZ78hxatLTa7Ts/2f695d869736ae3b0de3e56ceaca3958/free-nature-images.jpg?fit=fill&w=1200&h=630"},"isHsm":false}}',
},
},
},
result: {
data: {
Expand Down Expand Up @@ -663,6 +656,7 @@ export const updateSessiontemplate = {
},
},
},
variableMatcher: (variables: any) => true,
};

export const TEMPLATE_MOCKS = [
Expand Down
10 changes: 8 additions & 2 deletions src/containers/Ticket/TicketList/TicketList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import styles from './TicketList.module.css';
import { BulkAction } from './BulkAction/BulkAction';
import { SHORT_DATE_TIME_FORMAT } from 'common/constants';
import { ticketsInfo } from 'common/HelpData';
import { getDisplayName } from 'common/utils';
import setLogs from 'config/logs';

const getId = (id: any) => <div className={styles.TableText}>{id}</div>;
const getBody = (body: any) => <div className={styles.TableText}>{body}</div>;
Expand All @@ -38,7 +38,13 @@ const getInsertedAt = (insertedAt: string) => (
);

const getUser = (user: any) => {
let displayName = getDisplayName(user);
let contactFields: any = {};
try {
contactFields = JSON.parse(user.fields);
} catch (er) {
setLogs(er, 'error');
}
const displayName = contactFields?.name?.value || user?.name || user?.maskedPhone || '';
return <div className={styles.TableText}>{displayName}</div>;
};

Expand Down

0 comments on commit 261cba3

Please sign in to comment.