Skip to content

Commit

Permalink
Libraries upgraded to latest possible versions
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Aug 27, 2024
1 parent 692ed6c commit 91d46b3
Show file tree
Hide file tree
Showing 16 changed files with 4,610 additions and 15,743 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
"presets": [["@babel/preset-env", { "useBuiltIns": "usage", "corejs": 3}], "@babel/preset-react"]
}
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ module.exports = {
"max-len": ["error", 200],
"jsx-a11y/label-has-for": 0,
"react/require-default-props": 0,
"react/function-component-definition": "off",
"react/no-unused-class-component-methods": "off",
"default-param-last": "off",
"function-paren-newline": "off",
"no-underscore-dangle":0,
"jsx-a11y/no-static-element-interactions":0,
"lines-between-class-members": ["error", "always"],
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"class-methods-use-this": "off",
"import/no-cycle": "off",
"react/no-deprecated": "off"
},
Expand Down
2 changes: 1 addition & 1 deletion WebContent/js/components/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AtlasSnackbar extends React.Component {
this.state.timeout = clearTimeout(this.state.timeout);
this.setState({ open: false });
dispatch(popMessage());
}
};

registerMessageWithSnackbar() {
const { dispatch } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion WebContent/js/components/dialogs/AtlasDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class AtlasDialog extends React.Component {
const { dispatch, submitAction } = this.props;
dispatch(submitAction());
this.handleClose();
}
};

handleNameChange({ target }) {
this.setState({ [target.name]: target.value });
Expand Down
125 changes: 61 additions & 64 deletions WebContent/js/components/dialogs/LoginDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,71 +70,68 @@ class LoginDialog extends React.Component {
return null;
}

handleLogin = () => {
const { dispatch } = this.props;
this.setState({ firstLoginAttempted: true });
return dispatch(loginUser(this.state.username, this.state.password));
}

render() {
const { isValidating } = this.props;
const dialogContent = isValidating ? <CircularProgress />
: (
<form onSubmit={this.handleLogin} style={{ width: '500px' }}>
<TextField
id="username"
label="Username*"
value={this.state.username}
onChange={this.handleUsernameChange}
style={{ display: 'block' }}
fullWidth={true}
autoFocus={true}
/>
<TextField
id="password"
label="Password*"
type="password"
value={this.state.password}
onChange={this.handlePasswordChange}
fullWidth={true}
/>
<input type="submit" style={{ display: 'none' }} />
{this.getDialogErrorMessage()}
</form>
);

const dialogAction = !isValidating ? (<Button onClick={this.handleLogin}>Login</Button>) : null;

const dialogTitle = !isValidating
? (
<DialogTitle style={{ textAlign: 'center' }}>
<img
style={{
width: '100px', display: 'block', marginLeft: 'auto', marginRight: 'auto',
}}
src={ZoweIcon}
alt="logo"
/>
Zowe Login
</DialogTitle>
)
: null;
handleLogin = () => {
const { dispatch } = this.props;
this.setState({ firstLoginAttempted: true });
return dispatch(loginUser(this.state.username, this.state.password));
};

return (
<Dialog
open={true}
type="primary"
>
{dialogTitle}
<DialogContent>
{dialogContent}
</DialogContent>
<DialogActions>
{dialogAction}
</DialogActions>
</Dialog>
);
}
render() {
const { isValidating } = this.props;
const dialogContent = isValidating ? <CircularProgress />
: (
<form onSubmit={this.handleLogin} style={{ width: '500px' }}>
<TextField
id="username"
label="Username*"
value={this.state.username}
onChange={this.handleUsernameChange}
style={{ display: 'block' }}
fullWidth={true}
autoFocus={true}
/>
<TextField
id="password"
label="Password*"
type="password"
value={this.state.password}
onChange={this.handlePasswordChange}
fullWidth={true}
/>
<input type="submit" style={{ display: 'none' }} />
{this.getDialogErrorMessage()}
</form>
);
const dialogAction = !isValidating ? (<Button onClick={this.handleLogin}>Login</Button>) : null;
const dialogTitle = !isValidating
? (
<DialogTitle style={{ textAlign: 'center' }}>
<img
style={{
width: '100px', display: 'block', marginLeft: 'auto', marginRight: 'auto',
}}
src={ZoweIcon}
alt="logo"
/>
Zowe Login
</DialogTitle>
)
: null;
return (
<Dialog
open={true}
type="primary"
>
{dialogTitle}
<DialogContent>
{dialogContent}
</DialogContent>
<DialogActions>
{dialogAction}
</DialogActions>
</Dialog>
);
}
}

