-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Created warning box when finding and replacing characters #1209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1209 +/- ##
==========================================
+ Coverage 45.33% 45.35% +0.01%
==========================================
Files 266 267 +1
Lines 8110 8114 +4
Branches 528 528
==========================================
+ Hits 3677 3680 +3
- Misses 4017 4018 +1
Partials 416 416
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@JacobHaimes There is a small typo in the PR title
Since GitHub puts the title into the final squashed commit message it will be saved in history. Could you edit the PR title and fix the typo? |
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 1 at r2 (raw file):
Do we want to open a follow on issue to track this? |
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 2 at r2 (raw file):
Since this PR closes #1111, the flow we use it to put "Closes #1111" in the description of the PR. When this PR is merged, GitHub will automatically close that issue then. |
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 31 at r2 (raw file):
This is just an observation @imnasnainaec would probably know best about theming. But for a warning dialogue like this I would personally expect some red or orange color to help highlight the gravity of this warning. |
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx, line 106 at r2 (raw file):
Since this tag is empty, it can be simplified to: <CharacterReplaceDialog
open={this.state.warningDialogOpen}
dialogFindValue={this.state.findValue}
dialogReplaceValue={this.state.replaceValue}
handleCancel={() => {
this.setState(() => ({
warningDialogOpen: false,
}));
}}
handleAccept={() => {
this.setState(() => ({
warningDialogOpen: false,
}));
this.props.findAndReplace(
this.state.findValue,
this.state.replaceValue
);
}}
/> |
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.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @JacobHaimes)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 2 at r2 (raw file): |
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @JacobHaimes)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 31 at r2 (raw file):
Previously, johnthagen wrote…
This is just an observation @imnasnainaec would probably know best about theming. But for a warning dialogue like this I would personally expect some red or orange color to help highlight the gravity of this warning.
Since we don't have that in our other warning dialogues, let's open that as a separate issue.
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 31 at r2 (raw file): Previously, imnasnainaec (D. Ror.) wrote…
|
…ev/TheCombine into character-replace-warning
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.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 1 at r2 (raw file):
Previously, johnthagen wrote…
Future work would be to include the number of occurrences in the warning box.
Do we want to open a follow on issue to track this?
It might be good to make one if the number of occurrences is needed in the warning.
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx, line 106 at r2 (raw file):
Previously, johnthagen wrote…
Since this tag is empty, it can be simplified to:
<CharacterReplaceDialog open={this.state.warningDialogOpen} dialogFindValue={this.state.findValue} dialogReplaceValue={this.state.replaceValue} handleCancel={() => { this.setState(() => ({ warningDialogOpen: false, })); }} handleAccept={() => { this.setState(() => ({ warningDialogOpen: false, })); this.props.findAndReplace( this.state.findValue, this.state.replaceValue ); }} />
Done.
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.
Reviewable status: 0 of 3 files reviewed, 4 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 1 at r2 (raw file):
Previously, JacobHaimes wrote…
It might be good to make one if the number of occurrences is needed in the warning.
Yes, please open a new issue for that.
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 13 at r4 (raw file):
interface ReplaceDialogProps { open: boolean; textId?: string;
Delete unused propertytextId?: string;
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.
Reviewable status: 0 of 3 files reviewed, 4 unresolved discussions (waiting on @imnasnainaec, @JacobHaimes, and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 13 at r4 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
Delete unused property
textId?: string;
Done.
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.
Reviewed 1 of 1 files at r5.
Reviewable status: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx, line 83 at r5 (raw file):
this.setState(() => ({ warningDialogOpen: true, }));
A function is only needed inside setState
when you are using a value in the previous state, such as this.setState((prevState)=>({count: prevState.count+1})
. For this case (and likewise below), you can use an object instead of a function. this.setState({warningDialogOpen: 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.
Reviewable status: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @imnasnainaec, @JacobHaimes, and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx, line 83 at r5 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
this.setState(() => ({ warningDialogOpen: true, }));
A function is only needed inside
setState
when you are using a value in the previous state, such asthis.setState((prevState)=>({count: prevState.count+1})
. For this case (and likewise below), you can use an object instead of a function.this.setState({warningDialogOpen: true))
.
Done.
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.
Reviewed 1 of 3 files at r4, 1 of 1 files at r6.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @JacobHaimes and @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 2 at r2 (raw file):
Previously, johnthagen wrote…
Will do
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johnthagen)
src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/CharacterReplaceDialog.tsx, line 2 at r2 (raw file):
Previously, JacobHaimes wrote…
Will do
Done.
Added a new warning box when clicking the apply button under find and replace. Warning displays the found characters and the new replacing characters so the user has a better grasp as to what they are modifying. Future work would be to include the number of occurrences in the warning box.
This change is