-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code and remove unused files
- Loading branch information
Showing
56 changed files
with
261 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +0,0 @@ | ||
.app-loader { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { StatusFilterOption } from '@interfaces/machine-events-options.interface'; | ||
import { NzTableFilterList } from 'ng-zorro-antd/table'; | ||
|
||
export enum MACHINE_STATUS_MAP { | ||
idle = 'idle', | ||
running = 'running', | ||
errored = 'errored', | ||
repaired = 'repaired', | ||
finished = 'finished', | ||
} | ||
|
||
export const MACHINE_STATUS_FILTERS: StatusFilterOption[] = [ | ||
{ text: 'Idle', value: MACHINE_STATUS_MAP.idle }, | ||
{ text: 'Running', value: MACHINE_STATUS_MAP.running }, | ||
{ text: 'Errored', value: MACHINE_STATUS_MAP.errored }, | ||
{ text: 'Repaired', value: MACHINE_STATUS_MAP.repaired }, | ||
{ text: 'Finished', value: MACHINE_STATUS_MAP.finished }, | ||
]; | ||
|
||
export const MACHINE_COLORS_STATUS_MAP = { | ||
[MACHINE_STATUS_MAP.idle]: 'info', | ||
[MACHINE_STATUS_MAP.running]: 'warning', | ||
[MACHINE_STATUS_MAP.errored]: 'error', | ||
[MACHINE_STATUS_MAP.repaired]: 'success', | ||
[MACHINE_STATUS_MAP.finished]: 'success', | ||
}; | ||
|
||
export const MACHINE_TYPE_OPTIONS: NzTableFilterList = [ | ||
{ text: 'Microscope', value: 'microscope' }, | ||
{ text: 'Measurement', value: 'measurement' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { MachinesStore } from './machines-state.interface'; | ||
import { PlacesStore } from './place-state.interface'; | ||
import { SettingsStore } from './settings-state.interface'; | ||
|
||
export interface AppStore extends MachinesStore, PlacesStore, SettingsStore {} |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/floor.ts → src/app/interfaces/floor.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type MachineStatus = 'idle' | 'running' | 'errored' | 'repaired'; | ||
|
||
export interface StatusFilterOption { | ||
text: string; | ||
value: string; | ||
byDefault?: boolean; | ||
} | ||
|
||
export interface MachineEventsOptions { | ||
timestamp: string; | ||
status: MachineStatus; | ||
} |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/machine-options.ts → ...p/interfaces/machine-options.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/machine-response.ts → .../interfaces/machine-response.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...app/interfaces/machine-update-response.ts → ...aces/machine-update-response.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { NzSafeAny } from 'ng-zorro-antd/core/types'; | ||
|
||
export interface MachineTypeOption { | ||
text: string; | ||
value: NzSafeAny; | ||
byDefault?: boolean; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/machines-response.ts → ...interfaces/machines-response.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/machines-state.ts → ...pp/interfaces/machines-state.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/place-options.ts → ...app/interfaces/place-options.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/app/interfaces/place-state.ts → src/app/interfaces/place-state.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/app/models/machine-event.ts → src/app/models/machine-event.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { PlaceOptions } from '../interfaces/place-options.interface'; | ||
import { Machine } from './machine.model'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
export class Place { | ||
id = uuidv4(); | ||
longitude!: number; | ||
latitude!: number; | ||
floors: PlaceOptions['floors'] = []; | ||
|
||
constructor(options: PlaceOptions) { | ||
this.longitude = options.longitude; | ||
this.latitude = options.latitude; | ||
this.floors = options.floors || []; | ||
} | ||
|
||
addMachine(machine: Machine) { | ||
if (this.floors && this.floors[machine.floor]) { | ||
this.floors[machine.floor].machines.push(machine.id); | ||
} else if (this.floors) { | ||
this.floors[machine.floor] = { | ||
level: machine.floor, | ||
machines: [machine.id], | ||
}; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.