diff --git a/genie-web/src/main/resources/static/scripts/Application.js b/genie-web/src/main/resources/static/scripts/Application.js
index 7f8f26c4e40..a6028e32f8b 100644
--- a/genie-web/src/main/resources/static/scripts/Application.js
+++ b/genie-web/src/main/resources/static/scripts/Application.js
@@ -19,7 +19,7 @@ export default class Application extends Page {
name: "status",
value: "",
type: "option",
- optionValues: [ "", "ACTIVE", "DEPRECATED", "INACTIVE" ]
+ optionValues: ["", "ACTIVE", "DEPRECATED", "INACTIVE"]
},
{ label: "Tag", name: "tag", value: "", type: "input" },
{ label: "Type", name: "type", value: "", type: "input" },
@@ -28,7 +28,7 @@ export default class Application extends Page {
name: "sort",
value: "",
type: "select",
- selectFields: [ "name", "status", "tag" ].map(field => ({
+ selectFields: ["name", "status", "tag"].map(field => ({
value: field,
label: field
}))
@@ -38,7 +38,7 @@ export default class Application extends Page {
name: "sortOrder",
value: "desc",
type: "sortOption",
- optionValues: [ "desc", "asc" ]
+ optionValues: ["desc", "asc"]
}
];
}
diff --git a/genie-web/src/main/resources/static/scripts/Cluster.js b/genie-web/src/main/resources/static/scripts/Cluster.js
index 5ba1283104e..cf76e791504 100644
--- a/genie-web/src/main/resources/static/scripts/Cluster.js
+++ b/genie-web/src/main/resources/static/scripts/Cluster.js
@@ -19,7 +19,7 @@ export default class Cluster extends Page {
name: "status",
value: "",
type: "option",
- optionValues: [ "", "UP", "OUT_OF_SERVICE", "TERMINATED" ]
+ optionValues: ["", "UP", "OUT_OF_SERVICE", "TERMINATED"]
},
{ label: "Tag", name: "tag", value: "", type: "input" },
{
@@ -27,7 +27,7 @@ export default class Cluster extends Page {
name: "sort",
value: "",
type: "select",
- selectFields: [ "name", "status", "tag" ].map(field => ({
+ selectFields: ["name", "status", "tag"].map(field => ({
value: field,
label: field
}))
@@ -37,7 +37,7 @@ export default class Cluster extends Page {
name: "sortOrder",
value: "desc",
type: "sortOption",
- optionValues: [ "desc", "asc" ]
+ optionValues: ["desc", "asc"]
}
];
}
diff --git a/genie-web/src/main/resources/static/scripts/Command.js b/genie-web/src/main/resources/static/scripts/Command.js
index c4ae2a36811..4cbf06da992 100644
--- a/genie-web/src/main/resources/static/scripts/Command.js
+++ b/genie-web/src/main/resources/static/scripts/Command.js
@@ -20,7 +20,7 @@ export default class Command extends Page {
name: "status",
value: "",
type: "option",
- optionValues: [ "", "ACTIVE", "DEPRECATED", "INACTIVE" ]
+ optionValues: ["", "ACTIVE", "DEPRECATED", "INACTIVE"]
},
{ label: "Tag", name: "tag", value: "", type: "input" },
{
@@ -28,7 +28,7 @@ export default class Command extends Page {
name: "sort",
value: "",
type: "select",
- selectFields: [ "name", "user", "status", "tag" ].map(field => ({
+ selectFields: ["name", "user", "status", "tag"].map(field => ({
value: field,
label: field
}))
@@ -38,7 +38,7 @@ export default class Command extends Page {
name: "sortOrder",
value: "desc",
type: "sortOption",
- optionValues: [ "desc", "asc" ]
+ optionValues: ["desc", "asc"]
}
];
}
diff --git a/genie-web/src/main/resources/static/scripts/Job.js b/genie-web/src/main/resources/static/scripts/Job.js
index 50824dc443f..70002ce4314 100644
--- a/genie-web/src/main/resources/static/scripts/Job.js
+++ b/genie-web/src/main/resources/static/scripts/Job.js
@@ -36,7 +36,7 @@ export default class Job extends Page {
name: "startTime",
value: [],
type: "timeRange",
- queryMapping: [ "minStarted", "maxStarted" ],
+ queryMapping: ["minStarted", "maxStarted"],
mapper: x => moment(parseInt(x, 10)).utc()
},
{
@@ -44,7 +44,7 @@ export default class Job extends Page {
name: "finishedTime",
value: [],
type: "timeRange",
- queryMapping: [ "minFinished", "maxFinished" ],
+ queryMapping: ["minFinished", "maxFinished"],
mapper: x => moment(parseInt(x, 10)).utc()
},
{
@@ -52,7 +52,7 @@ export default class Job extends Page {
name: "size",
value: 25,
type: "option",
- optionValues: [ 10, 25, 50, 100 ]
+ optionValues: [10, 25, 50, 100]
},
{
label: "Sort By",
@@ -76,7 +76,7 @@ export default class Job extends Page {
name: "sortOrder",
value: "desc",
type: "sortOption",
- optionValues: [ "desc", "asc" ]
+ optionValues: ["desc", "asc"]
}
];
}
diff --git a/genie-web/src/main/resources/static/scripts/OutputDirectory.js b/genie-web/src/main/resources/static/scripts/OutputDirectory.js
index 7dffa9f2d6d..30c9196c516 100644
--- a/genie-web/src/main/resources/static/scripts/OutputDirectory.js
+++ b/genie-web/src/main/resources/static/scripts/OutputDirectory.js
@@ -35,13 +35,13 @@ export default class OutputDirectory extends React.Component {
}
get headers() {
- return [ { url: "#", name: "GENIE", className: "supress" } ];
+ return [{ url: "#", name: "GENIE", className: "supress" }];
}
loadData(url) {
fetch(`/api/v3/jobs/${url}`)
.done(output => {
- const [ jobId, ...ignored ] = url.split("/");
+ const [jobId, ...ignored] = url.split("/");
this.setState({
output,
jobId,
@@ -71,38 +71,32 @@ export default class OutputDirectory extends React.Component {
return (
- {
- this.state.error ?
+ {this.state.error
+ ?
Output not found
← back
-
:
- {
- this.state.fetching && !this.state.error ?
:
+
+ :
+ {this.state.fetching && !this.state.error
+ ?
+ :
- {
- this.state.output.files.length === 0 &&
- this.state.output.directories.length === 0
- ?
Empty directory
- :
+ {this.state.output.files.length === 0 &&
+ this.state.output.directories.length === 0
+ ?
Empty directory
+ :
- }
-
- }
-
- }
+
}
+
}
+
}
);
@@ -195,7 +189,7 @@ DirectoryInfo.propTypes = {
};
const Navigation = props => {
- const [ jobId, output, ...path ] = props.url.split("/");
+ const [jobId, output, ...path] = props.url.split("/");
let breadCrumbs = [];
// Home Button
breadCrumbs.push(
diff --git a/genie-web/src/main/resources/static/scripts/Page.js b/genie-web/src/main/resources/static/scripts/Page.js
index cb03a37173b..49154d29823 100644
--- a/genie-web/src/main/resources/static/scripts/Page.js
+++ b/genie-web/src/main/resources/static/scripts/Page.js
@@ -57,7 +57,6 @@ export default class Page extends React.Component {
const { rowId = null, showSearchForm = "true" } = query;
this.setState({ query, data: [] });
- // Loading state
fetch(this.url, query)
.done(data => {
if (data.hasOwnProperty("_embedded")) {
@@ -83,12 +82,12 @@ export default class Page extends React.Component {
render() {
const sideBar = this.state.showSearchForm
?
+ query={this.state.query}
+ formFields={this.formFields}
+ hiddenFormFields={this.hiddenFormFields}
+ toggleSearchForm={this.toggleSearchForm}
+ searchPath={this.searchPath}
+ />
: ;
let resultPanel = null;
@@ -97,27 +96,25 @@ export default class Page extends React.Component {
} else {
resultPanel = this.state.data.length > 0
?
- : this.state.noSearchResult
- ?
- : ; // Default to loading...
+
+ : this.state.noSearchResult ? : ; // Default to loading...
}
return (
diff --git a/genie-web/src/main/resources/static/scripts/components/ApplicationDetails.js b/genie-web/src/main/resources/static/scripts/components/ApplicationDetails.js
index e4f31ed73c1..95304fcfd85 100644
--- a/genie-web/src/main/resources/static/scripts/components/ApplicationDetails.js
+++ b/genie-web/src/main/resources/static/scripts/components/ApplicationDetails.js
@@ -32,11 +32,12 @@ export default class ApplicationDetails extends React.Component {
const { row } = props;
const applicationUrl = row._links.self.href;
const commandsUrl = row._links.commands.href;
- $
- .when(fetch(applicationUrl), fetch(commandsUrl))
- .done((application, commands) => {
- this.setState({ application: application[0], commands: commands[0] });
- });
+ $.when(fetch(applicationUrl), fetch(commandsUrl)).done((
+ application,
+ commands
+ ) => {
+ this.setState({ application: application[0], commands: commands[0] });
+ });
}
render() {
@@ -91,14 +92,9 @@ export default class ApplicationDetails extends React.Component {
Commands: |
- {
- this.state.commands.length > 0
- ?
- :
- }
+ {this.state.commands.length > 0
+ ?
+ : }
|
diff --git a/genie-web/src/main/resources/static/scripts/components/ClusterDetails.js b/genie-web/src/main/resources/static/scripts/components/ClusterDetails.js
index e88c5223023..7fa49155d02 100644
--- a/genie-web/src/main/resources/static/scripts/components/ClusterDetails.js
+++ b/genie-web/src/main/resources/static/scripts/components/ClusterDetails.js
@@ -71,14 +71,9 @@ export default class ClusterDetails extends React.Component {
Commands: |
- {
- this.state.commands.length > 0
- ?
- :
- }
+ {this.state.commands.length > 0
+ ?
+ : }
|
diff --git a/genie-web/src/main/resources/static/scripts/components/CommandDetails.js b/genie-web/src/main/resources/static/scripts/components/CommandDetails.js
index e05a0133aeb..5c65571ddb6 100644
--- a/genie-web/src/main/resources/static/scripts/components/CommandDetails.js
+++ b/genie-web/src/main/resources/static/scripts/components/CommandDetails.js
@@ -32,15 +32,17 @@ export default class CommandDetails extends React.Component {
const commandUrl = row._links.self.href;
const clustersUrl = `${row._links.clusters.href}?status=UP`;
const applicationsUrl = row._links.applications.href;
- $
- .when(fetch(commandUrl), fetch(clustersUrl), fetch(applicationsUrl))
- .done((command, clusters, applications) => {
- this.setState({
- command: command[0],
- clusters: clusters[0],
- applications: applications[0]
- });
+ $.when(fetch(commandUrl), fetch(clustersUrl), fetch(applicationsUrl)).done((
+ command,
+ clusters,
+ applications
+ ) => {
+ this.setState({
+ command: command[0],
+ clusters: clusters[0],
+ applications: applications[0]
});
+ });
}
render() {
@@ -88,27 +90,20 @@ export default class CommandDetails extends React.Component {
Clusters: |
- {
- this.state.clusters.length > 0
- ?
- :
- }
+ {this.state.clusters.length > 0
+ ?
+ : }
|
Applications: |
- {
- this.state.applications.length > 0
- ? 0
+ ?
- :
- }
+ : }
|
diff --git a/genie-web/src/main/resources/static/scripts/components/JobDetails.js b/genie-web/src/main/resources/static/scripts/components/JobDetails.js
index 46dbfb38abf..8b4684f5b6e 100644
--- a/genie-web/src/main/resources/static/scripts/components/JobDetails.js
+++ b/genie-web/src/main/resources/static/scripts/components/JobDetails.js
@@ -17,6 +17,7 @@ export default class JobDetails extends React.Component {
command: { id: "", version: "", name: "" },
job: {
id: "",
+ tags: [],
_links: {
output: "",
request: "",
@@ -111,7 +112,7 @@ export default class JobDetails extends React.Component {
Tags: |
- {this.state.job.tags} |
+ {this.state.job.tags.join(",")} |
Status: |
@@ -212,11 +213,10 @@ export default class JobDetails extends React.Component {
- {
- (this.state.job.status === "RUNNING" ||
- this.state.job.status === "INIT") &&
- !this.state.killJobRequestSent
- ?
+ {(this.state.job.status === "RUNNING" ||
+ this.state.job.status === "INIT") &&
+ !this.state.killJobRequestSent
+ ?
|
- : null
- }
+ : null}
- {
- this.state.killJobRequestSent && !this.state.killRequestError
- ?
+ {this.state.killJobRequestSent && !this.state.killRequestError
+ ?
*Request accepted. Please refresh the page in a few seconds to see the status change.
- : null
- }
- {
- this.state.killRequestError ?
+ : null}
+ {this.state.killRequestError
+ ?
*Request failed. Please refresh the page and try again.
@@ -285,16 +282,16 @@ export default class JobDetails extends React.Component {
{this.state.killRequestError.message}.
-
: null
- }
- {
- this.state.error ?
+
+ : null}
+ {this.state.error
+ ?
Failed to load Command details:
-
: null
- }
+
+ : null}
diff --git a/genie-web/src/main/resources/static/scripts/components/JobTableRow.js b/genie-web/src/main/resources/static/scripts/components/JobTableRow.js
index 89250c566b4..b91f37dc6de 100644
--- a/genie-web/src/main/resources/static/scripts/components/JobTableRow.js
+++ b/genie-web/src/main/resources/static/scripts/components/JobTableRow.js
@@ -62,11 +62,9 @@ export default class TableRow extends React.Component {
- {
- this.state.copied
- ? Copied
- : null
- }
+ {this.state.copied
+ ? Copied
+ : null}
this.props.toggleRowDetails(this.props.row.id)}>
{this.props.row.user}
@@ -87,21 +85,17 @@ export default class TableRow extends React.Component {
onClick={() => this.props.toggleRowDetails(this.props.row.id)}
className="col-xs-1"
>
- {
- this.props.row.finished
- ? momentFormat(this.props.row.finished)
- : "NA"
- }
+ {this.props.row.finished
+ ? momentFormat(this.props.row.finished)
+ : "NA"}
|
this.props.toggleRowDetails(this.props.row.id)}
className="col-xs-1"
>
- {
- this.props.row.started
- ? momentDurationFormat(this.props.row.runtime)
- : "NA"
- }
+ {this.props.row.started
+ ? momentDurationFormat(this.props.row.runtime)
+ : "NA"}
|
);
diff --git a/genie-web/src/main/resources/static/scripts/components/SearchForm.js b/genie-web/src/main/resources/static/scripts/components/SearchForm.js
index 574e693471e..f68d7753fa1 100644
--- a/genie-web/src/main/resources/static/scripts/components/SearchForm.js
+++ b/genie-web/src/main/resources/static/scripts/components/SearchForm.js
@@ -52,7 +52,7 @@ export default class SearchForm extends React.Component {
formFields[name].value = query[name];
} else if (
formFields[name].queryMapping &&
- this.includes(formFields[name].queryMapping, query)
+ this.includes(formFields[name].queryMapping, query)
) {
const { mapper, queryMapping } = formFields[name];
const queryValues = queryMapping.map(x => query[x]);
@@ -65,7 +65,7 @@ export default class SearchForm extends React.Component {
getDefaultFormState(props) {
const formFields = {};
- for (const field of [ ...props.formFields, ...props.hiddenFormFields ]) {
+ for (const field of [...props.formFields, ...props.hiddenFormFields]) {
formFields[field.name] = Object.assign({}, field); // new copy
}
return {
@@ -119,7 +119,7 @@ export default class SearchForm extends React.Component {
handleSearch = e => {
e.preventDefault();
const query = { src: "btn" };
- for (const [ name, field ] of Object.entries(this.state.formFields)) {
+ for (const [name, field] of Object.entries(this.state.formFields)) {
if (this.hasValue(field)) {
if (name === "sortOrder") {
const { sort } = this.state.formFields;
@@ -211,8 +211,8 @@ export default class SearchForm extends React.Component {
const calendar = (
}
/>
@@ -233,10 +233,8 @@ export default class SearchForm extends React.Component {
@@ -291,13 +289,13 @@ export default class SearchForm extends React.Component {
))}
- {
- this.state.hasHiddenFormFields ?
+ {this.state.hasHiddenFormFields
+ ?
: null
- }
+
+ : null}
- {
- props.infos ? props.infos.map((info, index) => (
+ {props.infos
+ ? props.infos.map((info, index) => (
-
{info.name}
- )) : null
- }
+ ))
+ : null}
diff --git a/genie-web/src/main/resources/static/scripts/components/TableRow.js b/genie-web/src/main/resources/static/scripts/components/TableRow.js
index 6e176a53a71..b73b689e3f6 100644
--- a/genie-web/src/main/resources/static/scripts/components/TableRow.js
+++ b/genie-web/src/main/resources/static/scripts/components/TableRow.js
@@ -55,11 +55,9 @@ export default class TableRow extends React.Component {
- {
- this.state.copied
- ? Copied
- : null
- }
+ {this.state.copied
+ ? Copied
+ : null}
this.props.toggleRowDetails(this.props.row.id)}>
{this.props.row.user}
diff --git a/genie-web/src/main/resources/static/scripts/utils.js b/genie-web/src/main/resources/static/scripts/utils.js
index e4d92cc8435..ec46df1308b 100644
--- a/genie-web/src/main/resources/static/scripts/utils.js
+++ b/genie-web/src/main/resources/static/scripts/utils.js
@@ -7,12 +7,12 @@ import moment from "moment";
$.ajaxSettings.traditional = true;
export const genieJobsUrl = url => {
- const [ ignored, path ] = url.split("/api/v3/jobs", 2);
+ const [ignored, path] = url.split("/api/v3/jobs", 2);
return `/output${path}`;
};
export const fileUrl = url => {
- const [ ignored, path ] = url.split("/api/v3/jobs", 2);
+ const [ignored, path] = url.split("/api/v3/jobs", 2);
return `/file${path}`;
};
@@ -28,8 +28,8 @@ export const hasChanged = (o1, o2) => {
let changed = false;
for (const key of Object.keys(o1)) {
if (
- key === "src" && o1[key] === "btn" ||
- key !== "showDetails" && (!o2 || o1[key] !== o2[key])
+ (key === "src" && o1[key] === "btn") ||
+ (key !== "showDetails" && (!o2 || o1[key] !== o2[key]))
) {
changed = true;
break;
@@ -59,4 +59,4 @@ export const momentFormat = (dateStr, format = "MM/DD/YYYY, H:mm:ss") =>
// https://github.com/moment/moment/issues/1048
export const momentDurationFormat = (durationStr, format = ":mm:ss") =>
Math.floor(moment.duration(durationStr).asHours()) +
- moment.utc(moment.duration(durationStr).asMilliseconds()).format(format);
+ moment.utc(moment.duration(durationStr).asMilliseconds()).format(format);
|