-
-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Tag Confirmation #4016
base: develop
Are you sure you want to change the base?
Auto Tag Confirmation #4016
Conversation
Very nice, this will definitely help prevent accidental presses or unaware users from activating these irreversible features. I have just two comments:
|
return ( | ||
<DirectorySelectionDialog | ||
allowPathSelection={dialogOpen.clean} | ||
message={msg} | ||
header={intl.formatMessage({ id: "actions.clean" })} | ||
icon={faTrashAlt} | ||
acceptButtonText={intl.formatMessage({ id: "actions.clean" })} | ||
acceptButtonVariant="danger" | ||
onClose={(p) => { | ||
// undefined means cancelled | ||
if (p !== undefined) { | ||
if (dialogOpen.cleanAlert) { | ||
// don't provide paths | ||
onClean(); | ||
} else { | ||
onClean(p); | ||
} | ||
} | ||
|
||
setDialogOpen({ | ||
clean: false, | ||
cleanAlert: false, | ||
}); | ||
}} | ||
/> | ||
); | ||
} | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why couldn't this have been put into the existing CleanDialog
instead of removing the CleanDialog
altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I duplicated the CleanDialog
code over into LibraryTasks.tsx
as an AutoTagDialog
.
That was almost identical code, and now a third instance of the DirectorySelectionDialog
code. So I pulled CleanDialog
and AutoTagDialog
out into a new component file.
This new file was almost identical to DirectorySelectionDialog
, except for the extra styling options, message and option to hide the directory selection.
I thought about adding the styling options to DirectorySelectionDialog
and replacing the directory code in my new file with that component, but I would have to deconstruct DirectorySelectionDialog
because it already has a <ModalComponent>
that I couldn't wrap in my higher level <ModelComponent>
.
I figured since I was already going to add all the styling options to it, adding message and the option to totally hide it was less complicated and less error prone than trying to refactor DirectorySelectionDialog
and pull out the directory selection code into a sub component that could be imported into an OptionalDirectorySelectionDialog
component.
I could do that if you think it would be a better approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I duplicated the CleanDialog code over into LibraryTasks.tsx as an AutoTagDialog.
That was almost identical code, and now a third instance of the DirectorySelectionDialog code. So I pulled CleanDialog and AutoTagDialog out into a new component file.
This new file was almost identical to DirectorySelectionDialog, except for the extra styling options, message and option to hide the directory selection.
Please do this instead for now. We can address the duplicate code later if needed.
animation, | ||
allowEmpty = false, | ||
initialPaths = [], | ||
allowPathSelection = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire concept is a bit broken from a design perspective. The component is a DirectorySelectionDialog
, but we have a flag to disable the entire purpose of the dialog? I think there's a better way to do this.
Added a line confirming which object you just clicked Auto Tag for. Took your suggestion and reworked the text into a description and warning, so I could add a warning icon along with the warning text. I've updated the PR description with screenshots. |
Resolves #3909
Implements most of the suggestions from the ticket, except for a button to hide the dialogue in the future. I didn't see any similar functionality in Stash, and don't want to incorrectly build new features.
Other
DirectorySettingDialog.tsx
to allow customization and potentially hide the directory picker. This was copied from how the Clean task dialogs were doing their own directory picking, and the Clean task was refactored to use the updatedDirectorySettingDialog.tsx
. So now you can have a directory picking dialog that doesn't show you any directories, but all of the directory picking code is no longer duplicated for the Clean task.