LoginDialog.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class CreateUSSResourceDialog extends React.Component {
return path;
}
return `${path}/`;
}
};

submitAction = () => {
const { USSPath, type } = this.props;
return createUSSResource(`${this.addSlashToPathIfMissing(USSPath)}${this.state.field}`, type);
}
};

updateName(newValue) {
this.setState({
Expand Down
4 changes: 2 additions & 2 deletions WebContent/js/components/dialogs/USS/SaveAsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import AtlasDialog from '../AtlasDialog';
class USSSaveAsDataset extends React.Component {
static getFileName = path => {
return path.substring(path.lastIndexOf('/') + 1);
}
};

constructor(props) {
super(props);
Expand All @@ -33,7 +33,7 @@ class USSSaveAsDataset extends React.Component {
submitAction = () => {
const { file, USSPath, content } = this.props;
return saveAsUSSResource(file, `${USSPath}/${this.state.newFileName}`, content);
}
};

updateName(newValue) {
this.setState({
Expand Down
6 changes: 3 additions & 3 deletions WebContent/js/components/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ class Editor extends React.Component {

getContent = content => {
this.setState({ currentContent: content });
}
};

dialogReturn = () => {
this.setState({ dialog: NO_DIALOG });
}
};

editorReady = () => {
const { location, dispatch } = this.props;
if (location && location.search) {
const urlQueryParams = queryString.parse(location.search);
dispatch(fetchUSSFile(urlQueryParams.file));
}
}
};

renderDialog() {
const { dispatch, file, checksum } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion WebContent/js/components/explorer/RefreshIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class RefreshIcon extends React.Component {
handleSubmit = () => {
const { submitAction } = this.props;
submitAction();
}
};

render() {
const { isFetching } = this.props;
Expand Down
14 changes: 7 additions & 7 deletions WebContent/js/containers/USSTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,32 +115,32 @@ export class USSTree extends React.Component {

dialogReturn = () => {
this.setState({ dialog: NO_DIALOG });
}
};

handleCreateDirectory = () => {
this.setState({ dialog: CREATE_DIRECTORY });
}
};

handleCreateFile = () => {
this.setState({ dialog: CREATE_FILE });
}
};

handleDelete = path => {
const { dispatch } = this.props;
dispatch(setUSSPath(getPathToResource(path)));
this.setState({ selectedResource: path });
this.setState({ dialog: DELETE });
}
};

handleDownload = path => {
const { dispatch } = this.props;
dispatch(downloadUSSResource(path));
}
};

handleOrionEdit = path => {
const { dispatch } = this.props;
dispatch(fetchUSSFile(path));
}
};

handleUpOneDirectory = () => {
const { dispatch, USSPath } = this.props;
Expand All @@ -149,7 +149,7 @@ export class USSTree extends React.Component {
} else if (USSPath.length >= 1) {
dispatch(setUSSPath('/'));
}
}
};

resetAndFetchChildren(path) {
const { dispatch } = this.props;
Expand Down
1 change: 0 additions & 1 deletion WebContent/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Copyright IBM Corporation 2016, 2019
*/

import 'whatwg-fetch';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
Expand Down
Loading

0 comments on commit 91d46b3

Please sign in to comment.