diff --git a/ui/src/application/Applications.tsx b/ui/src/application/Applications.tsx index 561e997a..5bb79011 100644 --- a/ui/src/application/Applications.tsx +++ b/ui/src/application/Applications.tsx @@ -9,6 +9,7 @@ import TableRow from '@material-ui/core/TableRow'; import Delete from '@material-ui/icons/Delete'; import Edit from '@material-ui/icons/Edit'; import CloudUpload from '@material-ui/icons/CloudUpload'; +import HighlightOffIcon from '@material-ui/icons/HighlightOff'; import React, {ChangeEvent, Component, SFC} from 'react'; import ConfirmDialog from '../common/ConfirmDialog'; import DefaultPage from '../common/DefaultPage'; @@ -84,6 +85,7 @@ class Applications extends Component> { value={app.token} lastUsed={app.lastUsed} fUpload={() => this.uploadImage(app.id)} + fDeleteImage={() => this.deleteImage(app.id)} fDelete={() => (this.deleteId = app.id)} fEdit={() => (this.updateId = app.id)} noDelete={app.internal} @@ -146,6 +148,14 @@ class Applications extends Component> { alert('Uploaded file must be of type png, jpeg or gif.'); } }; + + private deleteImage = (id: number) => { + console.log("delete for " + id) + //this.uploadId = id; + //if (this.upload) { + //this.upload.click(); + //} + }; } interface IRowProps { @@ -156,6 +166,7 @@ interface IRowProps { defaultPriority: number; lastUsed: string | null; fUpload: VoidFunction; + fDeleteImage: VoidFunction; image: string; fDelete: VoidFunction; fEdit: VoidFunction; @@ -171,6 +182,7 @@ const Row: SFC = observer( lastUsed, fDelete, fUpload, + fDeleteImage, image, fEdit, }) => ( @@ -181,6 +193,9 @@ const Row: SFC = observer( + + + {name} diff --git a/ui/src/layout/Navigation.tsx b/ui/src/layout/Navigation.tsx index 8eea338c..d1a64048 100644 --- a/ui/src/layout/Navigation.tsx +++ b/ui/src/layout/Navigation.tsx @@ -54,7 +54,7 @@ class Navigation extends Component< public render() { const {classes, loggedIn, appStore, navOpen, setNavOpen} = this.props; const {showRequestNotification} = this.state; - const apps = appStore.getItems(); + const apps = appStore.getItems().slice().sort((a,b) => a.name.localeCompare(b.name)); const userApps = apps.length === 0