-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DT-934] Create a banner similar to the Terra Banner on DUOS to inform users that chrome is our preferred browser #2710
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import './Alert.css'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import { Button } from '@mui/material'; | ||
|
||
export interface ActionableAlertProps { | ||
id: string; | ||
type: string; | ||
title: string; | ||
description: string; | ||
onClose?: () => void; | ||
actionText: string; | ||
onClick?: () => void; | ||
} | ||
|
||
export const ActionableAlert = (props: ActionableAlertProps) => { | ||
const {id, type, title, description, onClose, actionText, onClick} = props; | ||
return ( | ||
<div id={`${id}_alert`} className={`alert-wrapper ${type}`} style={{border: '1px solid red', borderRadius: '5px'}}> | ||
{onClose && <span | ||
style={{float: 'right', fontWeight: 'bolder', fontSize: 24, cursor: 'pointer'}} | ||
onClick={onClose} ><CloseIcon/></span> } | ||
{title && <h4 id={`${id}_title`} className="alert-title">{title}</h4>} | ||
{description && <span id={`${id}_description`} className="alert-description">{description}</span>} | ||
{actionText && <Button | ||
variant='outlined' | ||
color='error' | ||
onClick={onClick} | ||
sx={{fontSize: 10, marginTop: 2}} | ||
> | ||
{actionText} | ||
</Button>} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,8 @@ | |
} | ||
}, | ||
"include": [ | ||
"src" | ||
"src", | ||
"types/index.d.ts" | ||
], | ||
"plugins": ["@typescript-eslint", "import"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module "browser-version-detection/src/browser-detection" { | ||
export function detectBrowser(nav: { userAgent: string }): any | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should lock this version down so it doesn't automatically change.
This version hasn't seen any updates for 7 years, and the implementation is straightforward, so I would continue to advocate not depending on a package to do this and instead using a simple regex for browser detection (which is ultimately what this library and the previous one do).
In general, browser detection is not recommended, although I know we also do this on Terra UI. It might be better to identify the specific features that Safari doesn't support, and long term work to either stop depending on these features or use polyfills for those features that we really need. This is a separate issue from showing the alert, so in the meantime we might still want to show the alert regardless of whether we are doing browser or feature detection.
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.
I'm a little confused here ... the latest release version I see is 3.1.0 that is from last year. Is there a reason we're looking at 2.1.8 (which I don't even see in the list of releases)? I do see that NPM sees 2.1.8, which is extra confusing.
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.
Aside from the library version question, I do agree in theory with Florian's feedback. To date, the only issue we've seen with Safari is variations in CSS rendering. I don't think we're using any browser-specific features, so to really tackle that question, we'd need a different kind of investigation effort.