Skip to content

Commit

Permalink
feat: close history dialog on restore
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-chaturvedi committed Dec 10, 2024
1 parent e9e08b5 commit d369d17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/components/environments/secrets/HistoryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export const HistoryDialog = ({
historyItem={historyItem!}
index={index}
handlePropertyChange={handlePropertyChange}
onRestore={closeModal}
/>
)}
</div>
Expand Down
12 changes: 9 additions & 3 deletions frontend/components/environments/secrets/SecretPropertyDiffs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import { FaRedoAlt, FaUndoAlt } from 'react-icons/fa'
import { Button } from '../../common/Button'
import { Tag } from '../Tag'

export const SecretPropertyDiffs = (props: {
export const SecretPropertyDiffs = ({
secret,
historyItem,
index,
handlePropertyChange,
onRestore,
}: {
secret: SecretType
historyItem: SecretEventType
index: number
handlePropertyChange: Function
onRestore: Function
}) => {
const { secret, historyItem, index, handlePropertyChange } = props

const previousItem = secret.history![index - 1]!

const getAddedTags = () => {
Expand All @@ -30,6 +35,7 @@ export const SecretPropertyDiffs = (props: {

const handleRestoreValue = (value: string) => {
handlePropertyChange(secret.id, 'value', value)
onRestore()
}

return (
Expand Down

0 comments on commit d369d17

Please sign in to comment.