1
0
Fork 0

Lint code.

This commit is contained in:
Kitteh 2021-05-08 03:40:44 +01:00
parent 8a33dfd36f
commit 40387b5a48
3 changed files with 7 additions and 7 deletions

View file

@ -44,7 +44,7 @@ interface ElementInfo {
[propName: string]: any; [propName: string]: any;
} }
export function makeElement(elementInfo: ElementInfo) { export function makeElement(elementInfo: ElementInfo): HTMLElement {
if ("condition" in elementInfo) { if (!elementInfo.condition) { return null; } } if ("condition" in elementInfo) { if (!elementInfo.condition) { return null; } }
const element = document.createElement(elementInfo.tag); const element = document.createElement(elementInfo.tag);
@ -57,7 +57,7 @@ export function makeElement(elementInfo: ElementInfo) {
return element; return element;
} }
export function setElementAttributes(element: Element, attributes: {[propName: string]: any}) { export function setElementAttributes(element: Element, attributes: {[propName: string]: any}): void {
for (const key of Object.getOwnPropertyNames(attributes)) { for (const key of Object.getOwnPropertyNames(attributes)) {
element.setAttribute(key, attributes[key]); element.setAttribute(key, attributes[key]);
} }

View file

@ -24,7 +24,7 @@ export class KeyValueViewPage extends Page {
setTitleElement(pageState); setTitleElement(pageState);
let kvViewPageContent = makeElement({ tag: "div" }); const kvViewPageContent = makeElement({ tag: "div" });
setPageContent(kvViewPageContent); setPageContent(kvViewPageContent);
if (pageState.currentMountType == "cubbyhole") { if (pageState.currentMountType == "cubbyhole") {
@ -34,7 +34,7 @@ export class KeyValueViewPage extends Page {
})); }));
} }
let newButton = makeElement({ const newButton = makeElement({
tag: "button", tag: "button",
text: i18next.t("kv_view_new_btn"), text: i18next.t("kv_view_new_btn"),
class: ["uk-button", "uk-button-primary", "uk-margin-bottom"], class: ["uk-button", "uk-button-primary", "uk-margin-bottom"],
@ -45,7 +45,7 @@ export class KeyValueViewPage extends Page {
kvViewPageContent.appendChild(newButton); kvViewPageContent.appendChild(newButton);
try { try {
let res = await getSecrets( const res = await getSecrets(
pageState.currentBaseMount, pageState.currentBaseMount,
pageState.currentMountType, pageState.currentMountType,
pageState.currentSecretPath, pageState.currentSecretPath,

View file

@ -15,8 +15,8 @@ export class Page {
} }
goBack(): void { goBack(): void {
changePage("HOME"); changePage("HOME");
}; }
cleanup(): void { cleanup(): void {
// Do Nothing // Do Nothing
}; }
} }