Repository navigation
M3-5331: Remove redundant headers #7814
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 |
|---|---|---|
|
|
@@ -28,36 +28,20 @@ import getAPIErrorFor from 'src/utilities/getAPIErrorFor'; | |
| import scrollErrorIntoView from 'src/utilities/scrollErrorIntoView'; | ||
|
|
||
| type ClassNames = | ||
| | 'root' | ||
| | 'title' | ||
| | 'intro' | ||
| | 'modeControl' | ||
| | 'sshWrap' | ||
| | 'keyTextarea' | ||
| | 'image' | ||
| | 'addNew' | ||
| | 'remove' | ||
| | 'button'; | ||
| | 'addNew'; | ||
|
|
||
| const styles = (theme: Theme) => | ||
| createStyles({ | ||
| root: { | ||
| padding: theme.spacing(3), | ||
| paddingBottom: theme.spacing(3), | ||
| }, | ||
| title: { | ||
| marginBottom: theme.spacing(2), | ||
| }, | ||
| intro: { | ||
| marginBottom: theme.spacing(2), | ||
| }, | ||
| modeControl: { | ||
| display: 'flex', | ||
| }, | ||
| image: { | ||
| display: 'flex', | ||
| flexWrap: 'wrap', | ||
| }, | ||
| addNew: { | ||
| ...theme.applyLinkStyles, | ||
| marginTop: theme.spacing(2), | ||
|
|
@@ -70,13 +54,6 @@ const styles = (theme: Theme) => | |
| minWidth: 415, | ||
| }, | ||
| }, | ||
| remove: { | ||
| ...theme.applyLinkStyles, | ||
| }, | ||
| button: { | ||
| margin: 0, | ||
| padding: 0, | ||
| }, | ||
| }); | ||
|
|
||
| interface State { | ||
|
|
@@ -154,21 +131,20 @@ class LishSettings extends React.Component<CombinedProps, State> { | |
| }); | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <> | ||
| <DocumentTitleSegment segment="LISH Console Settings" /> | ||
| <Paper className={classes.root}> | ||
| <Typography variant="h2" className={classes.title} data-qa-title> | ||
| LISH Console Settings | ||
| </Typography> | ||
| {success && <Notice success text={success} />} | ||
| {authorizedKeysError && <Notice error text={authorizedKeysError} />} | ||
| {generalError && <Notice error text={generalError} />} | ||
| <Paper> | ||
| {success ? <Notice success text={success} /> : null} | ||
| {authorizedKeysError ? ( | ||
| <Notice error text={authorizedKeysError} /> | ||
| ) : null} | ||
| {generalError ? <Notice error text={generalError} /> : null} | ||
| <Typography className={classes.intro}> | ||
| This controls what authentication methods are allowed to connect to | ||
| the Lish console servers. | ||
| </Typography> | ||
| {loading ? null : ( | ||
| <React.Fragment> | ||
| <> | ||
| <FormControl className={classes.modeControl}> | ||
| <Select | ||
| textFieldProps={{ | ||
|
|
@@ -199,47 +175,48 @@ class LishSettings extends React.Component<CombinedProps, State> { | |
| className={classes.keyTextarea} | ||
| data-qa-public-key | ||
| /> | ||
| {((idx === 0 && typeof authorizedKeys[0] !== 'undefined') || | ||
| idx > 0) && ( | ||
| <button | ||
| {(idx === 0 && typeof authorizedKeys[0] !== 'undefined') || | ||
| idx > 0 ? ( | ||
| <Button | ||
| buttonType="secondary" | ||
| compact | ||
| onClick={this.onPublicKeyRemove(idx)} | ||
| className={classes.remove} | ||
| data-qa-remove | ||
| > | ||
| Remove | ||
| </button> | ||
| )} | ||
| </Button> | ||
| ) : null} | ||
| </div> | ||
| ))} | ||
| <Typography style={{ paddingTop: 2 }}> | ||
| Place your SSH public keys here for use with Lish console | ||
| access. | ||
| </Typography> | ||
| <button | ||
| <Button | ||
| buttonType="secondary" | ||
| compact | ||
| onClick={this.addSSHPublicKeyField} | ||
| className={classes.addNew} | ||
| > | ||
| Add SSH Public Key | ||
| </button> | ||
| </React.Fragment> | ||
| </Button> | ||
|
Comment on lines
+195
to
+201
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same case here regarding |
||
| </> | ||
| )} | ||
| <ActionsPanel> | ||
| <Button | ||
| className={classes.button} | ||
| buttonType="primary" | ||
| onClick={this.onSubmit} | ||
| loading={this.state.submitting} | ||
| disabled={ | ||
| this.state.lishAuthMethod === this.props.lishAuthMethod && | ||
| equals(this.state.authorizedKeys, this.props.authorizedKeys) | ||
| } | ||
| loading={this.state.submitting} | ||
| onClick={this.onSubmit} | ||
| data-qa-save | ||
| > | ||
| Save | ||
| </Button> | ||
| </ActionsPanel> | ||
| </Paper> | ||
| </React.Fragment> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Used the
<Button>component instead since it's more consistent with our usages of buttons vs links