Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ module.exports = {
'src/server/service/interfaces/**',
'src/server/service/normalize-data/**',
'src/server/service/page/**',
'src/client/interfaces/**',
'src/client/models/**',
],
settings: {
// resolve path aliases by eslint-import-resolver-typescript
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/client/interfaces/clearable.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface IClearable {
clear: () => void,
clear: () => void;
}
2 changes: 1 addition & 1 deletion apps/app/src/client/interfaces/focusable.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface IFocusable {
focus: () => void,
focus: () => void;
}
17 changes: 8 additions & 9 deletions apps/app/src/client/interfaces/global-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ export const NotifyType = {
SLACK: 'slack',
} as const;

export type NotifyType = typeof NotifyType[keyof typeof NotifyType]

export type NotifyType = (typeof NotifyType)[keyof typeof NotifyType];

export const TriggerEventType = {
CREATE: 'pageCreate',
Expand All @@ -15,13 +14,13 @@ export const TriggerEventType = {
POST: 'comment',
} as const;

type TriggerEventType = typeof TriggerEventType[keyof typeof TriggerEventType]

type TriggerEventType =
(typeof TriggerEventType)[keyof typeof TriggerEventType];

export type IGlobalNotification = {
triggerPath: string,
notifyType: NotifyType,
emailToSend: string,
slackChannelToSend: string,
triggerEvents: TriggerEventType[],
triggerPath: string;
notifyType: NotifyType;
emailToSend: string;
slackChannelToSend: string;
triggerEvents: TriggerEventType[];
};
6 changes: 3 additions & 3 deletions apps/app/src/client/interfaces/handsontable-modal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type LaunchHandsonTableModalEventDetail = {
bol: number,
eol: number,
}
bol: number;
eol: number;
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface IInAppNotificationOpenable {
open: () => void,
open: () => void;
}
8 changes: 4 additions & 4 deletions apps/app/src/client/interfaces/notification.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { NotifyType } from './global-notification';

export type INotificationType = {
__t?: NotifyType
_id: string
__t?: NotifyType;
_id: string;
// TOOD: Define the provider type
provider?: any
}
provider?: any;
};
22 changes: 11 additions & 11 deletions apps/app/src/client/interfaces/react-bootstrap-typeahead.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// https://github.com/ericgio/react-bootstrap-typeahead/blob/5.x/docs/API.md
export type TypeaheadProps = {
dropup?: boolean,
emptyLabel?: string,
placeholder?: string,
autoFocus?: boolean,
inputProps?: unknown,
dropup?: boolean;
emptyLabel?: string;
placeholder?: string;
autoFocus?: boolean;
inputProps?: unknown;

onChange?: (data: unknown[]) => void,
onBlur?: () => void,
onFocus?: () => void,
onSearch?: (text: string) => void,
onInputChange?: (text: string) => void,
onKeyDown?: (input: string) => void,
onChange?: (data: unknown[]) => void;
onBlur?: () => void;
onFocus?: () => void;
onSearch?: (text: string) => void;
onInputChange?: (text: string) => void;
onKeyDown?: (input: string) => void;
};
10 changes: 5 additions & 5 deletions apps/app/src/client/interfaces/selectable-all.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export interface ISelectable {
select: () => void,
deselect: () => void,
select: () => void;
deselect: () => void;
}

export interface ISelectableAndIndeterminatable extends ISelectable {
setIndeterminate: () => void,
setIndeterminate: () => void;
}

export interface ISelectableAll {
selectAll: () => void,
deselectAll: () => void,
selectAll: () => void;
deselectAll: () => void;
}
19 changes: 11 additions & 8 deletions apps/app/src/client/models/BootstrapGrid.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
export default class BootstrapGrid {

constructor(colsRatios, responsiveSize) {
this.colsRatios = BootstrapGrid.validateColsRatios(colsRatios);
this.responsiveSize = BootstrapGrid.validateResponsiveSize(responsiveSize);
}

static ResponsiveSize = {
XS_SIZE: 'xs', SM_SIZE: 'sm', MD_SIZE: 'md',
XS_SIZE: 'xs',
SM_SIZE: 'sm',
MD_SIZE: 'md',
};

static validateColsRatios(colsRatios) {

if (colsRatios.length < 2 || colsRatios.length > 4) {
throw new Error('Incorrect array length of cols ratios');
}
const ratiosTotal = colsRatios.reduce((total, ratio) => { return total + ratio }, 0);
const ratiosTotal = colsRatios.reduce((total, ratio) => {
return total + ratio;
}, 0);
if (ratiosTotal !== 12) {
throw new Error('Incorrect cols ratios value');
}
Expand All @@ -23,12 +25,13 @@ export default class BootstrapGrid {
}

static validateResponsiveSize(responsiveSize) {
if (responsiveSize === this.ResponsiveSize.XS_SIZE
|| responsiveSize === this.ResponsiveSize.SM_SIZE
|| responsiveSize === this.ResponsiveSize.MD_SIZE) {
if (
responsiveSize === BootstrapGrid.ResponsiveSize.XS_SIZE ||
responsiveSize === BootstrapGrid.ResponsiveSize.SM_SIZE ||
responsiveSize === BootstrapGrid.ResponsiveSize.MD_SIZE
) {
return responsiveSize;
}
throw new Error('Incorrect responsive size');
}

}
12 changes: 8 additions & 4 deletions apps/app/src/client/models/HotkeyStroke.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import loggerFactory from '~/utils/logger';
const logger = loggerFactory('growi:cli:HotkeyStroke');

export default class HotkeyStroke {

constructor(stroke) {
this.stroke = stroke;
this.activeIndices = [];
Expand Down Expand Up @@ -42,16 +41,21 @@ export default class HotkeyStroke {
return nextIndex;
})
// exclude null
.filter(index => index != null);
.filter((index) => index != null);

// reset if completed
if (isCompleted) {
this.activeIndices = [];
}

logger.debug('activeIndices for [', this.stroke, '] => [', this.activeIndices, ']');
logger.debug(
'activeIndices for [',
this.stroke,
'] => [',
this.activeIndices,
']',
);

return isCompleted;
}

}
6 changes: 3 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"!apps/slackbot-proxy/src/public/bootstrap",
"!packages/pdf-converter-client/src/index.ts",
"!packages/pdf-converter-client/specs",
"!apps/app/src/client",
"!apps/app/src/server/middlewares",
"!apps/app/src/server/routes/apiv3/*.js"
"!apps/app/src/client/components",
"!apps/app/src/client/services",
"!apps/app/src/client/util"
]
},
"formatter": {
Expand Down
Loading