Skip to content

Commit

Permalink
Bump Prettier to 2.2.0 for the Katib UI (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvelich authored Dec 9, 2020
1 parent 96b81e8 commit 24ef0be
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
language: node_js
node_js: "12.18.1"
install:
- npm install --global prettier@1.19.1
- npm install --global prettier@2.2.0
script:
- make prettier-check
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TrialConfigMap extends React.Component {
}

onTemplateConfigMapNamespaceChange = event => {
let nsIndex = this.props.trialTemplatesData.findIndex(function(trialTemplate, i) {
let nsIndex = this.props.trialTemplatesData.findIndex(function (trialTemplate, i) {
return trialTemplate.ConfigMapNamespace === event.target.value;
});

Expand All @@ -61,7 +61,7 @@ class TrialConfigMap extends React.Component {

onTemplateConfigMapNameChange = event => {
let namespacedData = this.props.trialTemplatesData[this.props.configMapNamespaceIndex];
let nameIndex = namespacedData.ConfigMaps.findIndex(function(configMap, i) {
let nameIndex = namespacedData.ConfigMaps.findIndex(function (configMap, i) {
return configMap.ConfigMapName === event.target.value;
});

Expand All @@ -76,7 +76,7 @@ class TrialConfigMap extends React.Component {
let namespacedData = this.props.trialTemplatesData[this.props.configMapNamespaceIndex];
let namedConfigMap = namespacedData.ConfigMaps[this.props.configMapNameIndex];

let pathIndex = namedConfigMap.Templates.findIndex(function(template, i) {
let pathIndex = namedConfigMap.Templates.findIndex(function (template, i) {
return template.Path === event.target.value;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const HPParameters = props => {
}

// Remove empty items from PrimaryPodLabels array.
let filteredPrimaryLabels = props.primaryPodLabels.filter(function(label) {
let filteredPrimaryLabels = props.primaryPodLabels.filter(function (label) {
return label.key.trim() !== '' && label.value.trim() !== '';
});

Expand Down
4 changes: 2 additions & 2 deletions pkg/ui/v1beta1/frontend/src/components/KubeflowDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ function onGlobalNamespaceChange(namespace) {

class KubeflowDashboard extends React.Component {
componentDidMount() {
window.addEventListener('DOMContentLoaded', function(event) {
window.addEventListener('DOMContentLoaded', function (event) {
if (window.centraldashboard && window.centraldashboard.CentralDashboardEventHandler) {
// Init method will invoke the callback with the event handler instance
// and a boolean indicating whether the page is iframed or not
window.centraldashboard.CentralDashboardEventHandler.init(function(cdeh) {
window.centraldashboard.CentralDashboardEventHandler.init(function (cdeh) {
// Binds a callback that gets invoked anytime the Dashboard's
// namespace is changed
cdeh.onNamespaceSelected = namespace => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const NASParameters = props => {
}

// Remove empty items from PrimaryPodLabels array.
let filteredPrimaryLabels = props.primaryPodLabels.filter(function(label) {
let filteredPrimaryLabels = props.primaryPodLabels.filter(function (label) {
return label.key.trim() !== '' && label.value.trim() !== '';
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AddDialog extends React.Component {
let newConfigMapNamespace = event.target.value;
let newConfigMapName = '';

let namespaceIndex = templateData.findIndex(function(trialTemplate, i) {
let namespaceIndex = templateData.findIndex(function (trialTemplate, i) {
return trialTemplate.ConfigMapNamespace === newConfigMapNamespace;
});

Expand Down Expand Up @@ -292,13 +292,13 @@ class AddDialog extends React.Component {
const mapStateToProps = state => {
let templatesData = state[TEMPLATE_MODULE].trialTemplatesData;

let nsIndex = templatesData.findIndex(function(trialTemplate, i) {
let nsIndex = templatesData.findIndex(function (trialTemplate, i) {
return trialTemplate.ConfigMapNamespace === state[TEMPLATE_MODULE].updatedConfigMapNamespace;
});

let cmIndex = -1;
if (nsIndex !== -1) {
cmIndex = templatesData[nsIndex].ConfigMaps.findIndex(function(configMap, i) {
cmIndex = templatesData[nsIndex].ConfigMaps.findIndex(function (configMap, i) {
return configMap.ConfigMapName === state[TEMPLATE_MODULE].updatedConfigMapName;
});
}
Expand Down
60 changes: 30 additions & 30 deletions pkg/ui/v1beta1/frontend/src/sagas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as nasMonitorActions from '../actions/nasMonitorActions';
import * as nasCreateActions from '../actions/nasCreateActions';
import * as generalActions from '../actions/generalActions';

export const submitYaml = function*() {
export const submitYaml = function* () {
while (true) {
const action = yield take(generalActions.SUBMIT_YAML_REQUEST);
try {
Expand Down Expand Up @@ -51,7 +51,7 @@ export const submitYaml = function*() {
}
};

const goSubmitYaml = function*(yaml) {
const goSubmitYaml = function* (yaml) {
try {
const data = {
yaml,
Expand All @@ -66,7 +66,7 @@ const goSubmitYaml = function*(yaml) {
}
};

export const deleteExperiment = function*() {
export const deleteExperiment = function* () {
while (true) {
const action = yield take(generalActions.DELETE_EXPERIMENT_REQUEST);
try {
Expand Down Expand Up @@ -101,7 +101,7 @@ export const deleteExperiment = function*() {
}
};

const goDeleteExperiment = function*(name, namespace) {
const goDeleteExperiment = function* (name, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -115,7 +115,7 @@ const goDeleteExperiment = function*(name, namespace) {
}
};

export const submitHPJob = function*() {
export const submitHPJob = function* () {
while (true) {
const action = yield take(hpCreateActions.SUBMIT_HP_JOB_REQUEST);
try {
Expand All @@ -138,7 +138,7 @@ export const submitHPJob = function*() {
}
};

const goSubmitHPJob = function*(postData) {
const goSubmitHPJob = function* (postData) {
try {
const data = {
postData,
Expand All @@ -153,7 +153,7 @@ const goSubmitHPJob = function*(postData) {
}
};

export const fetchExperiments = function*() {
export const fetchExperiments = function* () {
while (true) {
yield take(generalActions.FETCH_EXPERIMENTS_REQUEST);
try {
Expand Down Expand Up @@ -184,7 +184,7 @@ export const fetchExperiments = function*() {
}
};

const goFetchExperiments = function*() {
const goFetchExperiments = function* () {
try {
const result = yield call(axios.get, '/katib/fetch_experiments/');
return result;
Expand All @@ -195,7 +195,7 @@ const goFetchExperiments = function*() {
}
};

export const fetchExperiment = function*() {
export const fetchExperiment = function* () {
while (true) {
const action = yield take(generalActions.FETCH_EXPERIMENT_REQUEST);
try {
Expand All @@ -218,7 +218,7 @@ export const fetchExperiment = function*() {
}
};

const goFetchExperiment = function*(name, namespace) {
const goFetchExperiment = function* (name, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -232,7 +232,7 @@ const goFetchExperiment = function*(name, namespace) {
}
};

export const fetchSuggestion = function*() {
export const fetchSuggestion = function* () {
while (true) {
const action = yield take(generalActions.FETCH_SUGGESTION_REQUEST);
try {
Expand All @@ -255,7 +255,7 @@ export const fetchSuggestion = function*() {
}
};

const goFetchSuggestion = function*(name, namespace) {
const goFetchSuggestion = function* (name, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -269,7 +269,7 @@ const goFetchSuggestion = function*(name, namespace) {
}
};

export const fetchHPJobInfo = function*() {
export const fetchHPJobInfo = function* () {
while (true) {
const action = yield take(hpMonitorActions.FETCH_HP_JOB_INFO_REQUEST);
try {
Expand All @@ -293,7 +293,7 @@ export const fetchHPJobInfo = function*() {
}
};

const goFetchHPJobInfo = function*(name, namespace) {
const goFetchHPJobInfo = function* (name, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -307,7 +307,7 @@ const goFetchHPJobInfo = function*(name, namespace) {
}
};

export const fetchHPJobTrialInfo = function*() {
export const fetchHPJobTrialInfo = function* () {
while (true) {
const action = yield take(hpMonitorActions.FETCH_HP_JOB_TRIAL_INFO_REQUEST);
try {
Expand All @@ -332,7 +332,7 @@ export const fetchHPJobTrialInfo = function*() {
}
};

const gofetchHPJobTrialInfo = function*(trialName, namespace) {
const gofetchHPJobTrialInfo = function* (trialName, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -346,7 +346,7 @@ const gofetchHPJobTrialInfo = function*(trialName, namespace) {
}
};

export const submitNASJob = function*() {
export const submitNASJob = function* () {
while (true) {
const action = yield take(nasCreateActions.SUBMIT_NAS_JOB_REQUEST);
try {
Expand All @@ -369,7 +369,7 @@ export const submitNASJob = function*() {
}
};

const goSubmitNASJob = function*(postData) {
const goSubmitNASJob = function* (postData) {
try {
const data = {
postData,
Expand All @@ -384,7 +384,7 @@ const goSubmitNASJob = function*(postData) {
}
};

export const fetchNASJobInfo = function*() {
export const fetchNASJobInfo = function* () {
while (true) {
const action = yield take(nasMonitorActions.FETCH_NAS_JOB_INFO_REQUEST);
try {
Expand Down Expand Up @@ -415,7 +415,7 @@ export const fetchNASJobInfo = function*() {
}
};

const goFetchNASJobInfo = function*(experimentName, namespace) {
const goFetchNASJobInfo = function* (experimentName, namespace) {
try {
const result = yield call(
axios.get,
Expand All @@ -429,7 +429,7 @@ const goFetchNASJobInfo = function*(experimentName, namespace) {
}
};

export const fetchTrialTemplates = function*() {
export const fetchTrialTemplates = function* () {
while (true) {
yield take(templateActions.FETCH_TRIAL_TEMPLATES_REQUEST);
try {
Expand All @@ -452,7 +452,7 @@ export const fetchTrialTemplates = function*() {
}
};

const goFetchTrialTemplates = function*(namespace) {
const goFetchTrialTemplates = function* (namespace) {
try {
const result = yield call(axios.get, `/katib/fetch_trial_templates`);
return result;
Expand All @@ -463,7 +463,7 @@ const goFetchTrialTemplates = function*(namespace) {
}
};

export const addTemplate = function*() {
export const addTemplate = function* () {
while (true) {
const action = yield take(templateActions.ADD_TEMPLATE_REQUEST);
try {
Expand Down Expand Up @@ -493,7 +493,7 @@ export const addTemplate = function*() {
}
};

const goAddTemplate = function*(
const goAddTemplate = function* (
updatedConfigMapNamespace,
updatedConfigMapName,
updatedConfigMapPath,
Expand All @@ -516,7 +516,7 @@ const goAddTemplate = function*(
}
};

export const editTemplate = function*() {
export const editTemplate = function* () {
while (true) {
const action = yield take(templateActions.EDIT_TEMPLATE_REQUEST);
try {
Expand Down Expand Up @@ -547,7 +547,7 @@ export const editTemplate = function*() {
}
};

const goEditTemplate = function*(
const goEditTemplate = function* (
updatedConfigMapNamespace,
updatedConfigMapName,
configMapPath,
Expand All @@ -572,7 +572,7 @@ const goEditTemplate = function*(
}
};

export const deleteTemplate = function*() {
export const deleteTemplate = function* () {
while (true) {
const action = yield take(templateActions.DELETE_TEMPLATE_REQUEST);
try {
Expand Down Expand Up @@ -601,7 +601,7 @@ export const deleteTemplate = function*() {
}
};

const goDeleteTemplate = function*(
const goDeleteTemplate = function* (
updatedConfigMapNamespace,
updatedConfigMapName,
updatedConfigMapPath,
Expand All @@ -622,7 +622,7 @@ const goDeleteTemplate = function*(
}
};

export const fetchNamespaces = function*() {
export const fetchNamespaces = function* () {
while (true) {
yield take(generalActions.FETCH_NAMESPACES_REQUEST);
try {
Expand All @@ -647,7 +647,7 @@ export const fetchNamespaces = function*() {
}
};

const goFetchNamespaces = function*() {
const goFetchNamespaces = function* () {
try {
const result = yield call(axios.get, '/katib/fetch_namespaces');
return result;
Expand Down

0 comments on commit 24ef0be

Please sign in to comment.