mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
fix
This commit is contained in:
parent
a96c3e4b43
commit
75c41c07fd
@ -21,7 +21,7 @@ const appReducer = combineReducers({
|
||||
resendToken,
|
||||
});
|
||||
|
||||
export default (state: RootState, action: Action) => {
|
||||
export default (state: RootState, action: Action): void => {
|
||||
if (action.type === 'CLEAR_STORE') {
|
||||
state = undefined;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default (error: $TSFixMe) => {
|
||||
export default (error: $TSFixMe): void => {
|
||||
switch (error.toString()) {
|
||||
case 'Error: Network Error':
|
||||
return 'Check your network connection.';
|
||||
|
@ -922,7 +922,7 @@ export const fetchProjectDomains = (
|
||||
projectId: string,
|
||||
skip = 0,
|
||||
limit = 10
|
||||
) => {
|
||||
): void => {
|
||||
return async function (dispatch: Dispatch): void {
|
||||
dispatch(fetchProjectDomainsRequest());
|
||||
|
||||
@ -1089,7 +1089,7 @@ export const resetUnverifyProjectDomain = (): void => {
|
||||
export const unVerifyProjectDomain = (
|
||||
projectId: string,
|
||||
domainId: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return async function (dispatch: Dispatch): void {
|
||||
dispatch(unVerifyProjectDomainRequest());
|
||||
|
||||
|
@ -11,7 +11,7 @@ export const requestingSettings = (): void => {
|
||||
export const requestingSettingsSucceeded = (
|
||||
payload: $TSFixMe,
|
||||
payloadType: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.REQUESTING_SETTINGS_SUCCEEDED,
|
||||
payload,
|
||||
|
@ -13,7 +13,7 @@ const initialState = {
|
||||
success: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case DASHBOARD_LOAD_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -43,7 +43,7 @@ const appReducer = combineReducers({
|
||||
dashboard,
|
||||
});
|
||||
|
||||
export default (state: RootState, action: Action) => {
|
||||
export default (state: RootState, action: Action): void => {
|
||||
if (action.type === 'CLEAR_STORE') {
|
||||
state = undefined;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case FETCH_LICENSE_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -7,7 +7,7 @@ const initialState = {
|
||||
feedbackModalVisble: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -21,7 +21,7 @@ const initialState = {
|
||||
notificationsPosition: 0,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_NOTIFICATION_MENU:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -12,7 +12,7 @@ const initialState = {
|
||||
sidenavopen: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case PAGE_LOAD_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -20,7 +20,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case GET_VERSION_FAILED:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns Boolean true or false
|
||||
*/
|
||||
|
||||
export default (val: $TSFixMe) => {
|
||||
export default (val: $TSFixMe): void => {
|
||||
const falsy = /^(?:f(?:alse)?|no?|0+)$/i;
|
||||
return !falsy.test(val) && !!val;
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ const keyBind = (
|
||||
route: $TSFixMe,
|
||||
keys: $TSFixMe,
|
||||
resetKeys: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
let shortcut = [];
|
||||
// ensure the target is always body and not inside any other element (input, textarea, etc)
|
||||
if (route.shortcut && event.target.localName === 'body' && event.key) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default (error: $TSFixMe) => {
|
||||
export default (error: $TSFixMe): void => {
|
||||
switch (error.toString()) {
|
||||
case 'Error: Network Error':
|
||||
return 'Check your network connection.';
|
||||
|
@ -236,7 +236,7 @@ export default ({
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction
|
||||
) => {
|
||||
): void => {
|
||||
req.apiProps = props;
|
||||
return next();
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ const router = express.getRouter();
|
||||
import multer from 'multer';
|
||||
import storage from '../middlewares/upload';
|
||||
|
||||
const callForward = async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
const callForward = async (req: ExpressRequest, res: ExpressResponse): void => {
|
||||
try {
|
||||
const body = req.body;
|
||||
const to = body['To'];
|
||||
@ -43,7 +43,10 @@ const callForward = async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
}
|
||||
};
|
||||
|
||||
const backupCallForward = async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
const backupCallForward = async (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse
|
||||
): void => {
|
||||
try {
|
||||
const body = req.body;
|
||||
const to = body['To'];
|
||||
@ -66,7 +69,7 @@ const backupCallForward = async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
}
|
||||
};
|
||||
|
||||
const callStatus = async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
const callStatus = async (req: ExpressRequest, res: ExpressResponse): void => {
|
||||
try {
|
||||
const body = req.body;
|
||||
const to = body['To'];
|
||||
|
@ -249,7 +249,7 @@ const getStatusPages = async (
|
||||
return null;
|
||||
};
|
||||
|
||||
const getUsers = async (projectIds: $TSFixMe, val: $TSFixMe) => {
|
||||
const getUsers = async (projectIds: $TSFixMe, val: $TSFixMe): void => {
|
||||
//get project users id so as to search for only users in a project and its subproject
|
||||
const projectUsers: $TSFixMe = [];
|
||||
|
||||
|
@ -1384,7 +1384,7 @@ router.get(
|
||||
}
|
||||
);
|
||||
|
||||
const fetchNotes = async (events: $TSFixMe, limit: PositiveNumber) => {
|
||||
const fetchNotes = async (events: $TSFixMe, limit: PositiveNumber): void => {
|
||||
const updatedEvents = [];
|
||||
if (events.length > 0) {
|
||||
for (const event of events) {
|
||||
@ -3007,7 +3007,7 @@ const filterProbeData = (
|
||||
monitor: $TSFixMe,
|
||||
probe: $TSFixMe,
|
||||
backupStatus: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
const monitorStatuses = monitor?.statuses || backupStatus;
|
||||
const probesStatus =
|
||||
monitorStatuses && monitorStatuses.length > 0
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns a string
|
||||
*/
|
||||
|
||||
export default (arr = []) => {
|
||||
export default (arr = []): void => {
|
||||
if (!Array.isArray(arr)) return '';
|
||||
return arr.join(', ').replace(/, ([^,]*)$/, ' and $1');
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns { string } a string of random characters
|
||||
*/
|
||||
|
||||
export default (num = 15) => {
|
||||
export default (num = 15): void => {
|
||||
const input =
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let output = '';
|
||||
|
@ -25,7 +25,7 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const job = async (monitor: $TSFixMe, res: $TSFixMe) => {
|
||||
const job = async (monitor: $TSFixMe, res: $TSFixMe): void => {
|
||||
const populate = [
|
||||
{
|
||||
path: 'monitors.monitorId',
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const job = async (monitor: $TSFixMe) => {
|
||||
const job = async (monitor: $TSFixMe): void => {
|
||||
const { stat: validUp, successReasons } =
|
||||
monitor && monitor.criteria && monitor.criteria.up
|
||||
? ProbeService.conditions(monitor.type, monitor.criteria.up)
|
||||
|
@ -3053,7 +3053,7 @@ export default class Service {
|
||||
|
||||
let webhookNotificationSent = true;
|
||||
|
||||
const sendAlerts = async () => {
|
||||
const sendAlerts = async (): void => {
|
||||
if (subscriber.alertVia === AlertType.Webhook) {
|
||||
const investigationNoteNotificationWebhookDisabled =
|
||||
isStatusPageNoteAlert &&
|
||||
@ -4587,7 +4587,7 @@ export default class Service {
|
||||
? 'Scheduled maintenance resolved'
|
||||
: 'Scheduled maintenance cancelled';
|
||||
|
||||
const sendAlerts = async () => {
|
||||
const sendAlerts = async (): void => {
|
||||
if (subscriber.alertVia === AlertType.Email) {
|
||||
const [
|
||||
hasGlobalSmtpSettings,
|
||||
|
@ -1496,7 +1496,7 @@ export default class Service {
|
||||
}
|
||||
|
||||
async isPermitted(userId: string, statusPage: $TSFixMe): void {
|
||||
const fn = async (resolve: $TSFixMe) => {
|
||||
const fn = async (resolve: $TSFixMe): void => {
|
||||
if (statusPage.isPrivate) {
|
||||
if (userId) {
|
||||
const project = await ProjectService.findOneBy({
|
||||
|
@ -52,7 +52,7 @@ function logResponse(
|
||||
export const sendEmptyResponse = (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse
|
||||
) => {
|
||||
): void => {
|
||||
const oneUptimeRequest: OneUptimeRequest = req as OneUptimeRequest;
|
||||
const oneUptimeResponse: OneUptimeResponse = res as OneUptimeResponse;
|
||||
|
||||
@ -92,7 +92,7 @@ export const sendErrorResponse = (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
error: Exception
|
||||
) => {
|
||||
): void => {
|
||||
const oneUptimeRequest: OneUptimeRequest = req as OneUptimeRequest;
|
||||
const oneUptimeResponse: OneUptimeResponse = res as OneUptimeResponse;
|
||||
|
||||
|
@ -22,7 +22,7 @@ const logRequest = (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction
|
||||
) => {
|
||||
): void => {
|
||||
const current_datetime = new Date();
|
||||
const formatted_date =
|
||||
current_datetime.getFullYear() +
|
||||
@ -50,7 +50,7 @@ const setDefaultHeaders = (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction
|
||||
) => {
|
||||
): void => {
|
||||
if (typeof req.body === 'string') {
|
||||
req.body = JSON.parse(req.body);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ const initialState: initialStateType = {
|
||||
modals: [],
|
||||
};
|
||||
|
||||
export default (state = initialState, action: ModalAction) => {
|
||||
export default (state = initialState, action: ModalAction): void => {
|
||||
switch (action.type) {
|
||||
case ModalConstant.OPEN_MODAL: {
|
||||
return Object.assign({}, state, {
|
||||
|
@ -159,7 +159,7 @@ export function deleteApplicationLog(
|
||||
|
||||
export const deleteApplicationLogSuccess = (
|
||||
removedApplicationLogId: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.DELETE_APPLICATION_LOG_SUCCESS,
|
||||
payload: removedApplicationLogId,
|
||||
|
@ -478,7 +478,7 @@ export function removeIntroAudio(
|
||||
export const removeIntroAudioSuccess = (
|
||||
numbers: $TSFixMe,
|
||||
backup: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
if (backup) {
|
||||
return {
|
||||
type: types.REMOVE_BACKUP_INTRO_AUDIO_SUCCESS,
|
||||
@ -512,7 +512,7 @@ export function removeIntroAudioRequest(
|
||||
export const removeIntroAudioFailure = (
|
||||
error: ErrorPayload,
|
||||
backup: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
if (backup) {
|
||||
return {
|
||||
type: types.REMOVE_BACKUP_INTRO_AUDIO_FAILURE,
|
||||
|
@ -119,7 +119,7 @@ export const resetEmailTemplatesSuccess = (emailTemplates: $TSFixMe): void => {
|
||||
export const resetEmailTemplates = (
|
||||
projectId: string,
|
||||
templateId: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promise = BackendAPI.get(
|
||||
`emailTemplate/${projectId}/${templateId}/reset`
|
||||
|
@ -762,7 +762,7 @@ export function deleteErrorTrackerIssueSuccess(
|
||||
|
||||
export const deleteErrorTrackerIssueRequest = (
|
||||
errorTrackerIssueId: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.DELETE_ERROR_TRACKER_ISSUE_REQUEST,
|
||||
payload: errorTrackerIssueId,
|
||||
|
@ -706,7 +706,7 @@ export const deleteProjectIncidents = (projectId: string): void => {
|
||||
export const investigationNoteRequest = (
|
||||
promise: $TSFixMe,
|
||||
updated: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.INVESTIGATION_NOTE_REQUEST,
|
||||
payload: { promise, updated },
|
||||
@ -716,7 +716,7 @@ export const investigationNoteRequest = (
|
||||
export const investigationNoteError = (
|
||||
error: ErrorPayload,
|
||||
updated: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.INVESTIGATION_NOTE_FAILED,
|
||||
payload: { error, updated },
|
||||
@ -1049,7 +1049,7 @@ export function deleteIncidentMessage(
|
||||
|
||||
export const deleteIncidentMessageSuccess = (
|
||||
removedIncidentMessage: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.DELETE_INCIDENT_MESSAGE_SUCCESS,
|
||||
payload: removedIncidentMessage,
|
||||
|
@ -566,7 +566,7 @@ export const changeMonitorComponent = (
|
||||
projectId: string,
|
||||
monitorId: $TSFixMe,
|
||||
newComponentId: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return async (dispatch: Dispatch) => {
|
||||
try {
|
||||
dispatch(changeMonitorComponentRequest(monitorId));
|
||||
|
@ -1184,7 +1184,7 @@ export const fetchProjectDomains = (
|
||||
projectId: string,
|
||||
skip = 0,
|
||||
limit = 10
|
||||
) => {
|
||||
): void => {
|
||||
return async function (dispatch: Dispatch): void {
|
||||
dispatch(fetchProjectDomainsRequest());
|
||||
|
||||
|
@ -39,7 +39,7 @@ export function fetchResourceCategories(
|
||||
|
||||
export const fetchResourceCategoriesSuccess = (
|
||||
resourceCategories: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.FETCH_RESOURCE_CATEGORIES_SUCCESS,
|
||||
payload: resourceCategories,
|
||||
@ -132,7 +132,7 @@ export function updateResourceCategory(
|
||||
|
||||
export const createResourceCategorySuccess = (
|
||||
newResourceCategory: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.CREATE_RESOURCE_CATEGORY_SUCCESS,
|
||||
payload: newResourceCategory,
|
||||
@ -262,7 +262,7 @@ export const fetchResourceCategoriesForNewResourceRequest = (): void => {
|
||||
|
||||
export const fetchResourceCategoriesForNewResourceFailure = (
|
||||
error: ErrorPayload
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.FETCH_RESOURCE_CATEGORIES_FOR_NEW_RESOURCE_FAILURE,
|
||||
payload: error,
|
||||
|
@ -415,7 +415,7 @@ export function updateScheduledEvent(
|
||||
|
||||
export const updateScheduledEventSuccess = (
|
||||
updatedScheduledEvent: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.UPDATE_SCHEDULED_EVENT_SUCCESS,
|
||||
payload: updatedScheduledEvent,
|
||||
|
@ -82,7 +82,7 @@ export const getSlack = (
|
||||
projectId: string,
|
||||
skip: PositiveNumber,
|
||||
limit: PositiveNumber
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
let promise = null;
|
||||
promise = BackendAPI.get(
|
||||
|
@ -261,7 +261,7 @@ export const updatePrivateStatusPageError = (error: ErrorPayload): void => {
|
||||
export const updatePrivateStatusPage = (
|
||||
projectId: string,
|
||||
values: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promise = BackendAPI.put(`StatusPage/${projectId}`, values);
|
||||
dispatch(updatePrivateStatusPageRequest());
|
||||
@ -733,7 +733,7 @@ export const resetIncidentFetchStatusPages = (): void => {
|
||||
|
||||
export const fetchIncidentStatusPagesSuccess = (
|
||||
incidentStatusPages: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return {
|
||||
type: types.FETCH_INCIDENT_STATUSPAGE_SUCCESS,
|
||||
payload: incidentStatusPages,
|
||||
|
@ -48,7 +48,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case types.ALERT_FETCH_SUCCESS:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -6,7 +6,7 @@ const initialState = {
|
||||
animateSidebar: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case ANIMATE_SIDEBAR:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -18,7 +18,7 @@ const initialState = {
|
||||
feedbackModalVisble: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_FEEDBACK_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -72,7 +72,7 @@ const INITIAL_STATE = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = INITIAL_STATE, action: Action) => {
|
||||
export default (state = INITIAL_STATE, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case FETCH_INCIDENT_BASIC_SETTINGS_VARIABLES_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -29,7 +29,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case types.FETCH_INCIDENT_NOTE_TEMPLATES_REQUEST:
|
||||
return {
|
||||
|
@ -46,7 +46,7 @@ const INITIAL_STATE = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = INITIAL_STATE, action: Action) => {
|
||||
export default (state = INITIAL_STATE, action: Action): void => {
|
||||
let incidentPriorities, count, index;
|
||||
switch (action.type) {
|
||||
case FETCH_INCIDENT_PRIORITIES_SUCCESS:
|
||||
|
@ -118,7 +118,7 @@ const appReducer = combineReducers({
|
||||
|
||||
// Global Actions.
|
||||
|
||||
export default (state: RootState, action: Action) => {
|
||||
export default (state: RootState, action: Action): void => {
|
||||
if (action.type === 'CLEAR_STORE') {
|
||||
state = undefined;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ const initialState = {
|
||||
feedbackModalVisble: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -52,7 +52,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
let msTeams, index, count;
|
||||
switch (action.type) {
|
||||
case GET_MS_TEAMS_FAILED:
|
||||
|
@ -24,7 +24,7 @@ const initialState = {
|
||||
notificationsPosition: 0,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_NOTIFICATION_MENU:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -9,7 +9,7 @@ const initialState = {
|
||||
onCallScheduleModalVisble: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_ONCALLSCHEDULE_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -14,7 +14,7 @@ const initialState = {
|
||||
toggleProjectSettingsMore: false,
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case PAGE_LOAD_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -31,7 +31,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
let teams, index, count;
|
||||
switch (action.type) {
|
||||
case GET_SLACK_TEAM_FAILED:
|
||||
|
@ -52,7 +52,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
let slacks, index, count;
|
||||
switch (action.type) {
|
||||
case GET_SLACK_WEBHOOK_FAILED:
|
||||
|
@ -64,7 +64,7 @@ const initialState = {
|
||||
pages: {},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case TEAM_LOADING_REQUEST:
|
||||
return {
|
||||
|
@ -35,7 +35,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case FETCH_TUTORIAL_REQUEST:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -19,7 +19,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case GET_VERSION_FAILED:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -52,7 +52,7 @@ const initialState = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = initialState, action: Action) => {
|
||||
export default (state = initialState, action: Action): void => {
|
||||
let webHooks, index, count;
|
||||
switch (action.type) {
|
||||
case GET_WEB_HOOK_FAILED:
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns Boolean true or false
|
||||
*/
|
||||
|
||||
export default (val: $TSFixMe) => {
|
||||
export default (val: $TSFixMe): void => {
|
||||
const falsy = /^(?:f(?:alse)?|no?|0+)$/i;
|
||||
return !falsy.test(val) && !!val;
|
||||
};
|
||||
|
@ -8,7 +8,7 @@ const isMainProjectViewer = (
|
||||
userId: string,
|
||||
subProjects: $TSFixMe,
|
||||
currentProject: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
let user = currentProject
|
||||
? currentProject.users.find((user: $TSFixMe) => user.userId === userId)
|
||||
: null;
|
||||
|
@ -6,7 +6,7 @@ const HasProjectOwner = (
|
||||
project: $TSFixMe,
|
||||
projectId: string,
|
||||
subProjects: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
if (project._id === projectId) {
|
||||
return (
|
||||
project &&
|
||||
|
@ -56,7 +56,7 @@ interface ComponentProps {
|
||||
}
|
||||
|
||||
class SocketApp extends Component<ComponentProps> {
|
||||
override shouldComponentUpdate(nextProps: ComponentProps) {
|
||||
override shouldComponentUpdate(nextProps: ComponentProps): boolean {
|
||||
if (
|
||||
this.props.project !== nextProps.project ||
|
||||
this.props.activeProjectId !== nextProps.activeProjectId
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default (error: $TSFixMe) => {
|
||||
export default (error: $TSFixMe): void => {
|
||||
switch (error.toString()) {
|
||||
case 'Error: Network Error':
|
||||
return 'Check your network connection.';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { JSONObject } from 'Common/Types/JSON';
|
||||
|
||||
export default (product: string) => {
|
||||
export default (product: string): void => {
|
||||
const products: JSONObject = {
|
||||
pagerduty: {
|
||||
productName: 'PagerDuty',
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns { string } a string of random characters
|
||||
*/
|
||||
|
||||
export default (num = 15) => {
|
||||
export default (num = 15): void => {
|
||||
const input =
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let output = '';
|
||||
|
@ -30,7 +30,7 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const checkCondition = async (condition: $TSFixMe) => {
|
||||
const checkCondition = async (condition: $TSFixMe): void => {
|
||||
let response = false;
|
||||
if (condition && condition.and && condition.and.length) {
|
||||
for (let i = 0; i < condition.and.length; i++) {
|
||||
|
@ -35,7 +35,7 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const pingfetch = async (IPAddress: $TSFixMe) => {
|
||||
const pingfetch = async (IPAddress: $TSFixMe): void => {
|
||||
const now = new Date().getTime();
|
||||
let resp = null;
|
||||
let rawResp = null;
|
||||
|
@ -90,7 +90,7 @@ export default {
|
||||
},
|
||||
};
|
||||
|
||||
const execCommands = async (exec: $TSFixMe, os: $TSFixMe) => {
|
||||
const execCommands = async (exec: $TSFixMe, os: $TSFixMe): void => {
|
||||
const isSSH = exec instanceof NodeSSH;
|
||||
|
||||
// TODO: complete commands and make platform specific
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { exec } from 'child_process';
|
||||
import { performance } from 'perf_hooks';
|
||||
|
||||
const run = async (script: $TSFixMe) => {
|
||||
const run = async (script: $TSFixMe): void => {
|
||||
const start = performance.now();
|
||||
return new Promise(resolve => {
|
||||
exec(script, (err, stdout) => {
|
||||
|
@ -72,7 +72,7 @@ export const getAllStatusPageResource = (
|
||||
statusPageSlug: $TSFixMe,
|
||||
url: URL,
|
||||
range: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promises = [];
|
||||
|
||||
@ -640,7 +640,7 @@ export const notmonitoredDays = (
|
||||
date: $TSFixMe,
|
||||
name: $TSFixMe,
|
||||
message: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
dispatch(statusPageNoteReset());
|
||||
dispatch(
|
||||
@ -680,7 +680,7 @@ export const getMoreNote = (
|
||||
projectId: string,
|
||||
statusPageSlug: $TSFixMe,
|
||||
skip: PositiveNumber
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promise = BackendAPI.get(
|
||||
`StatusPage/${projectId}/${statusPageSlug}/notes?skip=${skip}`
|
||||
@ -733,7 +733,7 @@ export const getMoreEvent = (
|
||||
projectId: string,
|
||||
statusPageSlug: $TSFixMe,
|
||||
skip: PositiveNumber
|
||||
) => {
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promise = BackendAPI.get(
|
||||
`StatusPage/${projectId}/${statusPageSlug}/events?skip=${skip}`
|
||||
|
@ -43,7 +43,7 @@ class SocketApp extends Component<ComponentProps> {
|
||||
public static displayName = '';
|
||||
public static propTypes = {};
|
||||
|
||||
override shouldComponentUpdate(nextProps: ComponentProps) {
|
||||
override shouldComponentUpdate(nextProps: ComponentProps): boolean {
|
||||
if (this.props.project !== nextProps.project) {
|
||||
if (this.props.project) {
|
||||
socket.removeListener(
|
||||
|
@ -9,7 +9,7 @@ import subscribe from './subscribe';
|
||||
|
||||
const appReducer = combineReducers({ form, login, status, probe, subscribe });
|
||||
|
||||
export default (state: RootState, action: Action) => {
|
||||
export default (state: RootState, action: Action): void => {
|
||||
if (action.type === 'CLEAR_STORE') {
|
||||
state = undefined;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ const INITIAL_STATE = {
|
||||
error: false,
|
||||
};
|
||||
|
||||
export default (state = INITIAL_STATE, action: Action) => {
|
||||
export default (state = INITIAL_STATE, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case LOGIN_REQUIRED:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -241,7 +241,7 @@ const INITIAL_STATE = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = INITIAL_STATE, action: Action) => {
|
||||
export default (state = INITIAL_STATE, action: Action): void => {
|
||||
let monitorTimeRequest: $TSFixMe;
|
||||
let monitorTimeSuccess: $TSFixMe;
|
||||
switch (action.type) {
|
||||
|
@ -29,7 +29,7 @@ const INITIAL_STATE = {
|
||||
},
|
||||
};
|
||||
|
||||
export default (state = INITIAL_STATE, action: Action) => {
|
||||
export default (state = INITIAL_STATE, action: Action): void => {
|
||||
switch (action.type) {
|
||||
case OPEN_SUBSCRIBE_MENU:
|
||||
return Object.assign({}, state, {
|
||||
|
@ -151,7 +151,7 @@ export const filterProbeData = (
|
||||
monitor: $TSFixMe,
|
||||
probe: $TSFixMe,
|
||||
backupStatus: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
const monitorStatuses = monitor.statuses || backupStatus;
|
||||
|
||||
const probesStatus =
|
||||
@ -262,7 +262,7 @@ export const capitalize = (words: $TSFixMe): void => {
|
||||
export const handleResources = (
|
||||
monitorState: $TSFixMe,
|
||||
announcement: $TSFixMe
|
||||
) => {
|
||||
): void => {
|
||||
const affectedMonitors: $TSFixMe = [];
|
||||
let monitorCount = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default (error: $TSFixMe) => {
|
||||
export default (error: $TSFixMe): void => {
|
||||
switch (error.toString()) {
|
||||
case 'Error: Network Error':
|
||||
return 'Check your network connection.';
|
||||
|
@ -8,7 +8,7 @@ const operationTimeOut = init.timeout;
|
||||
const email = utils.generateRandomBusinessEmail();
|
||||
const password = '1234567890';
|
||||
|
||||
const moveToSsoPage = async (page: $TSFixMe) => {
|
||||
const moveToSsoPage = async (page: $TSFixMe): void => {
|
||||
await init.pageWaitForSelector(page, '#settings', {
|
||||
visible: true,
|
||||
timeout: init.timeout,
|
||||
@ -21,7 +21,7 @@ const moveToSsoPage = async (page: $TSFixMe) => {
|
||||
await init.pageClick(page, '#sso');
|
||||
};
|
||||
|
||||
const createSso = async (page: $TSFixMe, data: $TSFixMe) => {
|
||||
const createSso = async (page: $TSFixMe, data: $TSFixMe): void => {
|
||||
await init.pageWaitForSelector(page, '#add-sso', {
|
||||
visible: true,
|
||||
timeout: init.timeout,
|
||||
|
@ -9,7 +9,7 @@ import 'should';
|
||||
const email = 'masteradmin@hackerbay.io';
|
||||
const password = '1234567890';
|
||||
|
||||
const moveToSsoPage = async (page: $TSFixMe) => {
|
||||
const moveToSsoPage = async (page: $TSFixMe): void => {
|
||||
await init.pageWaitForSelector(page, '#settings');
|
||||
|
||||
await init.pageClick(page, '#settings');
|
||||
@ -19,7 +19,7 @@ const moveToSsoPage = async (page: $TSFixMe) => {
|
||||
await init.pageClick(page, '#sso');
|
||||
};
|
||||
|
||||
const createSso = async (page: $TSFixMe, data: $TSFixMe) => {
|
||||
const createSso = async (page: $TSFixMe, data: $TSFixMe): void => {
|
||||
await init.pageClick(page, '#add-sso');
|
||||
|
||||
await init.pageWaitForSelector(page, '#save-button');
|
||||
|
@ -12,7 +12,7 @@ const monitorName = 'oneuptime';
|
||||
const monitorName1 = 'testoneuptime';
|
||||
|
||||
let browser: $TSFixMe, page: $TSFixMe;
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe) => {
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe): void => {
|
||||
await page.goto(utils.DASHBOARD_URL, {
|
||||
waitUntil: ['networkidle2'],
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ const monitorName1 = 'testoneuptime';
|
||||
const customDomain = utils.generateRandomString();
|
||||
|
||||
let browser: $TSFixMe, page: $TSFixMe;
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe) => {
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe): void => {
|
||||
await page.goto(utils.DASHBOARD_URL, {
|
||||
waitUntil: ['networkidle2'],
|
||||
timeout: init.timeout,
|
||||
|
@ -13,7 +13,7 @@ const monitorName1 = 'testoneuptime';
|
||||
const customDomain = `${utils.generateRandomString()}.com`;
|
||||
|
||||
let browser: $TSFixMe, page: $TSFixMe;
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe) => {
|
||||
const gotoTheFirstStatusPage = async (page: $TSFixMe): void => {
|
||||
await page.goto(utils.DASHBOARD_URL, {
|
||||
waitUntil: ['networkidle2'],
|
||||
});
|
||||
|
@ -28,7 +28,7 @@ describe('ScriptMonitor V2', function ():void {
|
||||
|
||||
|
||||
it("should return success for a valid script", async function ():void {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
const someFunction = async (done: $TSFixMe): void => {
|
||||
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ describe('ScriptMonitor V2', function ():void {
|
||||
|
||||
|
||||
it("should return false for error thrown in script", async function ():void {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
const someFunction = async (done: $TSFixMe): void => {
|
||||
console.log('Error log');
|
||||
logger.error('Bad Error');
|
||||
throw new Error("Bad error");
|
||||
@ -73,7 +73,7 @@ describe('ScriptMonitor V2', function ():void {
|
||||
|
||||
|
||||
it("should return scriptMonitor error when script returns a value in cb", async function ():void {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
const someFunction = async (done: $TSFixMe): void => {
|
||||
done("Some Error");
|
||||
}
|
||||
const result = await runScript(someFunction.toString(), true);
|
||||
@ -89,7 +89,7 @@ describe('ScriptMonitor V2', function ():void {
|
||||
|
||||
|
||||
it("should return timeout error when script takes too long", async function ():void {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
const someFunction = async (done: $TSFixMe): void => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => "All timed out", 7000);
|
||||
})
|
||||
@ -106,7 +106,7 @@ describe('ScriptMonitor V2', function ():void {
|
||||
|
||||
|
||||
it("should return timeout error when statement takes too long", async function ():void {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
const someFunction = async (done: $TSFixMe): void => {
|
||||
while (true) {
|
||||
// statement stuck in loop or too busy
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ const {
|
||||
maxSyncStatementDuration,
|
||||
} = runConfig;
|
||||
|
||||
const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = { maxScriptRunTime, maxSyncStatementDuration }) => {
|
||||
const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = { maxScriptRunTime, maxSyncStatementDuration }): void => {
|
||||
|
||||
|
||||
if (isMainThread) {
|
||||
|
Loading…
Reference in New Issue
Block a user