-
Notifications
You must be signed in to change notification settings - Fork 16
Firefly-1936: clean up obscore/datalink titles and refactor most to a single file #1909
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
base: dev
Are you sure you want to change the base?
Conversation
|
low-key minor menu placement weirdness video1362293883.mp4 |
|
i don't know why i kept saying 'right' when i clearly meant 'left' ... and it does seem to be related to the length of the filename...? |
|
@lrebull the menu is shifted because is it so wide now that it uses a different layout approach. The normal is right if it fits, it it does not then it goes left. If you made your browser wider it would probably go back to the right. |
dcebd20 to
8a231cd
Compare
jaladh-singhal
left a comment
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.
Tested spherex - the ancillary products dropdown looks much cleaner now. I didn't notice Luisa's issue, drodown is always on the right for me - likely because I'm using my large monitor over laptop screen.
Code seems fine - left some minor comments.
| case Format.HTML : return result( | ||
| 'Open', | ||
| title ? `${title}${otMsg} (html)` : undefined, | ||
| 'This is a web page or web application. It can be open in another tab', |
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 is a web page or web application. It can be open in another tab', | |
| 'This is a web page or web application. It can be opened in another tab', |
small typo
| const result= (title,dropDownText,message='',loadInBrowserMsg=undefined) => | ||
| ({title,dropDownText,message,loadInBrowserMsg}); | ||
| const otMsg= makeObsTitleExtension(obsTitle); | ||
|
|
||
| switch (fileType) { | ||
| case Format.PNG : return result( | ||
| `${title??''}${otMsg} (PNG image)`, | ||
| title ? `${title}${otMsg} (PNG image)` : undefined); | ||
|
|
||
| case Format.JSON : return result( | ||
| 'Show JSON file'+otMsg, | ||
| title ? `${title}${otMsg} (JSON File)` : undefined); | ||
|
|
||
| case Format.YAML : return result( | ||
| 'Show yaml file'+otMsg, | ||
| title ? `${title}${otMsg} (YAML File)` : undefined); |
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 can be improved for readability using object destructing and overriding syntax - the positional arguments obscure what is being overridden. title and dropdownText can be made even less redundant in each case:
| const result= (title,dropDownText,message='',loadInBrowserMsg=undefined) => | |
| ({title,dropDownText,message,loadInBrowserMsg}); | |
| const otMsg= makeObsTitleExtension(obsTitle); | |
| switch (fileType) { | |
| case Format.PNG : return result( | |
| `${title??''}${otMsg} (PNG image)`, | |
| title ? `${title}${otMsg} (PNG image)` : undefined); | |
| case Format.JSON : return result( | |
| 'Show JSON file'+otMsg, | |
| title ? `${title}${otMsg} (JSON File)` : undefined); | |
| case Format.YAML : return result( | |
| 'Show yaml file'+otMsg, | |
| title ? `${title}${otMsg} (YAML File)` : undefined); | |
| const otMsg= makeObsTitleExtension(obsTitle); | |
| const defaultResult = (fileLabel) => | |
| ({title: `Show ${fileLabel}`+otMsg, | |
| dropDownText: title ? `${title}${otMsg} (${fileLabel})` : undefined, | |
| message: '', | |
| loadInBrowserMsg: undefined | |
| }); | |
| switch (fileType) { | |
| case Format.PNG : return ({ | |
| ...defaultResult('PNG image'), | |
| title: `${title??''}${otMsg} (PNG image)`, | |
| }); | |
| case Format.JSON : return ({ | |
| ...defaultResult('JSON File'), | |
| // if you decide to change default in future | |
| }); | |
| case Format.YAML : return ({ | |
| ...defaultResult('YAML File'), | |
| // if you decide to change default in future | |
| }); |
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.
good suggestion. I was not that happy this this code for that reason.
Firefly-1936: Clean up obscore/datalink titles and refactor most to a single file
Testing: