Skip to content

Commit

Permalink
refactor(src-files): refactor to comply with object-shorthand eslint …
Browse files Browse the repository at this point in the history
…rule
  • Loading branch information
FlorentinTh committed Feb 2, 2022
1 parent 3b82099 commit f1798f0
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/components/admin/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Admin extends Controller {
const itemList = this.buildItemList(user);

const options = {
context: context,
context,
items: itemList,
theme: true,
logoURL: URLHelper.toAnchor(URLHelper.toSlug(itemList[0].name))
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/administration/app-keys/AppKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ class AppKeys extends Component {
const total = allAppKeys === undefined ? 0 : allAppKeys.total;
this.context.innerHTML = appKeysTemplate({
title: this.title,
total: total
total
});

const filters = this.context.querySelectorAll('.filters span.filter');

appKeysFilters = new Filters(filters, FilterType.APP_KEYS);

if (loading) {
this.buildAppKeysList('#app-keys', { defaultSort: false, loading: loading });
this.buildAppKeysList('#app-keys', { defaultSort: false, loading });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/administration/jobs-log/JobsLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class JobsLog extends Component {

if (loading) {
this.buildLogEntriesList('#log-entries', {
loading: loading
loading
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ class AlgoManagement extends Component {
const total = allAlgorithms === undefined ? 0 : allAlgorithms.total;
this.context.innerHTML = algoManagementTemplate({
title: this.title,
total: total
total
});

const filters = this.context.querySelectorAll('.filters span.filter');
algoFilters = new Filters(filters, FilterType.DEFAULT);

if (loading) {
this.buildAlgoList('#algorithms', { defaultSort: false, loading: loading });
this.buildAlgoList('#algorithms', { defaultSort: false, loading });
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ class AlgoManagement extends Component {
if (opts.loading) {
algorithms = [];
container.innerHTML = algoListTemplate({
algorithms: algorithms,
algorithms,
loading: opts.loading
});

Expand All @@ -111,7 +111,7 @@ class AlgoManagement extends Component {
}

container.innerHTML = algoListTemplate({
algorithms: algorithms,
algorithms,
loading: opts.loading
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FeatureManagement extends Component {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class FeatureContent extends Component {
initView(loading = false) {
const total = allFeatures === undefined ? 0 : allFeatures.total;
this.context.innerHTML = featureContentTemplate({
total: total
total
});

const filters = this.context.querySelectorAll('.filters span.filter');
featuresFilters = new Filters(filters, FilterType.DEFAULT);

if (loading) {
this.buildFeatureList('#features', { defaultSort: false, loading: loading });
this.buildFeatureList('#features', { defaultSort: false, loading });
}
}

Expand Down Expand Up @@ -87,7 +87,7 @@ class FeatureContent extends Component {
if (opts.loading) {
features = [];
container.innerHTML = featureListTemplate({
features: features,
features,
loading: opts.loading
});

Expand All @@ -107,7 +107,7 @@ class FeatureContent extends Component {
}

container.innerHTML = featureListTemplate({
features: features,
features,
loading: opts.loading
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class WindowingManagement extends Component {
const total = allWindowFunctions === undefined ? 0 : allWindowFunctions.total;
this.context.innerHTML = windowingManagementTemplate({
title: this.title,
total: total
total
});

const filters = this.context.querySelectorAll('.filters span.filter');
windowFuncFilters = new Filters(filters, FilterType.DEFAULT);

if (loading) {
this.buildFuncList('#functions', { defaultSort: false, loading: loading });
this.buildFuncList('#functions', { defaultSort: false, loading });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class SourceManagement extends Component {
const total = allSources === undefined ? 0 : allSources.total;
this.context.innerHTML = sourceManagementTemplate({
title: this.title,
total: total
total
});

if (loading) {
this.buildSourceList('#sources', { loading: loading });
this.buildSourceList('#sources', { loading });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UserManagement extends Component {
if (opts.loading) {
users = [];
container.innerHTML = userListTemplate({
users: users,
users,
loading: opts.loading
});

Expand Down Expand Up @@ -78,7 +78,7 @@ class UserManagement extends Component {
}

container.innerHTML = userListTemplate({
users: users,
users,
loading: opts.loading
});

Expand Down Expand Up @@ -157,8 +157,8 @@ class UserManagement extends Component {
normalFilters = new Filters(normalFiltersElems, FilterType.USERS);

if (loading) {
this.buildUserList('#users-admin', { defaultSort: false, loading: loading });
this.buildUserList('#users-normal', { defaultSort: false, loading: loading });
this.buildUserList('#users-admin', { defaultSort: false, loading });
this.buildUserList('#users-normal', { defaultSort: false, loading });
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/admin/data/data-import/DataImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DataImport extends Component {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down Expand Up @@ -270,8 +270,8 @@ class DataImport extends Component {
}

Store.update('file-upload', {
filename: filename,
size: size,
filename,
size,
progress: progressValue
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class FileContent extends Component {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down Expand Up @@ -170,8 +170,8 @@ class FileContent extends Component {
const files = id.includes('raw') ? rawFiles : featuresFiles;
const optGroup = this.context.querySelector(id);
optGroup.innerHTML = fileListTemplate({
files: files,
loading: loading
files,
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AttributeContent extends Component {
render(loading = true) {
const total = this.attributes === undefined ? 0 : this.attributes.length;
this.context.innerHTML = attributeContentTemplate({
total: total
total
});

this.buildAttributeList(loading);
Expand Down Expand Up @@ -153,8 +153,9 @@ class AttributeContent extends Component {
button.addEventListener('click', event => {
event.preventDefault();
event.stopImmediatePropagation();

const content = editFileTemplate({
attribute: attribute
attribute
});
const elems = ['attribute-name'];
ModalHelper.edit('Edit Attribute', content, 'Update', elems)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DataVisualisation extends Component {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down Expand Up @@ -160,8 +160,8 @@ class DataVisualisation extends Component {

const optGroup = this.context.querySelector(id);
optGroup.innerHTML = fileListTemplate({
files: files,
loading: loading
files,
loading
});

const selectFile = this.context.querySelector('select#file');
Expand Down Expand Up @@ -224,8 +224,8 @@ class DataVisualisation extends Component {
const attributeSelect = this.context.querySelector('select#attribute');

attributeSelect.innerHTML = attributeListTemplate({
attributes: attributes,
loading: loading
attributes,
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FileManagement extends Component {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class FileContent extends Component {
fileFilters = new Filters(filters, FilterType.FILES);

if (loading) {
this.buildFileList(this.fileType, { defaultSort: false, loading: loading });
this.buildFileList(this.fileType, { defaultSort: false, loading });
}
}

Expand All @@ -116,7 +116,7 @@ class FileContent extends Component {
if (opts.loading) {
files = [];
container.innerHTML = fileListTemplate({
files: files,
files,
loading: opts.loading
});

Expand All @@ -139,7 +139,7 @@ class FileContent extends Component {
files = fileFilters.setDefaultSort(files);
}
container.innerHTML = fileListTemplate({
files: files,
files,
fileType: value,
loading: opts.loading
});
Expand Down Expand Up @@ -375,7 +375,7 @@ class FileContent extends Component {
.then(result => {
if (result.value) {
const data = {
filename: filename,
filename,
fileType: this.fileType
};
deleteFile(`/files?source=${this.dataSource}`, data, this.context)
Expand Down Expand Up @@ -452,7 +452,7 @@ async function deleteFile(url, data, context) {
try {
const response = await axios.delete(url, {
headers: APIHelper.setAuthHeader(),
data: data
data
});
return response.data;
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ class Features extends Task {
const container = this.context.querySelector(id + ' > .list-container');

container.innerHTML = featureListTemplate({
features: features,
loading: loading
features,
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Learning extends Task {
const select = this.context.querySelector(id);
select.innerHTML += containerListTemplate({
containers: allContainers,
loading: loading
loading
});
}

Expand Down Expand Up @@ -127,7 +127,7 @@ class Learning extends Task {

const optGroup = this.context.querySelector(id);
optGroup.innerHTML = algoListTemplate({
algos: algos
algos
});
}

Expand Down Expand Up @@ -232,7 +232,7 @@ class Learning extends Task {
container.classList.add('no-conf');
}
container.innerHTML = paramsTemplate({
config: config,
config,
algo: selectedAlgo,
loading: false
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SelectProcess extends Task {
const select = this.context.querySelector(id);
select.innerHTML += sourceListTemplate({
sources: allSources,
loading: loading
loading
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Windowing extends Task {
const select = this.context.querySelector(id);
select.innerHTML += funcListTemplate({
functions: windowFunctions,
loading: loading
loading
});
}

Expand Down
Loading

0 comments on commit f1798f0

Please sign in to comment.