export default createReducer()

in src/views/issue/activity/issue-activity__reducers.ts [104:188]


export default createReducer(initialState, {
  ...attachmentReducers,
  [types.LOADING_ACTIVITY_PAGE]: (
    state: State,
    action: {
      isLoading: boolean;
    },
  ): State => {
    const {isLoading} = action;
    return {...state, isLoading};
  },
  [types.RECEIVE_ACTIVITY_PAGE]: (
    state: State,
    action: {
      activityPage: Activity[];
    },
  ): State => {
    const {activityPage} = action;
    return {...state, activityPage, activitiesLoadingError: null};
  },
  [types.RECEIVE_ACTIVITY_ERROR]: (
    state: State,
    action: {
      error: CustomError;
    },
  ): State => {
    return {...state, activitiesLoadingError: action.error};
  },
  [types.RECEIVE_ACTIVITY_API_AVAILABILITY]: (
    state: State,
    action: Record<string, any>,
  ): State => {
    return {...state, activitiesEnabled: action.activitiesEnabled};
  },
  [types.RECEIVE_ACTIVITY_CATEGORIES]: (
    state: State,
    action: Record<string, any>,
  ): State => {
    return {
      ...state,
      issueActivityTypes: action.issueActivityTypes,
      issueActivityEnabledTypes: action.issueActivityEnabledTypes,
    };
  },
  [types.RECEIVE_WORK_TIME_SETTINGS]: (
    state: State,
    action: {
      workTimeSettings: WorkTimeSettings;
    },
  ): State => {
    return {...state, workTimeSettings: action.workTimeSettings};
  },
  [types.RECEIVE_UPDATED_COMMENT]: (
    state: State,
    action: {
      comment: IssueComment;
    },
  ): State => {
    const {comment} = action;
    const newActivityPage = replaceCommentInActivityPage(
      state.activityPage,
      comment,
    );
    return {...state, activityPage: newActivityPage};
  },
  [types.DELETE_COMMENT]: (
    state: State,
    action: {
      comment: IssueComment;
      activityId: string;
    },
  ): State => {
    const newActivityPage = removeCommentFromActivityPage(
      state.activityPage,
      action.activityId,
    );
    return {...state, activityPage: newActivityPage};
  },
  [types.SET_HELPDESK_DEFAULT_PROJECT_TEAM]: (
    state: State,
    action: {team?: ProjectTeam},
  ): State => {
    return {...state, defaultProjectTeam: action.team};
  },
});