Skip to content

Commit f259ca0

Browse files
committed
chore(app): code linting
1 parent 4c004e8 commit f259ca0

2 files changed

Lines changed: 13 additions & 19 deletions

File tree

src/components/main/dashboard/dashboard.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import './dashboard.scss';
22
import template from './dashboard.html';
33

4-
const DashboardComponent = {
5-
controller: controller,
6-
template: template
7-
};
4+
const DashboardComponent = { controller, template };
85

96
function controller($state, localStorageService) {
10-
let vm = this;
7+
const vm = this;
118
vm.languages = localStorageService.get('languages') || ['en', 'de'];
129
vm.saveLanguages = saveLanguages;
1310

src/components/main/monument/monument.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ import './monument.scss';
44
import template from './monument.html';
55
import '../../../images/marker.png';
66

7-
const MonumentComponent = {
8-
controller: controller,
9-
template: template
10-
};
7+
const MonumentComponent = { controller, template };
118

129
function controller($http, $q, $sce, $stateParams, $timeout, $window, localStorageService, WikiService, wikidata) {
13-
let vm = this;
14-
const id = $stateParams.id[0] === 'Q' ? $stateParams.id : 'Q' + $stateParams.id;
10+
const vm = this;
11+
const id = $stateParams.id[0] === 'Q' ? $stateParams.id : `Q${$stateParams.id}`;
1512

1613
vm.getCommonsLink = getCommonsLink;
1714
vm.image = [];
@@ -27,19 +24,19 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
2724
// functions
2825

2926
function getCategoryMembers(category) {
30-
WikiService.getCategoryMembers(category).then(data => {
27+
WikiService.getCategoryMembers(category).then((data) => {
3128
const promises = data.map(image => WikiService.getImage(image, { iiurlheight: 75 }));
32-
$q.all(promises).then(data => {
29+
$q.all(promises).then((data) => {
3330
vm.images = data.map(image => image.imageinfo);
3431
});
3532
});
3633
}
3734

3835
function getArticleHeader(name) {
39-
WikiService.getArticleHeader(vm.lang, name).then(data => {
36+
WikiService.getArticleHeader(vm.lang, name).then((data) => {
4037
vm.article = $sce.trustAsHtml(data);
4138
$timeout(() => {
42-
let height = document.querySelector('.article__text').offsetHeight;
39+
const height = document.querySelector('.article__text').offsetHeight;
4340
vm.isArticleLong = height === 320;
4441
});
4542
});
@@ -64,7 +61,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
6461

6562
function getInterwiki() {
6663
vm.shownInterwiki = ['de', 'en', 'es', 'fr', 'it', 'ja', 'pl', 'pt', 'ru', 'zh'];
67-
vm.monument.interwiki = _.mapValues(vm.monument.interwiki, (wiki) => ({
64+
vm.monument.interwiki = _.mapValues(vm.monument.interwiki, wiki => ({
6865
code: wiki.site.replace('wiki', ''),
6966
title: wiki.title,
7067
link: 'https://' + wiki.site.replace('wiki', '') + '.wikipedia.org/wiki/' + wiki.title
@@ -73,7 +70,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
7370

7471
function getWikidata() {
7572
vm.loading = true;
76-
wikidata.getById(id).then(data => {
73+
wikidata.getById(id).then((data) => {
7774
const first = Object.keys(data)[0];
7875
vm.monument = data[first];
7976
const claims = vm.monument.claims;
@@ -87,8 +84,8 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
8784
if (vm.monument.claims.P131) {
8885
getFullLocation(claims.P131.values[0].value_id);
8986
}
90-
if (vm.monument.interwiki[vm.lang + 'wiki']) {
91-
getArticleHeader(vm.monument.interwiki[vm.lang + 'wiki'].title);
87+
if (vm.monument.interwiki[`${vm.lang}wiki`]) {
88+
getArticleHeader(vm.monument.interwiki[`${vm.lang}wiki`].title);
9289
}
9390
if (vm.monument.claims.P625) {
9491
const value = vm.monument.claims.P625.values[0].value;

0 commit comments

Comments
 (0)