diff --git a/.eslintrc.js b/.eslintrc.js index bba224ef07..5b09e9579c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,42 +1,43 @@ module.exports = { root: true, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint", "import", "simple-import-sort"], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint', 'import', 'simple-import-sort', 'prettier'], extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', ], parserOptions: { ecmaVersion: 2020, - sourceType: "module", + sourceType: 'module', }, rules: { - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-define": "off", - "import/no-unresolved": "off", - camelcase: "warn", - "simple-import-sort/sort": "warn", - "sort-imports": "off", - "import/first": "warn", - "import/newline-after-import": "warn", - "import/no-duplicates": "warn", - "import/no-absolute-path": "warn", - "import/no-unused-modules": "warn", - "import/no-deprecated": "warn", - "import/no-self-import": "error", - "max-len": ["warn", { code: 170, tabWidth: 2, ignoreUrls: true }], + '@typescript-eslint/no-parameter-properties': 'off', + '@typescript-eslint/no-use-before-define': 'off', + 'import/no-unresolved': 'off', + camelcase: 'warn', + 'simple-import-sort/sort': 'warn', + 'sort-imports': 'off', + 'import/first': 'warn', + 'import/newline-after-import': 'warn', + 'import/no-duplicates': 'warn', + 'import/no-absolute-path': 'warn', + 'import/no-unused-modules': 'warn', + 'import/no-deprecated': 'warn', + 'import/no-self-import': 'error', + 'max-len': ['warn', { code: 170, tabWidth: 2, ignoreUrls: true }], + 'prettier/prettier': 'warn', }, overrides: [ { - files: "**/*.ts", + files: '**/*.ts', rules: { - "import/order": [ - "off", + 'import/order': [ + 'off', { - "newlines-between": "always", + 'newlines-between': 'always', }, ], }, diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..8e735d4169 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "tabWidth": 2, + "useTabs": false, + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "jsxBracketSameLine": true, + "printWidth": 120, + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "htmlWhitespaceSensitivity": "ignore" +} diff --git a/browserslist b/browserslist deleted file mode 100644 index 80848532e4..0000000000 --- a/browserslist +++ /dev/null @@ -1,12 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -> 0.5% -last 2 versions -Firefox ESR -not dead -not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/docs/js/main.js b/docs/js/main.js index 738bb41710..4c6ca0e683 100644 --- a/docs/js/main.js +++ b/docs/js/main.js @@ -115,7 +115,6 @@ AOS.init({ var scrollDown = function () { $('.mouse-icon').on('click', function (event) { - console.log("HERE") event.preventDefault(); $('html,body').animate({ @@ -131,7 +130,6 @@ AOS.init({ var gotoInstallation = function () { $('.goto-installation').on('click', function (event) { - console.log("HERE") event.preventDefault(); $('html,body').animate({ @@ -147,7 +145,6 @@ AOS.init({ var gotoFAQ = function () { $('.goto-faq').on('click', function (event) { - console.log("HERE") event.preventDefault(); $('html,body').animate({ @@ -163,7 +160,6 @@ AOS.init({ var gotoScreenshots = function () { $('.goto-screenshots').on('click', function (event) { - console.log("HERE") event.preventDefault(); $('html,body').animate({ @@ -179,7 +175,6 @@ AOS.init({ var gotoFeatures = function () { $('.goto-features').on('click', function (event) { - console.log("HERE") event.preventDefault(); $('html,body').animate({ diff --git a/main.js b/main.js index c1831379fc..cee8ce0bc9 100644 --- a/main.js +++ b/main.js @@ -1,35 +1,35 @@ /* eslint-disable no-undef */ /* eslint-disable @typescript-eslint/no-var-requires */ -const { app, BrowserWindow, ipcMain } = require("electron"); -const electronStore = require("electron-store"); -const fs = require("fs"); +const { app, BrowserWindow, ipcMain } = require('electron'); +const electronStore = require('electron-store'); +const fs = require('fs'); const got = require('got'); -const path = require("path"); -const url = require("url"); +const path = require('path'); +const url = require('url'); const stream = require('stream'); -const {promisify} = require('util'); +const { promisify } = require('util'); const progress = require('progress-stream'); -const exec = require("child_process").exec; +const exec = require('child_process').exec; const store = new electronStore(); const args = process.argv.slice(1); -const big = args.some((val) => val === "--big"); -const dev = args.some((val) => val === "--serve"); +const big = args.some(val => val === '--big'); +const dev = args.some(val => val === '--serve'); -app.commandLine.appendSwitch("touch-events", "enabled"); +app.commandLine.appendSwitch('touch-events', 'enabled'); app.allowRendererProcessReuse = true; let window; function createWindow() { - config = store.get("config"); - store.onDidChange("config", (newValue) => { + config = store.get('config'); + store.onDidChange('config', newValue => { config = newValue; }); - const { screen, session } = require("electron"); + const { screen, session } = require('electron'); if (!dev) { session.defaultSession.webRequest.onHeadersReceived((details, callback) => { @@ -49,26 +49,27 @@ function createWindow() { width: dev ? (big ? 1400 : 1080) : mainScreen.size.width, height: dev ? (big ? 502 : 342) : mainScreen.size.height, frame: dev ? true : false, - backgroundColor: "#353b48", + backgroundColor: '#353b48', webPreferences: { nodeIntegration: true, + enableRemoteModule: true, }, - icon: path.join(__dirname, "src", "assets", "icon", "icon.png"), + icon: path.join(__dirname, 'src', 'assets', 'icon', 'icon.png'), }); if (dev) { - require("electron-reload")(__dirname, { + require('electron-reload')(__dirname, { electron: require(`${__dirname}/node_modules/electron`), }); - window.loadURL("http://localhost:4200"); + window.loadURL('http://localhost:4200'); window.webContents.openDevTools(); } else { window.loadURL( url.format({ - pathname: path.join(__dirname, "dist/index.html"), - protocol: "file:", + pathname: path.join(__dirname, 'dist/index.html'), + protocol: 'file:', slashes: true, - }) + }), ); window.setFullScreen(true); } @@ -78,167 +79,165 @@ function createWindow() { activateReloadListener(); activateUpdateListener(); - window.on("closed", () => { + window.on('closed', () => { window = null; }); } function activateScreenSleepListener() { - ipcMain.on("screenSleep", () => { - exec("xset dpms force standby"); + ipcMain.on('screenSleep', () => { + exec('xset dpms force standby'); }); - ipcMain.on("screenWakeup", () => { - exec("xset s off"); - exec("xset -dpms"); - exec("xset s noblank"); + ipcMain.on('screenWakeup', () => { + exec('xset s off'); + exec('xset -dpms'); + exec('xset s noblank'); }); } function activateReloadListener() { - ipcMain.on("reload", () => { + ipcMain.on('reload', () => { window.loadURL( url.format({ - pathname: path.join(__dirname, "dist/index.html"), - protocol: "file:", + pathname: path.join(__dirname, 'dist/index.html'), + protocol: 'file:', slashes: true, - }) + }), ); }); } function activateAppInfoListener() { - ipcMain.on("appInfo", () => { + ipcMain.on('appInfo', () => { sendCustomStyles(); sendVersionInfo(); }); } function activateUpdateListener() { - ipcMain.on("update", (_, updateInfo) => { + ipcMain.on('update', (_, updateInfo) => { downloadUpdate(updateInfo); }); } function sendCustomStyles() { - fs.readFile(path.join(app.getPath("userData"), "custom-styles.css"), "utf-8", (err, data) => { + fs.readFile(path.join(app.getPath('userData'), 'custom-styles.css'), 'utf-8', (err, data) => { if (err) { - if (err.code === "ENOENT") { - fs.writeFile(path.join(app.getPath("userData"), "custom-styles.css"), "", (err) => { + if (err.code === 'ENOENT') { + fs.writeFile(path.join(app.getPath('userData'), 'custom-styles.css'), '', err => { if (err) { - window.webContents.send("customStylesError", err); + window.webContents.send('customStylesError', err); } else { - window.webContents.send("customStyles", ""); + window.webContents.send('customStyles', ''); } }); } else { - window.webContents.send("customStylesError", err); + window.webContents.send('customStylesError', err); } } else { - window.webContents.send("customStyles", data); + window.webContents.send('customStyles', data); } }); } function sendVersionInfo() { - window.webContents.send("versionInformation", { + window.webContents.send('versionInformation', { version: app.getVersion(), }); } function downloadUpdate(updateInfo) { - const downloadPath = "/tmp/octodash.deb"; + const downloadPath = '/tmp/octodash.deb'; - exec("arch", (err, stdout, stderr) => { + exec('arch', (err, stdout, stderr) => { if (err || stderr) { - window.webContents.send("updateError", { + window.webContents.send('updateError', { error: err ? err : { message: stderr }, }); } got(updateInfo.assetsURL) - .then((releaseFiles) => { - const reducer = (accumulator, currentValue) => accumulator + currentValue; - let averageETA = []; - let downloadURL; - let packageSize; - for (let package of JSON.parse(releaseFiles.body)) { - if (package.name.includes(stdout.trim())) { - downloadURL = package.browser_download_url; - packageSize = package.size; - } - } - if (downloadURL) { - const downloadPipeline = promisify(stream.pipeline); - let downloadProgress = progress({ - length: packageSize, - time: 300, - }); - - downloadProgress.on('progress', (progress) => { - averageETA.push(progress.eta); - if (averageETA.length > 4) averageETA.shift(); - window.webContents.send("updateDownloadProgress", { - percentage: progress.percentage, - transferred: (progress.transferred / 100000).toFixed(1), - total: (progress.length / 1000000).toFixed(1), - remaining: (progress.remaining / 100000).toFixed(1), - eta: new Date(averageETA.reduce(reducer) * 1000).toISOString().substr(14, 5), - runtime: new Date(progress.runtime * 1000).toISOString().substr(14, 5), - delta: (progress.delta / 100000).toFixed(1), - speed: (progress.speed / 1000000).toFixed(2), - }) - }) - - try { - if (fs.existsSync(downloadPath)) fs.unlinkSync(downloadPath) - } catch { - // no need to handle this properly + .then(releaseFiles => { + const reducer = (accumulator, currentValue) => accumulator + currentValue; + let averageETA = []; + let downloadURL; + let packageSize; + for (let package of JSON.parse(releaseFiles.body)) { + if (package.name.includes(stdout.trim())) { + downloadURL = package.browser_download_url; + packageSize = package.size; + } } + if (downloadURL) { + const downloadPipeline = promisify(stream.pipeline); + let downloadProgress = progress({ + length: packageSize, + time: 300, + }); + + downloadProgress.on('progress', progress => { + averageETA.push(progress.eta); + if (averageETA.length > 4) averageETA.shift(); + window.webContents.send('updateDownloadProgress', { + percentage: progress.percentage, + transferred: (progress.transferred / 100000).toFixed(1), + total: (progress.length / 1000000).toFixed(1), + remaining: (progress.remaining / 100000).toFixed(1), + eta: new Date(averageETA.reduce(reducer) * 1000).toISOString().substr(14, 5), + runtime: new Date(progress.runtime * 1000).toISOString().substr(14, 5), + delta: (progress.delta / 100000).toFixed(1), + speed: (progress.speed / 1000000).toFixed(2), + }); + }); + + try { + if (fs.existsSync(downloadPath)) fs.unlinkSync(downloadPath); + } catch { + // no need to handle this properly + } - downloadPipeline( - got.stream(downloadURL), - downloadProgress, - fs.createWriteStream(downloadPath) - ).catch((error) => { - window.webContents.send("updateError", { - error: { - message: `Can't download package! ${error.message}.` - } - }) - }).then(() => { - window.webContents.send("updateDownloadFinished"); - exec('sudo ~/scripts/update-octodash', (err, _, stderr) => { - if (err || stderr) { - window.webContents.send("updateError", { - error: err ? err : { message: stderr }, + downloadPipeline(got.stream(downloadURL), downloadProgress, fs.createWriteStream(downloadPath)) + .catch(error => { + window.webContents.send('updateError', { + error: { + message: `Can't download package! ${error.message}.`, + }, }); - } else { - window.webContents.send("updateInstalled"); - } - }) - }) - } else { - window.webContents.send("updateError", { - error: { - message: `Can't find matching package for architecture ${stdout}.` - } - }) - } - }) - .catch((error) => { - error.message = `Can't load releases. ${error.message}`; - window.webContents.send("updateError", {error}); - }) + }) + .then(() => { + window.webContents.send('updateDownloadFinished'); + exec('sudo ~/scripts/update-octodash', (err, _, stderr) => { + if (err || stderr) { + window.webContents.send('updateError', { + error: err ? err : { message: stderr }, + }); + } else { + window.webContents.send('updateInstalled'); + } + }); + }); + } else { + window.webContents.send('updateError', { + error: { + message: `Can't find matching package for architecture ${stdout}.`, + }, + }); + } + }) + .catch(error => { + error.message = `Can't load releases. ${error.message}`; + window.webContents.send('updateError', { error }); + }); }); } -app.on("ready", createWindow); +app.on('ready', createWindow); -app.on("window-all-closed", () => { +app.on('window-all-closed', () => { app.quit(); }); -app.on("activate", () => { +app.on('activate', () => { if (window === null) { createWindow(); } diff --git a/package-lock.json b/package-lock.json index be67fbfb65..dbb4cf3896 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7154,6 +7154,15 @@ } } }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-plugin-simple-import-sort": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-5.0.3.tgz", @@ -7586,6 +7595,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", @@ -12194,6 +12209,15 @@ "integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index aedf917089..25861b275d 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "electron-reload": "^1.5.0", "eslint": "7.7.0", "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-simple-import-sort": "^5.0.3", "npm-run-all": "^4.1.5", "prettier": "^2.1.0", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index cdefd7777a..5b9b09aa0c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,9 @@ -import { Component } from "@angular/core"; -import { Router } from "@angular/router"; -import _ from "lodash"; +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import _ from 'lodash'; -import { AppService } from "./app.service"; -import { ConfigService } from "./config/config.service"; +import { AppService } from './app.service'; +import { ConfigService } from './config/config.service'; declare global { interface Window { @@ -15,12 +15,12 @@ declare global { } @Component({ - selector: "app-root", - templateUrl: "./app.component.html", - styleUrls: ["./app.component.scss"], + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], }) export class AppComponent { - public constructor(private configService: ConfigService, private service: AppService, private router: Router) { + public constructor(private service: AppService, private configService: ConfigService, private router: Router) { this.initialize(); } @@ -29,9 +29,9 @@ export class AppComponent { if (this.configService.isLoaded()) { if (this.configService.isValid()) { if (this.configService.isTouchscreen()) { - this.router.navigate(["/main-screen"]); + this.router.navigate(['/main-screen']); } else { - this.router.navigate(["/main-screen-no-touch"]); + this.router.navigate(['/main-screen-no-touch']); } } else { if (_.isEqual(this.configService.getErrors(), this.service.getUpdateError())) { @@ -39,14 +39,14 @@ export class AppComponent { this.initialize(); } else { this.configService.setUpdate(); - this.router.navigate(["/no-config"]); + this.router.navigate(['/no-config']); } } else { - this.router.navigate(["/invalid-config"]); + this.router.navigate(['/invalid-config']); } } } else { - this.router.navigate(["/no-config"]); + this.router.navigate(['/no-config']); } } else { setTimeout(this.initialize.bind(this), 1000); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cd8c126bd3..b7657a9bff 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,39 +1,39 @@ -import { HttpClientModule } from "@angular/common/http"; -import { NgModule } from "@angular/core"; -import { FormsModule } from "@angular/forms"; -import { MatRippleModule } from "@angular/material/core"; -import { BrowserModule } from "@angular/platform-browser"; -import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; -import { FaIconLibrary, FontAwesomeModule } from "@fortawesome/angular-fontawesome"; -import { fas } from "@fortawesome/free-solid-svg-icons"; -import { RoundProgressModule } from "angular-svg-round-progressbar"; -import { NgxSpinnerModule } from "ngx-spinner"; +import { HttpClientModule } from '@angular/common/http'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatRippleModule } from '@angular/material/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { fas } from '@fortawesome/free-solid-svg-icons'; +import { RoundProgressModule } from 'angular-svg-round-progressbar'; +import { NgxSpinnerModule } from 'ngx-spinner'; -import { AppComponent } from "./app.component"; -import { AppRoutingModule } from "./app.routing.module"; -import { AppService } from "./app.service"; -import { BottomBarComponent } from "./bottom-bar/bottom-bar.component"; -import { ConfigService } from "./config/config.service"; -import { InvalidConfigComponent } from "./config/invalid-config/invalid-config.component"; -import { NoConfigComponent } from "./config/no-config/no-config.component"; -import { ControlComponent } from "./control/control.component"; -import { FilamentComponent } from "./filament/filament.component"; -import { FilesComponent } from "./files/files.component"; -import { JobStatusComponent } from "./job-status/job-status.component"; -import { JobService } from "./job.service"; -import { LayerProgressComponent } from "./layer-progress/layer-progress.component"; -import { MainMenuComponent } from "./main-menu/main-menu.component"; -import { MainScreenComponent } from "./main-screen/main-screen.component"; -import { MainScreenNoTouchComponent } from "./main-screen/no-touch/main-screen-no-touch.component"; -import { NotificationComponent } from "./notification/notification.component"; -import { NotificationService } from "./notification/notification.service"; -import { PrintControlComponent } from "./print-control/print-control.component"; -import { PrinterStatusComponent } from "./printer-status/printer-status.component"; -import { PrinterService } from "./printer.service"; -import { SettingsComponent } from "./settings/settings.component"; -import { StandbyComponent } from "./standby/standby.component"; -import { UpdateComponent } from "./update/update.component"; -import { URLSafePipe } from "./url.pipe"; +import { AppComponent } from './app.component'; +import { AppRoutingModule } from './app.routing.module'; +import { AppService } from './app.service'; +import { BottomBarComponent } from './bottom-bar/bottom-bar.component'; +import { ConfigService } from './config/config.service'; +import { InvalidConfigComponent } from './config/invalid-config/invalid-config.component'; +import { NoConfigComponent } from './config/no-config/no-config.component'; +import { ControlComponent } from './control/control.component'; +import { FilamentComponent } from './filament/filament.component'; +import { FilesComponent } from './files/files.component'; +import { JobStatusComponent } from './job-status/job-status.component'; +import { JobService } from './job.service'; +import { LayerProgressComponent } from './layer-progress/layer-progress.component'; +import { MainMenuComponent } from './main-menu/main-menu.component'; +import { MainScreenComponent } from './main-screen/main-screen.component'; +import { MainScreenNoTouchComponent } from './main-screen/no-touch/main-screen-no-touch.component'; +import { NotificationComponent } from './notification/notification.component'; +import { NotificationService } from './notification/notification.service'; +import { PrintControlComponent } from './print-control/print-control.component'; +import { PrinterStatusComponent } from './printer-status/printer-status.component'; +import { PrinterService } from './printer.service'; +import { SettingsComponent } from './settings/settings.component'; +import { StandbyComponent } from './standby/standby.component'; +import { UpdateComponent } from './update/update.component'; +import { URLSafePipe } from './url.pipe'; @NgModule({ declarations: [ @@ -70,6 +70,7 @@ import { URLSafePipe } from "./url.pipe"; ], providers: [AppService, ConfigService, NotificationService, PrinterService, JobService], bootstrap: [AppComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class AppModule { public constructor(library: FaIconLibrary) { diff --git a/src/app/app.routing.module.ts b/src/app/app.routing.module.ts index 56912272de..9212a9a2ae 100644 --- a/src/app/app.routing.module.ts +++ b/src/app/app.routing.module.ts @@ -1,52 +1,52 @@ -import { CommonModule } from "@angular/common"; -import { NgModule } from "@angular/core"; -import { RouterModule, Routes } from "@angular/router"; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; -import { InvalidConfigComponent } from "./config/invalid-config/invalid-config.component"; -import { NoConfigComponent } from "./config/no-config/no-config.component"; -import { ControlComponent } from "./control/control.component"; -import { FilamentComponent } from "./filament/filament.component"; -import { FilesComponent } from "./files/files.component"; -import { MainScreenComponent } from "./main-screen/main-screen.component"; -import { MainScreenNoTouchComponent } from "./main-screen/no-touch/main-screen-no-touch.component"; -import { SettingsComponent } from "./settings/settings.component"; -import { StandbyComponent } from "./standby/standby.component"; +import { InvalidConfigComponent } from './config/invalid-config/invalid-config.component'; +import { NoConfigComponent } from './config/no-config/no-config.component'; +import { ControlComponent } from './control/control.component'; +import { FilamentComponent } from './filament/filament.component'; +import { FilesComponent } from './files/files.component'; +import { MainScreenComponent } from './main-screen/main-screen.component'; +import { MainScreenNoTouchComponent } from './main-screen/no-touch/main-screen-no-touch.component'; +import { SettingsComponent } from './settings/settings.component'; +import { StandbyComponent } from './standby/standby.component'; const routes: Routes = [ { - path: "main-screen", + path: 'main-screen', component: MainScreenComponent, }, { - path: "main-screen-no-touch", + path: 'main-screen-no-touch', component: MainScreenNoTouchComponent, }, { - path: "control", + path: 'control', component: ControlComponent, }, { - path: "filament", + path: 'filament', component: FilamentComponent, }, { - path: "files", + path: 'files', component: FilesComponent, }, { - path: "invalid-config", + path: 'invalid-config', component: InvalidConfigComponent, }, { - path: "no-config", + path: 'no-config', component: NoConfigComponent, }, { - path: "settings", + path: 'settings', component: SettingsComponent, }, { - path: "standby", + path: 'standby', component: StandbyComponent, }, ]; diff --git a/src/app/app.service.ts b/src/app/app.service.ts index 917e41f511..dfcc207929 100644 --- a/src/app/app.service.ts +++ b/src/app/app.service.ts @@ -1,11 +1,11 @@ -import { HttpClient } from "@angular/common/http"; -import { Injectable } from "@angular/core"; +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; -import { ConfigService } from "./config/config.service"; -import { NotificationService } from "./notification/notification.service"; +import { ConfigService } from './config/config.service'; +import { NotificationService } from './notification/notification.service'; @Injectable({ - providedIn: "root", + providedIn: 'root', }) export class AppService { private updateError: string[]; @@ -20,19 +20,19 @@ export class AppService { public constructor( private configService: ConfigService, private notificationService: NotificationService, - private http: HttpClient + private http: HttpClient, ) { try { - this.ipc = window.require("electron").ipcRenderer; + this.ipc = window.require('electron').ipcRenderer; this.enableVersionListener(); this.enableCustomCSSListener(); setTimeout(() => { - this.ipc.send("appInfo"); + this.ipc.send('appInfo'); }, 0); } catch (e) { this.notificationService.setError( "Can't connect to backend", - "Please restart your system. If the issue persists open an issue on GitHub." + 'Please restart your system. If the issue persists open an issue on GitHub.', ); } this.updateError = [ @@ -52,35 +52,35 @@ export class AppService { } private enableVersionListener(): void { - this.ipc.on("versionInformation", (_, versionInformation: VersionInformation): void => { + this.ipc.on('versionInformation', (_, versionInformation: VersionInformation): void => { this.version = versionInformation.version; this.checkUpdate(); }); } private enableCustomCSSListener(): void { - this.ipc.on("customStyles", (_, customCSS: string): void => { - const css = document.createElement("style"); - css.type = "text/css"; + this.ipc.on('customStyles', (_, customCSS: string): void => { + const css = document.createElement('style'); + css.type = 'text/css'; css.appendChild(document.createTextNode(customCSS)); document.head.append(css); }); - this.ipc.on("customStylesError", (_, customCSSError: string): void => { + this.ipc.on('customStylesError', (_, customCSSError: string): void => { this.notificationService.setError("Can't load custom styles!", customCSSError); }); } private checkUpdate(): void { - this.http.get("https://api.github.com/repos/UnchartedBull/OctoDash/releases/latest").subscribe( + this.http.get('https://api.github.com/repos/UnchartedBull/OctoDash/releases/latest').subscribe( (data: GitHubReleaseInformation): void => { - if (this.version !== data.name.replace("v", "")) { + if (this.version !== data.name.replace('v', '')) { this.updateAvailable = true; } - this.latestVersion = data.name.replace("v", ""); + this.latestVersion = data.name.replace('v', ''); this.latestVersionAssetsURL = data.assets_url; }, - (): void => null + (): void => null, ); setTimeout(this.checkUpdate.bind(this), 3600000); } @@ -95,13 +95,13 @@ export class AppService { public turnDisplayOff(): void { if (this.ipc) { - this.ipc.send("screenSleep", ""); + this.ipc.send('screenSleep', ''); } } public turnDisplayOn(): void { if (this.ipc) { - this.ipc.send("screenWakeup", ""); + this.ipc.send('screenWakeup', ''); } } @@ -126,9 +126,9 @@ export class AppService { } public convertDateToString(date: Date): string { - return `${("0" + date.getDate()).slice(-2)}.${("0" + (date.getMonth() + 1)).slice(-2)}.${date.getFullYear()} ${( - "0" + date.getHours() - ).slice(-2)}:${("0" + date.getMinutes()).slice(-2)}:${("0" + date.getSeconds()).slice(-2)}`; + return `${('0' + date.getDate()).slice(-2)}.${('0' + (date.getMonth() + 1)).slice(-2)}.${date.getFullYear()} ${( + '0' + date.getHours() + ).slice(-2)}:${('0' + date.getMinutes()).slice(-2)}:${('0' + date.getSeconds()).slice(-2)}`; } public convertSecondsToHours(input: number): string { @@ -140,7 +140,7 @@ export class AppService { roundedMinutes = 0; roundedHours += 1; } - return roundedHours + ":" + ("0" + roundedMinutes).slice(-2); + return roundedHours + ':' + ('0' + roundedMinutes).slice(-2); } public convertFilamentVolumeToWeight(filamentVolume: number): number { diff --git a/src/app/bottom-bar/bottom-bar.component.ts b/src/app/bottom-bar/bottom-bar.component.ts index b9fb700efd..1588e531a7 100644 --- a/src/app/bottom-bar/bottom-bar.component.ts +++ b/src/app/bottom-bar/bottom-bar.component.ts @@ -1,14 +1,14 @@ -import { Component, OnDestroy } from "@angular/core"; -import { Subscription } from "rxjs"; +import { Component, OnDestroy } from '@angular/core'; +import { Subscription } from 'rxjs'; -import { ConfigService } from "../config/config.service"; -import { EnclosureService } from "../plugin-service/enclosure.service"; -import { PrinterService, PrinterStatusAPI } from "../printer.service"; +import { ConfigService } from '../config/config.service'; +import { EnclosureService } from '../plugin-service/enclosure.service'; +import { PrinterService, PrinterStatusAPI } from '../printer.service'; @Component({ - selector: "app-bottom-bar", - templateUrl: "./bottom-bar.component.html", - styleUrls: ["./bottom-bar.component.scss"], + selector: 'app-bottom-bar', + templateUrl: './bottom-bar.component.html', + styleUrls: ['./bottom-bar.component.scss'], }) export class BottomBarComponent implements OnDestroy { private subscriptions: Subscription = new Subscription(); @@ -18,25 +18,25 @@ export class BottomBarComponent implements OnDestroy { public constructor( private printerService: PrinterService, private configService: ConfigService, - private enclosureService: EnclosureService + private enclosureService: EnclosureService, ) { if (this.configService.getAmbientTemperatureSensorName() !== null) { this.subscriptions.add( this.enclosureService.getObservable().subscribe((temperatureReading: TemperatureReading): void => { this.enclosureTemperature = temperatureReading; - }) + }), ); } else { this.enclosureTemperature = null; } this.printer = { name: this.configService.getPrinterName(), - status: "connecting ...", + status: 'connecting ...', }; this.subscriptions.add( this.printerService.getObservable().subscribe((printerStatus: PrinterStatusAPI): void => { this.printer.status = printerStatus.status; - }) + }), ); } diff --git a/src/app/config/config.service.ts b/src/app/config/config.service.ts index a43153e708..b2d971a298 100644 --- a/src/app/config/config.service.ts +++ b/src/app/config/config.service.ts @@ -1,12 +1,12 @@ -import { HttpHeaders } from "@angular/common/http"; -import { Injectable } from "@angular/core"; -import Ajv from "ajv"; -import _ from "lodash"; +import { HttpHeaders } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import Ajv from 'ajv'; +import _ from 'lodash'; -import { NotificationService } from "../notification/notification.service"; +import { NotificationService } from '../notification/notification.service'; @Injectable({ - providedIn: "root", + providedIn: 'root', }) export class ConfigService { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -24,13 +24,14 @@ export class ConfigService { const ajv = new Ajv({ allErrors: true }); this.validator = ajv.compile(schema); try { - const Store = window.require("electron-store"); + const Store = window.require('electron-store'); this.store = new Store(); - this.initialize(this.store.get("config")); + this.initialize(this.store.get('config')); } catch (e) { + console.error(e); this.notificationService.setError( "Can't read config file!", - "Please restart your system. If the issue persists open an issue on GitHub." + 'Please restart your system. If the issue persists open an issue on GitHub.', ); } } @@ -41,10 +42,10 @@ export class ConfigService { if (this.valid) { this.httpHeaders = { headers: new HttpHeaders({ - "x-api-key": this.config.octoprint.accessToken, - "Cache-Control": "no-cache", - Pragma: "no-cache", - Expires: "0", + 'x-api-key': this.config.octoprint.accessToken, + 'Cache-Control': 'no-cache', + Pragma: 'no-cache', + Expires: '0', }), }; } @@ -52,7 +53,7 @@ export class ConfigService { } public getRemoteConfig(): Config { - return this.store.get("config"); + return this.store.get('config'); } public getCurrentConfig(): Config { @@ -74,10 +75,10 @@ export class ConfigService { public getErrors(): string[] { const errors = []; this.validator.errors.forEach((error): void => { - if (error.keyword === "type") { + if (error.keyword === 'type') { errors.push(`${error.dataPath} ${error.message}`); } else { - errors.push(`${error.dataPath === "" ? "." : error.dataPath} ${error.message}`); + errors.push(`${error.dataPath === '' ? '.' : error.dataPath} ${error.message}`); } }); console.error(errors); @@ -89,29 +90,29 @@ export class ConfigService { config = this.config; } if (window && window.process && window.process.type) { - this.store.set("config", config); - const configStored = this.store.get("config"); + this.store.set('config', config); + const configStored = this.store.get('config'); if (this.validateGiven(configStored)) { return null; } else { - return "Saved config is invalid!"; + return 'Saved config is invalid!'; } } else { - return 'Browser version doesn\'t support saving!'; + return "Browser version doesn't support saving!"; } } public updateConfig(): void { if (window && window.process && window.process.type) { this.update = false; - this.initialize(this.store.get("config")); + this.initialize(this.store.get('config')); } } public revertConfigForInput(config: Config): Config { config.octoprint.urlSplit = { - url: config.octoprint.url.split(":")[1].replace("//", ""), - port: parseInt(config.octoprint.url.split(":")[2].replace("/api/", ""), 10), + url: config.octoprint.url.split(':')[1].replace('//', ''), + port: parseInt(config.octoprint.url.split(':')[2].replace('/api/', ''), 10), }; if (isNaN(config.octoprint.urlSplit.port)) { config.octoprint.urlSplit.port = null; @@ -202,11 +203,11 @@ export class ConfigService { return this.config.filament.density; } - public getDefaultSortingAttribute(): "name" | "date" | "size" { + public getDefaultSortingAttribute(): 'name' | 'date' | 'size' { return this.config.octodash.fileSorting.attribute; } - public getDefaultSortingOrder(): "asc" | "dsc" { + public getDefaultSortingOrder(): 'asc' | 'dsc' { return this.config.octodash.fileSorting.order; } @@ -340,285 +341,285 @@ interface CustomAction { } interface FileSorting { - attribute: "name" | "date" | "size"; - order: "asc" | "dsc"; + attribute: 'name' | 'date' | 'size'; + order: 'asc' | 'dsc'; } const schema = { definitions: {}, - $schema: "http://json-schema.org/draft-07/schema#", - $id: "http://example.com/root.json", - type: "object", - required: ["octoprint", "printer", "filament", "plugins", "octodash"], + $schema: 'http://json-schema.org/draft-07/schema#', + $id: 'http://example.com/root.json', + type: 'object', + required: ['octoprint', 'printer', 'filament', 'plugins', 'octodash'], properties: { octoprint: { - $id: "#/properties/octoprint", - type: "object", - required: ["accessToken", "url"], + $id: '#/properties/octoprint', + type: 'object', + required: ['accessToken', 'url'], properties: { accessToken: { - $id: "#/properties/octoprint/properties/accessToken", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/octoprint/properties/accessToken', + type: 'string', + pattern: '^(.*)$', }, url: { - $id: "#/properties/octoprint/properties/url", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/octoprint/properties/url', + type: 'string', + pattern: '^(.*)$', }, }, }, printer: { - $id: "#/properties/printer", - type: "object", - required: ["name", "xySpeed", "zSpeed", "defaultTemperatureFanSpeed"], + $id: '#/properties/printer', + type: 'object', + required: ['name', 'xySpeed', 'zSpeed', 'defaultTemperatureFanSpeed'], properties: { name: { - $id: "#/properties/printer/properties/name", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/printer/properties/name', + type: 'string', + pattern: '^(.*)$', }, xySpeed: { - $id: "#/properties/printer/properties/xySpeed", - type: "integer", + $id: '#/properties/printer/properties/xySpeed', + type: 'integer', }, zSpeed: { - $id: "#/properties/printer/properties/zSpeed", - type: "integer", + $id: '#/properties/printer/properties/zSpeed', + type: 'integer', }, defaultTemperatureFanSpeed: { - $id: "#/properties/printer/properties/defaultTemperatureFanSpeed", - type: "object", - required: ["hotend", "heatbed", "fan"], + $id: '#/properties/printer/properties/defaultTemperatureFanSpeed', + type: 'object', + required: ['hotend', 'heatbed', 'fan'], properties: { hotend: { - $id: "#/properties/printer/properties/defaultTemperatureFanSpeed/hotend", - type: "integer", + $id: '#/properties/printer/properties/defaultTemperatureFanSpeed/hotend', + type: 'integer', }, heatbed: { - $id: "#/properties/printer/properties/defaultTemperatureFanSpeed/heatbed", - type: "integer", + $id: '#/properties/printer/properties/defaultTemperatureFanSpeed/heatbed', + type: 'integer', }, fan: { - $id: "#/properties/printer/properties/defaultTemperatureFanSpeed/fan", - type: "integer", + $id: '#/properties/printer/properties/defaultTemperatureFanSpeed/fan', + type: 'integer', }, }, }, }, }, filament: { - $id: "#/properties/filament", - type: "object", - required: ["density", "thickness", "feedLength", "feedSpeed", "feedSpeedSlow", "purgeDistance", "useM600"], + $id: '#/properties/filament', + type: 'object', + required: ['density', 'thickness', 'feedLength', 'feedSpeed', 'feedSpeedSlow', 'purgeDistance', 'useM600'], properties: { density: { - $id: "#/properties/filament/properties/density", - type: "number", + $id: '#/properties/filament/properties/density', + type: 'number', }, thickness: { - $id: "#/properties/filament/properties/thickness", - type: "number", + $id: '#/properties/filament/properties/thickness', + type: 'number', }, feedLength: { - $id: "#/properties/filament/properties/feedLength", - type: "integer", + $id: '#/properties/filament/properties/feedLength', + type: 'integer', }, feedSpeed: { - $id: "#/properties/filament/properties/feedSpeed", - type: "integer", + $id: '#/properties/filament/properties/feedSpeed', + type: 'integer', }, feedSpeedSlow: { - $id: "#/properties/filament/properties/feedSpeedSlow", - type: "integer", + $id: '#/properties/filament/properties/feedSpeedSlow', + type: 'integer', }, purgeDistance: { - $id: "#/properties/filament/properties/purgeDistance", - type: "integer", + $id: '#/properties/filament/properties/purgeDistance', + type: 'integer', }, useM600: { - $id: "#/properties/filament/properties/useM600", - type: "boolean", + $id: '#/properties/filament/properties/useM600', + type: 'boolean', }, }, }, plugins: { - $id: "#/properties/plugins", - type: "object", + $id: '#/properties/plugins', + type: 'object', required: [ - "displayLayerProgress", - "enclosure", - "filamentManager", - "preheatButton", - "printTimeGenius", - "psuControl", + 'displayLayerProgress', + 'enclosure', + 'filamentManager', + 'preheatButton', + 'printTimeGenius', + 'psuControl', ], properties: { displayLayerProgress: { - $id: "#/properties/plugins/properties/displayLayerProgress", - type: "object", - required: ["enabled"], + $id: '#/properties/plugins/properties/displayLayerProgress', + type: 'object', + required: ['enabled'], properties: { enabled: { - $id: "#/properties/plugins/properties/displayLayerProgress/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/displayLayerProgress/properties/enabled', + type: 'boolean', }, }, }, enclosure: { - $id: "#/properties/plugins/properties/enclosure", - type: "object", - required: ["enabled", "ambientSensorID", "filament1SensorID", "filament2SensorID"], + $id: '#/properties/plugins/properties/enclosure', + type: 'object', + required: ['enabled', 'ambientSensorID', 'filament1SensorID', 'filament2SensorID'], properties: { enabled: { - $id: "#/properties/plugins/properties/enclosure/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/enclosure/properties/enabled', + type: 'boolean', }, ambientSensorID: { - $id: "#/properties/plugins/properties/enclosure/properties/ambientSensorID", - type: ["number", "null"], - pattern: "^(.*)$", + $id: '#/properties/plugins/properties/enclosure/properties/ambientSensorID', + type: ['number', 'null'], + pattern: '^(.*)$', }, filament1SensorID: { - $id: "#/properties/plugins/properties/enclosure/properties/filament1SensorID", - type: ["number", "null"], - pattern: "^(.*)$", + $id: '#/properties/plugins/properties/enclosure/properties/filament1SensorID', + type: ['number', 'null'], + pattern: '^(.*)$', }, filament2SensorID: { - $id: "#/properties/plugins/properties/enclosure/properties/filament2SensorID", - type: ["number", "null"], - pattern: "^(.*)$", + $id: '#/properties/plugins/properties/enclosure/properties/filament2SensorID', + type: ['number', 'null'], + pattern: '^(.*)$', }, }, }, filamentManager: { - $id: "#/properties/plugins/properties/filamentManager", - type: "object", - required: ["enabled"], + $id: '#/properties/plugins/properties/filamentManager', + type: 'object', + required: ['enabled'], properties: { enabled: { - $id: "#/properties/plugins/properties/filamentManager/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/filamentManager/properties/enabled', + type: 'boolean', }, }, }, preheatButton: { - $id: "#/properties/plugins/properties/preheatButton", - type: "object", - required: ["enabled"], + $id: '#/properties/plugins/properties/preheatButton', + type: 'object', + required: ['enabled'], properties: { enabled: { - $id: "#/properties/plugins/properties/preheatButton/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/preheatButton/properties/enabled', + type: 'boolean', }, }, }, printTimeGenius: { - $id: "#/properties/plugins/properties/printTimeGenius", - type: "object", - required: ["enabled"], + $id: '#/properties/plugins/properties/printTimeGenius', + type: 'object', + required: ['enabled'], properties: { enabled: { - $id: "#/properties/plugins/properties/printTimeGenius/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/printTimeGenius/properties/enabled', + type: 'boolean', }, }, }, psuControl: { - $id: "#/properties/plugins/properties/psuControl", - type: "object", - required: ["enabled", "turnOnPSUWhenExitingSleep"], + $id: '#/properties/plugins/properties/psuControl', + type: 'object', + required: ['enabled', 'turnOnPSUWhenExitingSleep'], properties: { enabled: { - $id: "#/properties/plugins/properties/printTimeGenius/properties/enabled", - type: "boolean", + $id: '#/properties/plugins/properties/printTimeGenius/properties/enabled', + type: 'boolean', }, turnOnPSUWhenExitingSleep: { - $id: "#/properties/plugins/properties/turnOnPSUWhenExitingSleep", - type: "boolean", + $id: '#/properties/plugins/properties/turnOnPSUWhenExitingSleep', + type: 'boolean', }, }, }, }, }, octodash: { - $id: "#/properties/octodash", - type: "object", + $id: '#/properties/octodash', + type: 'object', required: [ - "customActions", - "fileSorting", - "pollingInterval", - "touchscreen", - "turnScreenOffWhileSleeping", - "preferPreviewWhilePrinting", + 'customActions', + 'fileSorting', + 'pollingInterval', + 'touchscreen', + 'turnScreenOffWhileSleeping', + 'preferPreviewWhilePrinting', ], properties: { customActions: { - $id: "#/properties/octodash/properties/customActions", - type: "array", + $id: '#/properties/octodash/properties/customActions', + type: 'array', items: { - $id: "#/properties/octodash/properties/customActions/items", - type: "object", - required: ["icon", "command", "color", "confirm", "exit"], + $id: '#/properties/octodash/properties/customActions/items', + type: 'object', + required: ['icon', 'command', 'color', 'confirm', 'exit'], properties: { icon: { - $id: "#/properties/octodash/properties/customActions/items/properties/icon", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/octodash/properties/customActions/items/properties/icon', + type: 'string', + pattern: '^(.*)$', }, command: { - $id: "#/properties/octodash/properties/customActions/items/properties/command", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/octodash/properties/customActions/items/properties/command', + type: 'string', + pattern: '^(.*)$', }, color: { - $id: "#/properties/octodash/properties/customActions/items/properties/color", - type: "string", - pattern: "^(.*)$", + $id: '#/properties/octodash/properties/customActions/items/properties/color', + type: 'string', + pattern: '^(.*)$', }, confirm: { - $id: "#/properties/octodash/properties/customActions/items/properties/confirm", - type: "boolean", + $id: '#/properties/octodash/properties/customActions/items/properties/confirm', + type: 'boolean', }, exit: { - $id: "#/properties/octodash/properties/customActions/items/properties/exit", - type: "boolean", + $id: '#/properties/octodash/properties/customActions/items/properties/exit', + type: 'boolean', }, }, }, }, fileSorting: { - $id: "#/properties/octodash/properties/fileSorting", - type: "object", - required: ["attribute", "order"], + $id: '#/properties/octodash/properties/fileSorting', + type: 'object', + required: ['attribute', 'order'], properties: { attribute: { - $id: "#/properties/octodash/properties/fileSorting/properties/attribute", - type: "string", - pattern: "^(name|date|size)$", + $id: '#/properties/octodash/properties/fileSorting/properties/attribute', + type: 'string', + pattern: '^(name|date|size)$', }, order: { - $id: "#/properties/octodash/properties/fileSorting/properties/order", - type: "string", - pattern: "^(asc|dsc)$", + $id: '#/properties/octodash/properties/fileSorting/properties/order', + type: 'string', + pattern: '^(asc|dsc)$', }, }, }, pollingInterval: { - $id: "#/properties/octodash/properties/pollingInterval", - type: "integer", + $id: '#/properties/octodash/properties/pollingInterval', + type: 'integer', }, touchscreen: { - $id: "#/properties/octodash/properties/touchscreen", - type: "boolean", + $id: '#/properties/octodash/properties/touchscreen', + type: 'boolean', }, turnScreenOffWhileSleeping: { - $id: "#/properties/octodash/properties/turnScreenOffWhileSleeping", - type: "boolean", + $id: '#/properties/octodash/properties/turnScreenOffWhileSleeping', + type: 'boolean', }, preferPreviewWhilePrinting: { - $id: "#/properties/octodash/properties/preferPreviewWhilePrinting", - type: "boolean", + $id: '#/properties/octodash/properties/preferPreviewWhilePrinting', + type: 'boolean', }, }, }, diff --git a/src/app/config/invalid-config/invalid-config.component.scss b/src/app/config/invalid-config/invalid-config.component.scss index cdd92b4fa3..f336a3a883 100644 --- a/src/app/config/invalid-config/invalid-config.component.scss +++ b/src/app/config/invalid-config/invalid-config.component.scss @@ -24,13 +24,13 @@ font-size: 3.6vw; margin-top: 5vh; list-style-type: disc; - font-family: "Cousine", monospace; + font-family: 'Cousine', monospace; & li { margin-top: 2vh; &::before { - content: "-"; + content: '-'; margin-right: 2vw; } } diff --git a/src/app/config/invalid-config/invalid-config.component.ts b/src/app/config/invalid-config/invalid-config.component.ts index 405f55bc80..a3b8648811 100644 --- a/src/app/config/invalid-config/invalid-config.component.ts +++ b/src/app/config/invalid-config/invalid-config.component.ts @@ -1,11 +1,11 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit } from '@angular/core'; -import { ConfigService } from "../config.service"; +import { ConfigService } from '../config.service'; @Component({ - selector: "app-invalid-config", - templateUrl: "./invalid-config.component.html", - styleUrls: ["./invalid-config.component.scss"], + selector: 'app-invalid-config', + templateUrl: './invalid-config.component.html', + styleUrls: ['./invalid-config.component.scss'], }) export class InvalidConfigComponent implements OnInit { public errors: string[]; diff --git a/src/app/config/no-config/no-config.component.html b/src/app/config/no-config/no-config.component.html index a1168d368b..3033ffabab 100644 --- a/src/app/config/no-config/no-config.component.html +++ b/src/app/config/no-config/no-config.component.html @@ -2,7 +2,8 @@
- back + + back | @@ -11,7 +12,8 @@ | - next + next + |