Skip to content

Commit

Permalink
Adds copy import command button
Browse files Browse the repository at this point in the history
Adds a copy import command button to the module page. This is part of ChatTriggers#49 however I'm not sure how to do the auto import button, so at the moment this is what I've got.
  • Loading branch information
qkleinfelter committed Nov 21, 2019
1 parent 046d876 commit 2a2800c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pages/ModulePage/Releases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export default observer((): JSX.Element => {
window.open(`${BASE_URL}/modules/${modulesStore.activeModule.id}/releases/${releaseId}?file=scripts`, 'scripts.zip');
});

const onCopyCommand = (): void => {
navigator.clipboard.writeText(`/ct import ${modulesStore.activeModule.name}`);
};

return (
<>
<DeleteReleaseDialog
Expand Down Expand Up @@ -209,6 +213,14 @@ export default observer((): JSX.Element => {
<ListItem style={{ padding: 0 }}>
<ListItemText primary={label} />
<Desktop>
<Button
className={classes.releasesDownloadButton}
variant="contained"
size="small"
onClick={onCopyCommand}
>
Copy Import Command
</Button>
<Button
className={classes.releasesDownloadButton}
variant="contained"
Expand Down

0 comments on commit 2a2800c

Please sign in to comment.