mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix lint.
This commit is contained in:
@@ -14,27 +14,26 @@ import { JSONArray, JSONObject } from '../Types/JSON';
|
||||
import ObjectID from '../Types/ObjectID';
|
||||
|
||||
export default class BaseModel extends BaseEntity {
|
||||
@TableColumn({title: "ID"})
|
||||
@TableColumn({ title: 'ID' })
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
public _id!: string;
|
||||
|
||||
@TableColumn({title: "Created"})
|
||||
@TableColumn({ title: 'Created' })
|
||||
@CreateDateColumn()
|
||||
public createdAt!: Date;
|
||||
|
||||
@TableColumn({title: "Updated"})
|
||||
@TableColumn({ title: 'Updated' })
|
||||
@UpdateDateColumn()
|
||||
public updatedAt!: Date;
|
||||
|
||||
@TableColumn({title: "Deleted"})
|
||||
@TableColumn({ title: 'Deleted' })
|
||||
@DeleteDateColumn()
|
||||
public deletedAt?: Date;
|
||||
|
||||
@TableColumn({title: "Version"})
|
||||
@TableColumn({ title: 'Version' })
|
||||
@VersionColumn()
|
||||
public version!: number;
|
||||
|
||||
|
||||
private displayColumnTitleAs: Dictionary<string> = {};
|
||||
private displayColumnDescriptionAs: Dictionary<string> = {};
|
||||
|
||||
@@ -147,7 +146,10 @@ export default class BaseModel extends BaseEntity {
|
||||
return null;
|
||||
}
|
||||
|
||||
public addDisplayColumnDescriptionAs(columnName: string, description: string): void {
|
||||
public addDisplayColumnDescriptionAs(
|
||||
columnName: string,
|
||||
description: string
|
||||
): void {
|
||||
if (!this.displayColumnDescriptionAs) {
|
||||
this.displayColumnDescriptionAs = {};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import BaseModel from '../../Models/BaseModel';
|
||||
|
||||
export default (props?: {title?: string, description?: string}) => {
|
||||
export default (props?: { title?: string; description?: string }) => {
|
||||
return (target: Object, propertyKey: string) => {
|
||||
const baseModel: BaseModel = target as BaseModel;
|
||||
baseModel.addTableColumn(propertyKey);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
enum ButtonType {
|
||||
Submit = "submit",
|
||||
Reset = "reset",
|
||||
Button = "button"
|
||||
enum ButtonType {
|
||||
Submit = 'submit',
|
||||
Reset = 'reset',
|
||||
Button = 'button',
|
||||
}
|
||||
|
||||
export default ButtonType;
|
||||
export default ButtonType;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
enum ShortcutKey {
|
||||
Enter = "Enter",
|
||||
Esc = "Esc",
|
||||
New = "N",
|
||||
Settings = "S"
|
||||
Enter = 'Enter',
|
||||
Esc = 'Esc',
|
||||
New = 'N',
|
||||
Settings = 'S',
|
||||
}
|
||||
|
||||
export default ShortcutKey;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import SelectFormFields from './SelectFormField';
|
||||
|
||||
export default interface Field<TEntity> {
|
||||
title?: string,
|
||||
description?: string,
|
||||
field: SelectFormFields<TEntity>
|
||||
}
|
||||
export default interface Field<TEntity> {
|
||||
title?: string;
|
||||
description?: string;
|
||||
field: SelectFormFields<TEntity>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Field from "./Field"
|
||||
import Field from './Field';
|
||||
|
||||
type Fields<T> = Array<Field<T>>
|
||||
type Fields<T> = Array<Field<T>>;
|
||||
|
||||
export default Fields
|
||||
export default Fields;
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
import Hostname from "Common/Types/API/Hostname";
|
||||
import Email from "Common/Types/Email";
|
||||
import Name from "Common/Types/Name";
|
||||
import ObjectID from "Common/Types/ObjectID";
|
||||
import Hostname from 'Common/Types/API/Hostname';
|
||||
import Email from 'Common/Types/Email';
|
||||
import Name from 'Common/Types/Name';
|
||||
import ObjectID from 'Common/Types/ObjectID';
|
||||
|
||||
type FormFieldType = string | number | boolean | ObjectID | Hostname | Email | Name;
|
||||
type FormFieldType =
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| ObjectID
|
||||
| Hostname
|
||||
| Email
|
||||
| Name;
|
||||
|
||||
export default FormFieldType;
|
||||
export default FormFieldType;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import Hostname from 'Common/Types/API/Hostname';
|
||||
import ObjectID from 'Common/Types/ObjectID';
|
||||
import FormType from './FormSchemaType'
|
||||
import FormType from './FormSchemaType';
|
||||
|
||||
type FormField<Property> =
|
||||
Property extends ObjectID ? FormType.ObjectID
|
||||
: Property extends Hostname ? FormType.Hostname
|
||||
type FormField<Property> = Property extends ObjectID
|
||||
? FormType.ObjectID
|
||||
: Property extends Hostname
|
||||
? FormType.Hostname
|
||||
: unknown;
|
||||
|
||||
export declare type FormFields<Entity> = {
|
||||
[P in keyof Entity]?: FormField<NonNullable<Entity[P]>>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
enum FormType {
|
||||
ObjectID,
|
||||
Name,
|
||||
Hostname,
|
||||
URL,
|
||||
String,
|
||||
Number,
|
||||
Password,
|
||||
enum FormType {
|
||||
ObjectID,
|
||||
Name,
|
||||
Hostname,
|
||||
URL,
|
||||
String,
|
||||
Number,
|
||||
Password,
|
||||
}
|
||||
|
||||
|
||||
export default FormType
|
||||
export default FormType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FormFieldSchemaTypes from './FormFieldType'
|
||||
import FormFieldSchemaTypes from './FormFieldType';
|
||||
|
||||
export type FormField<Property> = Property extends FormFieldSchemaTypes
|
||||
? Property
|
||||
@@ -8,4 +8,4 @@ declare type FormValues<Entity> = {
|
||||
[P in keyof Entity]?: FormField<NonNullable<Entity[P]>>;
|
||||
};
|
||||
|
||||
export default FormValues;
|
||||
export default FormValues;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FormFieldSchemaTypes from './FormFieldType'
|
||||
import FormFieldSchemaTypes from './FormFieldType';
|
||||
|
||||
type RequiredFormField<Property> = Property extends FormFieldSchemaTypes
|
||||
? boolean
|
||||
@@ -8,4 +8,4 @@ declare type RequiredFormFields<Entity> = {
|
||||
[P in keyof Entity]?: RequiredFormField<NonNullable<Entity[P]>>;
|
||||
};
|
||||
|
||||
export default RequiredFormFields;
|
||||
export default RequiredFormFields;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import FormFieldSchemaTypes from "./FormFieldType";
|
||||
import FormFieldSchemaTypes from './FormFieldType';
|
||||
|
||||
export type SelectFormField<Property> = Property extends FormFieldSchemaTypes
|
||||
? boolean
|
||||
@@ -8,4 +8,4 @@ declare type SelectFormFields<Entity> = {
|
||||
[P in keyof Entity]?: SelectFormField<NonNullable<Entity[P]>>;
|
||||
};
|
||||
|
||||
export default SelectFormFields;
|
||||
export default SelectFormFields;
|
||||
|
||||
@@ -7,9 +7,7 @@ import RootReducers from './Reducers/Index';
|
||||
const store: Store = createStore(
|
||||
RootReducers,
|
||||
{},
|
||||
compose(
|
||||
applyMiddleware(thunk, routerMiddleware(history))
|
||||
)
|
||||
compose(applyMiddleware(thunk, routerMiddleware(history)))
|
||||
);
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
|
||||
Reference in New Issue
Block a user