Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
R0tenur committed Oct 20, 2023
1 parent 856e070 commit 27e4e78
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 40 deletions.
Empty file.
5 changes: 1 addition & 4 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Exportable> {
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 });
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/app/components/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>();
constructor() { }
}
Empty file.
3 changes: 1 addition & 2 deletions frontend/src/app/components/dev-bar/dev-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/* 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';

@Component({
selector: 'app-dev-bar',
templateUrl: './dev-bar.component.html',
styleUrls: ['./dev-bar.component.scss'],
})
export class DevBarComponent {
public numberOfTables = 10;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/services/alert.service.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/services/data-studio.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/services/fake-db.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down
15 changes: 1 addition & 14 deletions frontend/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 0 additions & 12 deletions installTypings.js

This file was deleted.

0 comments on commit 27e4e78

Please sign in to comment.