Skip to content

Commit

Permalink
added hsm
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshamoon committed Jul 9, 2023
1 parent 3c51c75 commit 3283867
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/containers/Chat/ChatMessages/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export const ChatMessages = ({ contactId, collectionId, startingHeight }: ChatMe

// if conversation is not present then fetch the collection
if (conversationIndex < 0) {
if (!loading && !data) {
if ((!loading && !called) || (data && data.search[0].group.id !== collectionId)) {
const variables = {
filter: { id: collectionId, searchGroup: true },
contactOpts: { limit: DEFAULT_CONTACT_LIMIT },
Expand Down
16 changes: 15 additions & 1 deletion src/containers/Template/List/Template.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
display: flex;
font-weight: 500;
font-size: 20px;
margin: 12px 0px;
margin-top: 12px;
margin-bottom: 6px;
line-height: 1;
word-break: break-all;
}
Expand Down Expand Up @@ -92,3 +93,16 @@
position: relative;
margin-bottom: 8px;
}

.Uuid {
display: flex;
align-items: center;
cursor: pointer;
font-size: 12px;
color: #93a29b !important;
}

.Copy {
margin-left: 2px;
font-size: 12px;
}
24 changes: 20 additions & 4 deletions src/containers/Template/List/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,28 @@ import { ReactComponent as ApprovedIcon } from 'assets/images/icons/Template/App
import { ReactComponent as RejectedIcon } from 'assets/images/icons/Template/Rejected.svg';
import { ReactComponent as PendingIcon } from 'assets/images/icons/Template/Pending.svg';
import { ProviderContext } from 'context/session';
import { exportCsvFile, getFileExtension } from 'common/utils';
import { copyToClipboardMethod, exportCsvFile, getFileExtension } from 'common/utils';
import Loading from 'components/UI/Layout/Loading/Loading';
import { setNotification } from 'common/notification';
import { BULK_APPLY_SAMPLE_LINK } from 'config';
import styles from './Template.module.css';

const getLabel = (label: string) => <div className={styles.LabelText}>{label}</div>;
import { CopyAllOutlined } from '@mui/icons-material';

const getLabel = (label: string, uuid: string) => (
<div>
<div className={styles.LabelText}>{label}</div>
{uuid && (
<div
className={styles.Uuid}
onClick={() => {
copyToClipboardMethod(uuid);
}}
>
{uuid} <CopyAllOutlined className={styles.Copy} />
</div>
)}
</div>
);

const getBody = (text: string) => <p className={styles.TableText}>{WhatsAppToJsx(text)}</p>;

Expand Down Expand Up @@ -183,10 +198,11 @@ export const Template = ({
translations,
status,
reason,
bsp,
}: any) => {
const columns: any = {
id,
label: getLabel(label),
label: getLabel(label, bsp),
body: getBody(body),
};
if (isHSM) {
Expand Down
1 change: 1 addition & 0 deletions src/graphql/queries/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const FILTER_TEMPLATES = gql`
query sessionTemplates($filter: SessionTemplateFilter!, $opts: Opts!) {
sessionTemplates(filter: $filter, opts: $opts) {
${templateFields}
bsp
shortcode
status
reason
Expand Down

0 comments on commit 3283867

Please sign in to comment.