Skip to content

Commit

Permalink
Merge branch 'master' into fix/chats
Browse files Browse the repository at this point in the history
  • Loading branch information
kurund authored Dec 10, 2024
2 parents dd4db47 + 8995031 commit 20de8cb
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@emoji-mart/react": "^1.1.1",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@glific/flow-editor": "^1.26.3-15",
"@glific/flow-editor": "^1.26.3-17",
"@lexical/react": "^0.17.1",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^6.1.1",
Expand Down
7 changes: 7 additions & 0 deletions src/containers/Template/List/Template.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,11 @@
display: flex;
align-items: center;
gap: 0.25rem;
}

.SecondaryButton {
display: flex;
align-items: center;
gap: 0.5rem;
margin: 0 0.5rem
}
55 changes: 30 additions & 25 deletions src/containers/Template/List/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ export const Template = ({
value: selectedTag,
}}
/>
{syncHSMButton}
</div>
);

Expand Down Expand Up @@ -397,43 +396,49 @@ export const Template = ({

if (isHSM) {
secondaryButton = (
<div className={styles.ImportButton}>
<a href={BULK_APPLY_SAMPLE_LINK} target="_blank" rel="noreferrer" className={styles.HelperText}>
View Sample
</a>
<div className={styles.SecondaryButton}>
{syncHSMButton}
<div className={styles.ImportButton}>
<a href={BULK_APPLY_SAMPLE_LINK} target="_blank" rel="noreferrer" className={styles.HelperText}>
View Sample
</a>
<ImportButton
title={t('Bulk apply')}
onImport={() => setImporting(true)}
afterImport={(result: string, media: any) => {
const extension = getFileExtension(media.name);
if (extension !== 'csv') {
setNotification('Please upload a valid CSV file', 'warning');
setImporting(false);
} else {
bulkApplyTemplates({ variables: { data: result } });
}
}}
/>
</div>
</div>
);
}

if (provider === GUPSHUP_ENTERPRISE_SHORTCODE) {
secondaryButton = (
<div className={styles.SecondaryButton}>
{syncHSMButton}
<ImportButton
title={t('Bulk apply')}
title={t('Import templates')}
onImport={() => setImporting(true)}
afterImport={(result: string, media: any) => {
const extension = getFileExtension(media.name);
if (extension !== 'csv') {
setNotification('Please upload a valid CSV file', 'warning');
setImporting(false);
} else {
bulkApplyTemplates({ variables: { data: result } });
importTemplatesMutation({ variables: { data: result } });
}
}}
/>
</div>
);
}

if (provider === GUPSHUP_ENTERPRISE_SHORTCODE) {
secondaryButton = (
<ImportButton
title={t('Import templates')}
onImport={() => setImporting(true)}
afterImport={(result: string, media: any) => {
const extension = getFileExtension(media.name);
if (extension !== 'csv') {
setNotification('Please upload a valid CSV file', 'warning');
setImporting(false);
} else {
importTemplatesMutation({ variables: { data: result } });
}
}}
/>
);
button.show = false;
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,10 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz#81fd50d11e2c32b2d6241470e3185b70c7b30699"
integrity sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==

"@glific/flow-editor@^1.26.3-15":
version "1.26.3-15"
resolved "https://registry.yarnpkg.com/@glific/flow-editor/-/flow-editor-1.26.3-15.tgz#7f281213fb3348703343a43d8d72fb0a8f3203a6"
integrity sha512-bCDjpodnCr32ZLOgq36HvveSUXL5NibEjJ2qwnvIBeyROipHvTLFlS4zpyU7JIB+rK6SDXlgVLcWmSveNK228w==
"@glific/flow-editor@^1.26.3-17":
version "1.26.3-17"
resolved "https://registry.yarnpkg.com/@glific/flow-editor/-/flow-editor-1.26.3-17.tgz#4b38c37f908345dc77459e3cce09aca7182d43d0"
integrity sha512-438aIjOHmr2eE1icABebtKCh+g5Dd3FGlcs26PgtElu4mZVlJp+8T7wsU3N/B5Vvx5nkbL6RAMk7jxtVL9yCNQ==
dependencies:
react "^16.8.6"
react-dom "^16.8.6"
Expand Down

0 comments on commit 20de8cb

Please sign in to comment.