Skip to content

Commit

Permalink
Revert "add a discard button"
Browse files Browse the repository at this point in the history
This reverts commit 0079afa.
  • Loading branch information
fsimonjetz committed May 6, 2024
1 parent b7dbbc5 commit 26352bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions src/fragmentarium/ui/fragment/ArchaeologyEditor.sass

This file was deleted.

17 changes: 1 addition & 16 deletions src/fragmentarium/ui/fragment/ArchaeologyEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ArchaeologyDto } from 'fragmentarium/domain/archaeologyDtos'
import { Fragment } from 'fragmentarium/domain/fragment'
import withData from 'http/withData'
import { FindspotService } from 'fragmentarium/application/FindspotService'
import './ArchaeologyEditor.sass'

interface Props {
archaeology?: Archaeology
Expand Down Expand Up @@ -48,7 +47,7 @@ interface FindspotOption {

class ArchaeologyEditor extends Component<Props, State> {
private isDirty = false
private originalState: Readonly<State>
private originalState: State
private updateArchaeology: (archaeology: ArchaeologyDto) => Promise<Fragment>
private findspotsById: ReadonlyMap<number, Findspot>
private findspots: readonly Findspot[]
Expand Down Expand Up @@ -137,12 +136,6 @@ class ArchaeologyEditor extends Component<Props, State> {
}
}

reset = (event: React.MouseEvent<HTMLElement>): void => {
this.isDirty = false
this.setState(this.originalState)
event.currentTarget.blur()
}

submit = (event: FormEvent<HTMLElement>): void => {
event.preventDefault()

Expand Down Expand Up @@ -230,18 +223,10 @@ class ArchaeologyEditor extends Component<Props, State> {
<Form.Row>{this.renderExcavationSiteForm()}</Form.Row>
<Form.Row>{this.renderIsRegularExcavationForm()}</Form.Row>
<Form.Row>{this.renderFindspotForm()}</Form.Row>
<Button
variant="danger"
disabled={this.props.disabled || !this.isDirty}
onClick={this.reset}
>
Discard
</Button>
<Button
variant="primary"
type="submit"
disabled={this.props.disabled || !this.isDirty}
className={'submit-button'}
>
Save
</Button>
Expand Down

0 comments on commit 26352bf

Please sign in to comment.