From 27e4e78cc77fbb9c4f9b5b1ef318d7a91be9956a Mon Sep 17 00:00:00 2001 From: Jens Hunt Date: Fri, 20 Oct 2023 09:07:15 +0200 Subject: [PATCH] refactor: cleanup --- frontend/src/app/app.component.scss | 0 frontend/src/app/app.component.ts | 5 +---- .../src/app/components/button/button.component.ts | 3 +-- .../app/components/dev-bar/dev-bar.component.scss | 0 .../app/components/dev-bar/dev-bar.component.ts | 3 +-- frontend/src/app/services/alert.service.spec.ts | 8 ++++---- .../src/app/services/data-studio.service.spec.ts | 2 +- frontend/src/app/services/fake-db.service.ts | 1 - frontend/src/environments/environment.ts | 15 +-------------- installTypings.js | 12 ------------ 10 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 frontend/src/app/app.component.scss delete mode 100644 frontend/src/app/components/dev-bar/dev-bar.component.scss delete mode 100644 installTypings.js diff --git a/frontend/src/app/app.component.scss b/frontend/src/app/app.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index d19bcb8..ab4a048 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -6,15 +6,12 @@ import { Exportable } from './models/exportable.model'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] }) export class AppComponent { - public get Database$(): Observable { return this.dataStudioService.Database$; } - constructor( - public readonly dataStudioService: DataStudioService) { } + constructor(public readonly dataStudioService: DataStudioService) {} public exportSvg(svg: string, markdown: string): void { this.dataStudioService.saveCommand({ chart: svg, mermaid: markdown }); diff --git a/frontend/src/app/components/button/button.component.ts b/frontend/src/app/components/button/button.component.ts index 5466142..f4875f1 100644 --- a/frontend/src/app/components/button/button.component.ts +++ b/frontend/src/app/components/button/button.component.ts @@ -3,9 +3,8 @@ import { Component, EventEmitter, Output } from '@angular/core'; @Component({ selector: 'app-button', templateUrl: './button.component.html', - styleUrls: ['./button.component.scss'] + styleUrls: ['./button.component.scss'], }) export class ButtonComponent { @Output() public readonly clicked = new EventEmitter(); - constructor() { } } diff --git a/frontend/src/app/components/dev-bar/dev-bar.component.scss b/frontend/src/app/components/dev-bar/dev-bar.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/app/components/dev-bar/dev-bar.component.ts b/frontend/src/app/components/dev-bar/dev-bar.component.ts index 3fa78d1..bfc7c4c 100644 --- a/frontend/src/app/components/dev-bar/dev-bar.component.ts +++ b/frontend/src/app/components/dev-bar/dev-bar.component.ts @@ -1,5 +1,5 @@ /* istanbul ignore file */ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { Status } from '../../../../../shared/models/status.enum'; import { DataStudioService } from '../../services/data-studio.service'; import { FakeDbService } from '../../services/fake-db.service'; @@ -7,7 +7,6 @@ import { FakeDbService } from '../../services/fake-db.service'; @Component({ selector: 'app-dev-bar', templateUrl: './dev-bar.component.html', - styleUrls: ['./dev-bar.component.scss'], }) export class DevBarComponent { public numberOfTables = 10; diff --git a/frontend/src/app/services/alert.service.spec.ts b/frontend/src/app/services/alert.service.spec.ts index 40d8e4d..c9213de 100644 --- a/frontend/src/app/services/alert.service.spec.ts +++ b/frontend/src/app/services/alert.service.spec.ts @@ -1,4 +1,4 @@ -import { fakeAsync, TestBed, tick } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; import { take } from 'rxjs/operators'; import { Status } from '../../../../shared/models/status.enum'; import { ChartError } from '../models/error.model'; @@ -17,13 +17,13 @@ describe('AlertService', () => { expect(alertService).toBeTruthy(); }); describe('showError', () => { - it('should trigger alert', done => { + it('should trigger alert', (done) => { // Arrange const chartError = createChartError(); // Act alertService.showError(chartError); - alertService.Alert$.pipe(take(1)).subscribe(alert => { + alertService.Alert$.pipe(take(1)).subscribe((alert) => { // Assert expect(alert).toBe(chartError); done(); @@ -38,7 +38,7 @@ describe('AlertService', () => { // Act alertService.showError(chartError); alertService.dismissError(); - alertService.Alert$.pipe(take(1)).subscribe(alert => { + alertService.Alert$.pipe(take(1)).subscribe((alert) => { // Assert expect(alert).toBeUndefined(); done(); diff --git a/frontend/src/app/services/data-studio.service.spec.ts b/frontend/src/app/services/data-studio.service.spec.ts index de04fb3..e5348d3 100644 --- a/frontend/src/app/services/data-studio.service.spec.ts +++ b/frontend/src/app/services/data-studio.service.spec.ts @@ -5,7 +5,7 @@ import { AlertService } from './alert.service'; import { DataStudioService } from './data-studio.service'; import { WINDOW } from './window.token'; -import { Subject, Subscription } from 'rxjs'; +import { Subscription } from 'rxjs'; import { MERMAID } from './mermaid.token'; import { Exportable } from '../models/exportable.model'; diff --git a/frontend/src/app/services/fake-db.service.ts b/frontend/src/app/services/fake-db.service.ts index 58f7c60..690f6d5 100644 --- a/frontend/src/app/services/fake-db.service.ts +++ b/frontend/src/app/services/fake-db.service.ts @@ -8,7 +8,6 @@ import { Injectable } from '@angular/core'; }) export class FakeDbService { private readonly header = 'classDiagram'; - constructor() {} public createDiagram(numberOfTables: number): string { const tables: string[] = []; diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts index 30d7bcc..a20cfe5 100644 --- a/frontend/src/environments/environment.ts +++ b/frontend/src/environments/environment.ts @@ -1,16 +1,3 @@ -// This file can be replaced during build by using the `fileReplacements` array. -// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. -// The list of file replacements can be found in `angular.json`. - export const environment = { - production: false + production: false, }; - -/* - * For easier debugging in development mode, you can import the following file - * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. - * - * This import should be commented out in production mode because it will have a negative impact - * on performance if an error is thrown. - */ -// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/installTypings.js b/installTypings.js deleted file mode 100644 index 1c42596..0000000 --- a/installTypings.js +++ /dev/null @@ -1,12 +0,0 @@ -var https = require('https'); -var fs = require('fs'); - -function download(filename, url) { - var file = fs.createWriteStream(filename); - var request = https.get(url, function(response) { - response.pipe(file); - }); -} - -console.log('Downloading azdata proposed typings'); -download('src/typings/azdata.proposed.d.ts', 'https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/src/sql/azdata.proposed.d.ts');