From fb4aa58a75b917fe3dc8fc87e5c8b52381f7a572 Mon Sep 17 00:00:00 2001 From: Qstick Date: Tue, 22 Oct 2019 20:42:46 -0400 Subject: [PATCH] Fixed: Add Delete Button to Custom Formats --- .../CustomFormats/CustomFormat.js | 11 +++++++- .../EditCustomFormatModalContent.css | 5 ++++ .../EditCustomFormatModalContent.js | 18 +++++++++++-- .../CustomFormats/CustomFormatService.cs | 27 +++++-------------- 4 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.css diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormat.js b/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormat.js index 510f5b555..dacc0c019 100644 --- a/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormat.js +++ b/frontend/src/Settings/CustomFormats/CustomFormats/CustomFormat.js @@ -118,7 +118,16 @@ class CustomFormat extends Component { isOpen={this.state.isDeleteCustomFormatModalOpen} kind={kinds.DANGER} title="Delete Custom Format" - message={`Are you sure you want to delete the custom format '${name}'?`} + message={ +
+
+ Are you sure you want to delete custom format '{name}'? +
+
+ This will remove all associations to this format in the DB. This may result in existing files being updated. +
+
+ } confirmLabel="Delete" isSpinning={isDeleting} onConfirm={this.onConfirmDeleteCustomFormat} diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.css b/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.css new file mode 100644 index 000000000..a2b6014df --- /dev/null +++ b/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.css @@ -0,0 +1,5 @@ +.deleteButton { + composes: button from '~Components/Link/Button.css'; + + margin-right: auto; +} diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.js b/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.js index c3e41d0a8..879c143aa 100644 --- a/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.js +++ b/frontend/src/Settings/CustomFormats/CustomFormats/EditCustomFormatModalContent.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { inputTypes } from 'Helpers/Props'; +import { inputTypes, kinds } from 'Helpers/Props'; import Button from 'Components/Link/Button'; import SpinnerErrorButton from 'Components/Link/SpinnerErrorButton'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; @@ -12,6 +12,7 @@ import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormLabel from 'Components/Form/FormLabel'; import FormInputGroup from 'Components/Form/FormInputGroup'; +import styles from './EditCustomFormatModalContent.css'; class EditCustomFormatModalContent extends Component { @@ -28,6 +29,7 @@ class EditCustomFormatModalContent extends Component { onInputChange, onSavePress, onModalClose, + onDeleteCustomFormatPress, ...otherProps } = this.props; @@ -92,6 +94,17 @@ class EditCustomFormatModalContent extends Component { + { + id && + + } +