Skip to content

Commit

Permalink
chore(lint): run linters
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Jul 28, 2023
1 parent 209d201 commit 2a57644
Show file tree
Hide file tree
Showing 29 changed files with 97 additions and 98 deletions.
2 changes: 1 addition & 1 deletion addon/components/category-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class CategoryNavComponent extends Component {
return yield this.store.findAll("category");
} catch {
this.notification.danger(
this.intl.t("alexandria.errors.fetch-categories")
this.intl.t("alexandria.errors.fetch-categories"),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions addon/components/document-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class DocumentCardComponent extends Component {
this.args.documents
.map((doc) => doc.files.find((file) => file.variant === "original"))
.map((f) => f.id)
.join(",")
.join(","),
);

let url = this.config?.zipDownloadHost || ""; // in case we need to send the zipDownload to another URL
Expand All @@ -48,7 +48,7 @@ export default class DocumentCardComponent extends Component {
// Some alexandria applications require the document-meta as well
if (this.config.modelMetaFilters.document) {
url += `&filter[document-metainfo]=${encodeURIComponent(
JSON.stringify(this.config.modelMetaFilters.document)
JSON.stringify(this.config.modelMetaFilters.document),
)}`;
}

Expand Down
4 changes: 2 additions & 2 deletions addon/components/document-delete-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export default class DocumentDeleteButtonComponent extends Component {
this.hideDialog();

this.notification.success(
this.intl.t("alexandria.success.delete-document")
this.intl.t("alexandria.success.delete-document"),
);
} catch {
this.notification.danger(
this.intl.t("alexandria.errors.delete-document")
this.intl.t("alexandria.errors.delete-document"),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/document-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class DocumentGridComponent extends Component {
inline: "nearest",
behavior: "smooth",
}),
500
500,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions addon/components/document-upload-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class DocumentUploadButtonComponent extends Component {
this.notification.success(
this.intl.t("alexandria.success.upload-document", {
count: files.length,
})
}),
);

if (this.args.afterUpload) {
Expand All @@ -28,7 +28,7 @@ export default class DocumentUploadButtonComponent extends Component {
this.notification.danger(
this.intl.t("alexandria.errors.upload-document", {
count: files.length,
})
}),
);
}
}
Expand All @@ -39,7 +39,7 @@ export default class DocumentUploadButtonComponent extends Component {
this.store.findAll("category");
} catch {
this.notification.danger(
this.intl.t("alexandria.errors.fetch-categories")
this.intl.t("alexandria.errors.fetch-categories"),
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions addon/components/document-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class DocumentViewComponent extends Component {
let docIds = [];
if (this.router.externalRouter.currentRoute?.queryParams?.document) {
docIds = decodeURIComponent(
this.router.externalRouter.currentRoute.queryParams.document
this.router.externalRouter.currentRoute.queryParams.document,
).split(",");
}
if (docIds.length !== 0) {
Expand Down Expand Up @@ -107,15 +107,15 @@ export default class DocumentViewComponent extends Component {
this.notification.success(
this.intl.t("alexandria.success.upload-document", {
count: files.length,
})
}),
);

await this.fetchDocuments.perform();
} catch {
this.notification.danger(
this.intl.t("alexandria.errors.upload-document", {
count: files.length,
})
}),
);
}

Expand Down Expand Up @@ -159,7 +159,7 @@ export default class DocumentViewComponent extends Component {
if (event.shiftKey) {
const selectedDocIndex = this.fetchedDocuments.indexOf(selectedDocument);
const firstSelectedDocIndex = this.fetchedDocuments.indexOf(
this.documents.selectedDocuments[0]
this.documents.selectedDocuments[0],
);

let startIndex;
Expand Down
2 changes: 1 addition & 1 deletion addon/components/single-document-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class SingleDocumentDetailsComponent extends DocumentCard {
yield this.documents.replace(this.args.document, file);
} catch {
this.notification.danger(
this.intl.t("alexandria.errors.replace-document")
this.intl.t("alexandria.errors.replace-document"),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/tag-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class TagFilterComponent extends Component {

if (this.selectedTagsArray.includes(tag.id)) {
const remaining = this.selectedTagsArray.filter(
(tagId) => tag.id !== tagId
(tagId) => tag.id !== tagId,
);
tags = remaining.length > 0 ? remaining : null;
} else {
Expand Down
4 changes: 2 additions & 2 deletions addon/components/tag-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class TagManagerComponent extends Component {
} else {
const searchValue = this.tagValue.toLowerCase();
this.matchingTags = this.tagService.allTags.filter((tag) =>
tag.name.toLowerCase().includes(searchValue)
tag.name.toLowerCase().includes(searchValue),
);
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class TagManagerComponent extends Component {
if (tags && tags.length !== 0) {
tags.forEach((tag) => {
const existingTag = tagsToDisplay.find(
(t) => t.emberModel.id === tag.id
(t) => t.emberModel.id === tag.id,
);
if (existingTag) {
existingTag.nrOfDocs += 1;
Expand Down
2 changes: 1 addition & 1 deletion addon/models/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class DocumentModel extends LocalizedModel {

get thumbnail() {
const thumbnail = this.files.filter(
(file) => file.variant === "thumbnail"
(file) => file.variant === "thumbnail",
)[0];
return thumbnail && thumbnail.downloadUrl;
}
Expand Down
2 changes: 1 addition & 1 deletion addon/modifiers/set-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export default modifier(
element.style[key] = htmlSafe(value);
});
},
{ eager: false }
{ eager: false },
);
4 changes: 2 additions & 2 deletions addon/services/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class DocumentsService extends Service {
}

return documentModel;
})
}),
);
}

Expand Down Expand Up @@ -147,7 +147,7 @@ export default class DocumentsService extends Service {
*/
@action deselectDocument(doc) {
this.selectedDocuments = this.selectedDocuments.filter(
(d) => d.id !== doc.id
(d) => d.id !== doc.id,
);
this.updateRoute();
}
Expand Down
2 changes: 1 addition & 1 deletion addon/services/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class TagsService extends Service {
filter: {
withDocumentsInCategory: this.category,
withDocumentsMetainfo: JSON.stringify(
this.config.modelMetaFilters.document
this.config.modelMetaFilters.document,
),
},
});
Expand Down
4 changes: 3 additions & 1 deletion app/styles/components/_document-card.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.document-card {
width: 200px;
transition: box-shadow $animation-duration, color $animation-duration,
transition:
box-shadow $animation-duration,
color $animation-duration,
border $animation-duration;

&:hover {
Expand Down
4 changes: 3 additions & 1 deletion app/styles/components/category-nav/_category.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
}

.uk-nav .category-nav--category > div {
transition: background $animation-duration, box-shadow $animation-duration,
transition:
background $animation-duration,
box-shadow $animation-duration,
color $animation-duration;
padding: 10px 0 10px 50px;
cursor: pointer;
Expand Down
Loading

0 comments on commit 2a57644

Please sign in to comment.