This commit is contained in:
Nawaz Dhandala 2022-04-15 16:06:48 +01:00
parent 3aa455876f
commit 48d25247a0
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA
58 changed files with 89 additions and 74 deletions

View File

@ -12,7 +12,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.CHANGEPASSWORD_REQUEST:
return Object.assign({}, state, {

View File

@ -52,7 +52,7 @@ const initialState: $TSFixMe = {
loginMethod: 'standard',
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case CHANGE_LOGIN:
return Object.assign({}, state, {

View File

@ -47,7 +47,7 @@ const initialState: $TSFixMe = {
email: null,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
let incCount: $TSFixMe, decCount: $TSFixMe, stage: $TSFixMe;
switch (action.type) {
case SIGNUP_REQUEST:

View File

@ -13,7 +13,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case RESENDTOKEN_REQUEST:
return Object.assign({}, state, {

View File

@ -17,7 +17,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case PASSWORDRESET_REQUEST:
return Object.assign({}, state, {

View File

@ -13,7 +13,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case DASHBOARD_LOAD_REQUEST:
return Object.assign({}, state, {

View File

@ -25,7 +25,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case FETCH_LICENSE_REQUEST:
return Object.assign({}, state, {

View File

@ -7,7 +7,7 @@ const initialState: $TSFixMe = {
feedbackModalVisble: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_MODAL:
return Object.assign({}, state, {

View File

@ -21,7 +21,7 @@ const initialState: $TSFixMe = {
notificationsPosition: 0,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_NOTIFICATION_MENU:
return Object.assign({}, state, {

View File

@ -12,7 +12,7 @@ const initialState: $TSFixMe = {
sidenavopen: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case PAGE_LOAD_REQUEST:
return Object.assign({}, state, {

View File

@ -29,7 +29,7 @@ const initialState: $TSFixMe = {
},
};
export default function probes(state = initialState, action: Action): void {
export default function probes(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.PROBE_SUCCESS:
return Object.assign({}, state, {

View File

@ -20,7 +20,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case GET_VERSION_FAILED:
return Object.assign({}, state, {

View File

@ -58,7 +58,7 @@ describe('Alert API', (): void => {
userId = res.body.id;
ComponentModel.create({ name: 'Test Component' }).then(
(component: $TSFixMe) => {
(component: $TSFixMe) => {
UserModel.findByIdAndUpdate(
userId,
{ $set: { isVerified: true } },

View File

@ -39,7 +39,7 @@ describe('Enterprise Alert API', function (): void {
projectId = project._id;
ComponentModel.create({ name: 'New Component' }).then(
(component: $TSFixMe) => {
(component: $TSFixMe) => {
request
.post('/user/login')
.send({

View File

@ -1096,7 +1096,7 @@ public async getEvents(
// do not repeat the same event two times
events = eventIds.map((id: $TSFixMe) => {
return events.find(event => String(event._id) === String(id));
return events.find((event : $TSFixMe) =>String(event._id) === String(id));
});
const count: $TSFixMe = events.length;
@ -1203,7 +1203,7 @@ public async getFutureEvents(
// do not repeat the same event two times
events = eventIds.map((id: $TSFixMe) => {
return events.find(event => String(event._id) === String(id));
return events.find((event : $TSFixMe) =>String(event._id) === String(id));
});
// // sort in ascending start date
@ -1311,7 +1311,7 @@ public async getPastEvents(
// do not repeat the same event two times
events = eventIds.map((id: $TSFixMe) => {
return events.find(event => String(event._id) === String(id));
return events.find((event : $TSFixMe) =>String(event._id) === String(id));
});
// sort in ascending start date

View File

@ -14,7 +14,7 @@ const initialState: InitialStateType = {
};
export default (
state = initialState,
state: $TSFixMe = initialState,
action: ModalAction
): InitialStateType => {
switch (action.type) {

View File

@ -229,35 +229,50 @@ export const setErrorEndDate: Function = (date: $TSFixMe): void => {
};
};
export const resetTimeDate: Function = (startDate: $TSFixMe, endDate: $TSFixMe): void => {
export const resetTimeDate: Function = (
startDate: $TSFixMe,
endDate: $TSFixMe
): void => {
return {
type: types.RESET_TIME_DATE,
payload: { startDate, endDate },
};
};
export const resetThroughputDate: Function = (startDate: $TSFixMe, endDate: $TSFixMe): void => {
export const resetThroughputDate: Function = (
startDate: $TSFixMe,
endDate: $TSFixMe
): void => {
return {
type: types.RESET_THROUGHPUT_DATE,
payload: { startDate, endDate },
};
};
export const resetErrorDate: Function = (startDate: $TSFixMe, endDate: $TSFixMe): void => {
export const resetErrorDate: Function = (
startDate: $TSFixMe,
endDate: $TSFixMe
): void => {
return {
type: types.RESET_ERROR_DATE,
payload: { startDate, endDate },
};
};
export const resetIncomingDate: Function = (startDate: $TSFixMe, endDate: $TSFixMe): void => {
export const resetIncomingDate: Function = (
startDate: $TSFixMe,
endDate: $TSFixMe
): void => {
return {
type: types.RESET_INCOMING_DATE,
payload: { startDate, endDate },
};
};
export const resetOutgoingDate: Function = (startDate: $TSFixMe, endDate: $TSFixMe): void => {
export const resetOutgoingDate: Function = (
startDate: $TSFixMe,
endDate: $TSFixMe
): void => {
return {
type: types.RESET_OUTGOING_DATE,
payload: { startDate, endDate },

View File

@ -48,7 +48,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case types.ALERT_FETCH_SUCCESS:
return Object.assign({}, state, {

View File

@ -6,7 +6,7 @@ const initialState: $TSFixMe = {
animateSidebar: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case ANIMATE_SIDEBAR:
return Object.assign({}, state, {

View File

@ -78,7 +78,7 @@ const initialState: $TSFixMe = {
},
};
export default function card(state = initialState, action: Action): void {
export default function card(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.GET_CALL_ROUTING_NUMBERS_REQUEST:
return Object.assign({}, state, {

View File

@ -30,7 +30,7 @@ const initialState: $TSFixMe = {
},
};
export default function card(state = initialState, action: Action): void {
export default function card(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.ADD_CARD_REQUEST:
return Object.assign({}, state, {

View File

@ -12,7 +12,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.CHANGEPASSWORD_REQUEST:
return Object.assign({}, state, {

View File

@ -14,7 +14,7 @@ const initialState: $TSFixMe = {
dockerSecurities: [],
};
export default function credential(state = initialState, action: Action): void {
export default function credential(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.ADD_GIT_CREDENTIAL_REQUEST:
return {

View File

@ -22,7 +22,7 @@ const initialState: $TSFixMe = {
};
export default function customField(
state = initialState,
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {

View File

@ -9,7 +9,7 @@ const initialState: $TSFixMe = {
},
};
export default function dateTime(state = initialState, action: Action): void {
export default function dateTime(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case 'SET_START_DATE':
return Object.assign({}, state, {

View File

@ -35,7 +35,7 @@ const initialState: $TSFixMe = {
showEmailSmtpConfiguration: false,
};
export default function incident(state = initialState, action: Action): void {
export default function incident(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.EMAIL_TEMPLATES_SUCCESS:
return Object.assign({}, state, {

View File

@ -18,7 +18,7 @@ const initialState: $TSFixMe = {
feedbackModalVisble: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_FEEDBACK_MODAL:
return Object.assign({}, state, {

View File

@ -12,7 +12,7 @@ const initialState: $TSFixMe = {
oncallDuty: [],
};
export default function groups(state = initialState, action: Action): void {
export default function groups(state: $TSFixMe = initialState, action: Action): void {
let updatedGroup: $TSFixMe;
switch (action.type) {
case types.GET_GROUPS_REQUEST:

View File

@ -84,7 +84,7 @@ const initialState: $TSFixMe = {
activeIncident: null,
};
export default function incident(state = initialState, action: Action): void {
export default function incident(state: $TSFixMe = initialState, action: Action): void {
let incident: $TSFixMe,
incidents: $TSFixMe,
unresolvedincidents: $TSFixMe,

View File

@ -28,7 +28,7 @@ const initialState: $TSFixMe = {
};
export default function incidentCommunicationSla(
state = initialState,
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {

View File

@ -29,7 +29,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case types.FETCH_INCIDENT_NOTE_TEMPLATES_REQUEST:
return {

View File

@ -33,7 +33,7 @@ const initialState: $TSFixMe = {
};
export default function incomingRequest(
state = initialState,
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {

View File

@ -7,7 +7,7 @@ const initialState: $TSFixMe = {
feedbackModalVisble: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_MODAL:
return Object.assign({}, state, {

View File

@ -21,7 +21,7 @@ const initialState: $TSFixMe = {
};
export default function monitorCustomField(
state = initialState,
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {

View File

@ -28,7 +28,7 @@ const initialState: $TSFixMe = {
page: 1,
};
export default function monitorSla(state = initialState, action: Action): void {
export default function monitorSla(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.CREATE_MONITOR_SLA_REQUEST:
return {

View File

@ -52,7 +52,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
let msTeams: $TSFixMe, index: $TSFixMe, count: $TSFixMe;
switch (action.type) {
case GET_MS_TEAMS_FAILED:

View File

@ -24,7 +24,7 @@ const initialState: $TSFixMe = {
notificationsPosition: 0,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_NOTIFICATION_MENU:
return Object.assign({}, state, {

View File

@ -9,7 +9,7 @@ const initialState: $TSFixMe = {
onCallScheduleModalVisble: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case OPEN_ONCALLSCHEDULE_MODAL:
return Object.assign({}, state, {

View File

@ -14,7 +14,7 @@ const initialState: $TSFixMe = {
toggleProjectSettingsMore: false,
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case PAGE_LOAD_REQUEST:
return Object.assign({}, state, {

View File

@ -14,7 +14,7 @@ const initialState: $TSFixMe = {
},
};
export default function probes(state = initialState, action: Action): void {
export default function probes(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.PROBE_SUCCESS:
return Object.assign({}, state, {

View File

@ -128,7 +128,7 @@ const initialState: $TSFixMe = {
},
};
export default function project(state = initialState, action: Action): void {
export default function project(state: $TSFixMe = initialState, action: Action): void {
let projects: $TSFixMe, newProjects: $TSFixMe;
switch (action.type) {
case types.CHANGE_DELETE_MODAL:

View File

@ -31,7 +31,7 @@ const initialState: $TSFixMe = {
},
};
export default function incidents(state = initialState, action: Action): void {
export default function incidents(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.GET_ACTIVE_MEMBERS_REQUEST:
return Object.assign({}, state, {

View File

@ -125,7 +125,7 @@ const initialState: $TSFixMe = {
},
};
export default function schedule(state = initialState, action: Action): void {
export default function schedule(state: $TSFixMe = initialState, action: Action): void {
let data: $TSFixMe, index: $TSFixMe, isExistingSchedule: $TSFixMe;
switch (action.type) {
case SCHEDULE_FETCH_SUCCESS:

View File

@ -216,7 +216,7 @@ export default function scheduledEvent(
if (!existingOngoingEvent) {
if (startDate <= currentDate && endDate > currentDate) {
events = state.subProjectOngoingScheduledEvent.events.map(
eventData => {
(eventData: $TSFixMe) => {
if (
String(eventData.project) ===
String(action.payload.projectId._id)
@ -238,7 +238,7 @@ export default function scheduledEvent(
const scheduledEvents: $TSFixMe =
state.subProjectScheduledEventList.scheduledEvents.map(
event => {
(event : $TSFixMe) =>{
if (
String(event.project) ===
String(action.payload.projectId._id)
@ -338,7 +338,7 @@ export default function scheduledEvent(
case FETCH_SCHEDULED_EVENTS_SUCCESS: {
const scheduledEvents: $TSFixMe =
state.subProjectScheduledEventList.scheduledEvents.map(
event => {
(event : $TSFixMe) =>{
if (
action.payload.data.length > 0 &&
String(event.project) ===
@ -536,7 +536,7 @@ export default function scheduledEvent(
const scheduledEvents: $TSFixMe =
state.subProjectScheduledEventList.scheduledEvents.map(
subEvent => {
sub(event : $TSFixMe) =>{
if (
String(subEvent.project) ===
String(action.payload.projectId)
@ -596,7 +596,7 @@ export default function scheduledEvent(
...state.scheduledEventList,
scheduledEvents:
state.scheduledEventList.scheduledEvents.filter(
scheduledEvent => {
scheduled(event : $TSFixMe) =>{
if (
String(scheduledEvent._id) ===
String(action.payload._id)
@ -669,7 +669,7 @@ export default function scheduledEvent(
);
const subEvents: $TSFixMe =
state.subProjectScheduledEventList.scheduledEvents.map(
subEvent => {
sub(event : $TSFixMe) =>{
if (
String(subEvent.project) ===
String(action.payload.projectId._id)
@ -795,7 +795,7 @@ export default function scheduledEvent(
);
const subEvents: $TSFixMe =
state.subProjectScheduledEventList.scheduledEvents.map(
subEvent => {
sub(event : $TSFixMe) =>{
if (
String(subEvent.project) ===
String(action.payload.projectId._id)

View File

@ -17,7 +17,7 @@ const initialState: $TSFixMe = {
searchFieldVisible: false,
};
export default function search(state = initialState, action: Action): void {
export default function search(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case SHOW_SEARCH_BAR:
return Object.assign({}, state, {

View File

@ -43,7 +43,7 @@ const initialState: $TSFixMe = {
activeApplicationSecurity: '',
};
export default function security(state = initialState, action: Action): void {
export default function security(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.ADD_CONTAINER_SECURITY_REQUEST:
return {
@ -97,7 +97,7 @@ export default function security(state = initialState, action: Action): void {
const securities: $TSFixMe =
state.containerSecurities.securities.length > 0
? state.containerSecurities.securities.map(
containerSecurity => {
(containerSecurity : $TSFixMe) =>{
if (
String(containerSecurity._id) ===
String(action.payload._id)
@ -192,7 +192,7 @@ export default function security(state = initialState, action: Action): void {
// update the list of container securities
const securities: $TSFixMe =
state.containerSecurities.securities.filter(
containerSecurity => {
(containerSecurity : $TSFixMe) =>{
return (
String(containerSecurity._id) !==
String(action.payload._id)
@ -410,7 +410,7 @@ export default function security(state = initialState, action: Action): void {
const securities: $TSFixMe =
state.applicationSecurities.securities.length > 0
? state.applicationSecurities.securities.map(
applicationSecurity => {
(applicationSecurity : $TSFixMe) =>{
if (
String(applicationSecurity._id) ===
String(action.payload._id)
@ -505,7 +505,7 @@ export default function security(state = initialState, action: Action): void {
// update the list of application securities
const securities: $TSFixMe =
state.applicationSecurities.securities.filter(
applicationSecurity => {
(applicationSecurity : $TSFixMe) =>{
return (
String(applicationSecurity._id) !==
String(action.payload._id)

View File

@ -31,7 +31,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
let teams: $TSFixMe, index: $TSFixMe, count: $TSFixMe;
switch (action.type) {
case GET_SLACK_TEAM_FAILED:

View File

@ -52,7 +52,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
let slacks: $TSFixMe, index: $TSFixMe, count: $TSFixMe;
switch (action.type) {
case GET_SLACK_WEBHOOK_FAILED:

View File

@ -35,7 +35,7 @@ const initialState: $TSFixMe = {
showSmsSmtpConfiguration: false,
};
export default function incident(state = initialState, action: Action): void {
export default function incident(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.SMS_TEMPLATES_SUCCESS:
return Object.assign({}, state, {

View File

@ -42,7 +42,7 @@ const initialState: $TSFixMe = {
activeSubProject: null,
};
export default function subProject(state = initialState, action: Action): void {
export default function subProject(state: $TSFixMe = initialState, action: Action): void {
let subProjects: $TSFixMe, index: $TSFixMe;
switch (action.type) {
case types.SUBPROJECTS_SUCCESS:

View File

@ -40,7 +40,7 @@ const initialState: $TSFixMe = {
},
};
export default function subscriber(state = initialState, action: Action): void {
export default function subscriber(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.CREATE_SUBSCRIBER_RESET:
return Object.assign({}, state, {

View File

@ -64,7 +64,7 @@ const initialState: $TSFixMe = {
pages: {},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case TEAM_LOADING_REQUEST:
return {

View File

@ -35,7 +35,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case FETCH_TUTORIAL_REQUEST:
return Object.assign({}, state, {

View File

@ -19,7 +19,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
switch (action.type) {
case GET_VERSION_FAILED:
return Object.assign({}, state, {

View File

@ -52,7 +52,7 @@ const initialState: $TSFixMe = {
},
};
export default (state = initialState, action: Action): void => {
export default (state: $TSFixMe = initialState, action: Action): void => {
let webHooks: $TSFixMe, index: $TSFixMe, count: $TSFixMe;
switch (action.type) {
case GET_WEB_HOOK_FAILED:

View File

@ -110,7 +110,7 @@ const checkParams: Function = (params: $TSFixMe): void => {
* @return {Promise} The cli param value promise.
*/
const getParamValue: Function = (params, name): void => {
const getParamValue: Function = (params: $TSFixMe, name: $TSFixMe): void => {
const options: $TSFixMe = program.opts();
return new Promise((resolve: $TSFixMe) => {
if (options[name] === true || options[name] === undefined) {

View File

@ -29,7 +29,7 @@ const ping: Function = (
monitorId: $TSFixMe,
apiUrl: URL,
apiKey: string,
interval = '* * * * *',
interval: $TSFixMe = '* * * * *',
simulate: $TSFixMe,
simulateData: $TSFixMe
): void => {

View File

@ -15,7 +15,7 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state = initialState, action: Action): void {
export default function register(state: $TSFixMe = initialState, action: Action): void {
switch (action.type) {
case types.VALIDATE_TOKEN_REQUEST:
return Object.assign({}, state, {