-
Notifications
You must be signed in to change notification settings - Fork 974
Refactor addEditBookmarkHanger.js with commonForm #8136
Refactor addEditBookmarkHanger.js with commonForm #8136
Conversation
@luixxiul Can you please find a way to add shadow to the triangle nub as part of this refactor? It is barely visible in it's current form. |
rebase pls |
@bradleyrichter I updated the arrow with box-shadow. |
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.
looks much better. thanks!
Please also move the window up so the point of the nub is between the legs of the arrow button, similar to chrome.
I tried but I cannot find an easy way of fixing it without changing default behavior (ie clicking the star button twice displays "edit bookmark" dialog); the fix should be related with z-index, which is out of scope of this PR, so I think it is a good idea to deal with the issue with another PR. Without changing z-index you'll get this: |
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.
Changes looks great, so do tests, nice job here.
left some comments regarding naming, sorry if I'm being picky but it's a step forward standardization
})} data-l10n-id={this.heading} /> | ||
<CommonFormSection> | ||
<div className={css(styles.bookmark__sectionWrapper)}> | ||
<section> |
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.
++ for section
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
// Copied from commonForm.js | ||
CommonFormSection: { |
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.
can we use camelCase here?
// PR #7985 | ||
margin: `${globalStyles.spacing.dialogInsideMargin} 30px` | ||
}, | ||
CommonFormTitle: { |
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.
ditto
@@ -98,6 +108,13 @@ const styles = StyleSheet.create({ | |||
maxWidth: globalStyles.spacing.dialogLargeWidth | |||
}, | |||
|
|||
CommonFormBookmarkHanger: { |
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.
same here
@cezaraugusto thanks for reviewing. I just missed the camel case stuff, will fix it later. |
66c6f33
to
a278055
Compare
@cezaraugusto ready for re-review. If it looks good to you, please set ready-to-merge label. I will then squash the commits to merge the test plans and sign the commit with GPG, thanks! |
Closes #6040 Addresses #7989 - Added CommonFormBookmarkHanger to commonForm.js - Added globalStyles.spacing.bookmarkHangerMaxWidth to global.js Max-width of the bookmark hanger was set to 350px. Also, setting white-space:normal makes it possible for lines to be wrapped. - Moved Dialog from addEditBookmark.js to addEditBookmarkHanger.js - Added cancel button with this.onClose as 'fa fa-close' was removed - Added const arrowUp and dialogHanger - Added box-shadow to arrowUp - Added styles.bookmarkHanger which is applied if !this.props.isModal - Copied CommonFormSection and CommonFormTitle from commonForm.js, adding CommonFormBookmarkHangerTitle to addEditBookmarkHanger.js The margin-top of the title should be reduced if this.props.isModal. - Changed backgroundColor of commonForm to #fff - Add zindex to elements on navigation bar to let tests pass The value was set to higher than that of dialog, which is 3000. - Updated test code Also: - Replaced divs with sections - Removed styles from form.less - Removed wideButton from buttons - Added testIds to buttons (bookmarkHangerRemoveButton, bookmarkHangerCancelButton, bookmarkHangerDoneButton) - Fixed camel cases Auditors: Test Plan 1: 1. Open about:preferences 2. Disable Home button 3. Click the star icon on the URL bar 4. Make sure the arrow up appears exactly under the star 5. Make sure the button appears under the icon 6. Open about:preferences 7. Enable Home button 8. Click the star icon again 9. Make sure th arrow up appears exactly under the star Test Plan 2: 1. Open about:bookmarks 2. Click the star icon on the URL bar 3. Click "Done" 4. Click the star icon again 5. Click "Remove" 6. Make sure the bookmark is successfully removed Test Plan 3: 1. Click "Add Folder" icon on about:bookmarks 2. Click "Cancel" 3. Make sure the dialog is closed Test Plan 4: 1. Create a bookmark folder on about:bookmarks 2. Edit the folder via context menu on about:bookmarks 3. Click "Remove" 4. Make sure the folder is successfully removed Test Plan 5: 1. Click the star icon on about:bookmarks 2. Click "Cancel" 3. Make sure the dialog is closed 4. Click the star icon again 5. Create a bookmark 6. Edit the bookmark via context menu 7. Click "Remove" 8. Make sure the bookmark is successfully removed
Closes #6040
Addresses #7989 #8010
Added
CommonFormBookmarkHanger
to commonForm.jsAdded
globalStyles.spacing.bookmarkHangerMaxWidth
to global.jsMax-width of the bookmark hanger was set to 350px. Also, setting white-space:normal makes it possible for lines to be wrapped.
Applied
Dialog
to addEditBookmarkHanger.js instead of addEditBookmark.jsAdded cancel button with
this.onClose
as 'fa fa-close' was removedAdded const
arrowUp
anddialogHanger
Added
styles.bookmarkHanger
which is applied if!this.props.isModal
Copied
CommonFormSection
andCommonFormTitle
from commonForm.js, addingCommonFormBookmarkHangerTitle
to addEditBookmarkHanger.jsThe margin-top of the title should be reduced if
this.props.isModal
.Changed backgroundColor of commonForm to
#fff
Add zindex to elements on navigation bar to let tests pass
The value was set to higher than that of dialog, which is 3000.
Updated test code
Also:
wideButton
from buttonsAuditors:
Test Plan 1:
Test Plan 2:
Test Plan 3:
Test Plan 4:
Test Plan 5:
git rebase -i
to squash commits (if needed).Test Plan: