Unverified Commit d4b65528 authored by Eli Yukelzon's avatar Eli Yukelzon Committed by GitHub

No implicit anys (#977)

* removed implicitany
parent 41e409d8
......@@ -23,7 +23,7 @@ clean: pre-run
pre-run:
@echo Make sure no previous build are in the folder
@rm -rf build/* actions client constants reducers selectors store utils types mattermost.client4* index.* mattermost.websocket_client*
@rm -rf build/* action_types actions client constants reducers selectors store utils types mattermost.client4* index.* mattermost.websocket_client*
test: check-style
npm test
......
......@@ -1300,6 +1300,12 @@
"@types/node": "*"
}
},
"@types/shallow-equals": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/shallow-equals/-/shallow-equals-1.0.0.tgz",
"integrity": "sha512-XtGSj7GYPfJwaklDtMEONj+kmpyCP8OLYoPqp/ROM8BL1VaF2IgYbxiEKfLvOyHN7c2d1KAFYzy6EIu8CSFt1A==",
"dev": true
},
"@types/stack-utils": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz",
......@@ -6844,9 +6850,19 @@
"dev": true
},
"serialize-error": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz",
"integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go="
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-5.0.0.tgz",
"integrity": "sha512-/VtpuyzYf82mHYTtI4QKtwHa79vAdU5OQpNPAmE/0UDdlGT0ZxHwC+J6gXkw29wwoVI8fMPsfcVHOwXtUQYYQA==",
"requires": {
"type-fest": "^0.8.0"
},
"dependencies": {
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
}
}
},
"serialize-javascript": {
"version": "1.9.1",
......
......@@ -6,10 +6,11 @@ import {BotTypes} from 'action_types';
import {bindClientFunc} from './helpers';
import {ActionFunc} from 'types/actions';
import {Bot, BotPatch} from 'types/bots';
const BOTS_PER_PAGE_DEFAULT = 20;
export function createBot(bot): ActionFunc {
export function createBot(bot: Bot): ActionFunc {
return bindClientFunc({
clientFunc: Client4.createBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......@@ -19,7 +20,7 @@ export function createBot(bot): ActionFunc {
});
}
export function patchBot(botUserId, botPatch): ActionFunc {
export function patchBot(botUserId: string, botPatch: BotPatch): ActionFunc {
return bindClientFunc({
clientFunc: Client4.patchBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......@@ -30,7 +31,7 @@ export function patchBot(botUserId, botPatch): ActionFunc {
});
}
export function loadBot(botUserId): ActionFunc {
export function loadBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.getBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......@@ -51,7 +52,7 @@ export function loadBots(page = 0, perPage = BOTS_PER_PAGE_DEFAULT): ActionFunc
});
}
export function disableBot(botUserId): ActionFunc {
export function disableBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.disableBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......@@ -61,7 +62,7 @@ export function disableBot(botUserId): ActionFunc {
});
}
export function enableBot(botUserId): ActionFunc {
export function enableBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.enableBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......@@ -71,7 +72,7 @@ export function enableBot(botUserId): ActionFunc {
});
}
export function assignBot(botUserId, newOwnerId): ActionFunc {
export function assignBot(botUserId: string, newOwnerId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.assignBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
......
......@@ -573,7 +573,7 @@ export function getMyChannelMembers(teamId: string): ActionFunc {
export function getChannelMembers(channelId: string, page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
let channelMembers;
let channelMembers: ChannelMembership[];
try {
const channelMembersRequest = Client4.getChannelMembers(channelId, page, perPage);
......
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ErrorTypes} from 'action_types';
import serializeError from 'serialize-error';
import {serializeError, ErrorObject} from 'serialize-error';
import {Client4} from 'client';
import EventEmitter from 'utils/event_emitter';
import {DispatchFunc, ActionFunc} from 'types/actions';
......@@ -22,7 +22,7 @@ export function dismissError(index: number): ActionFunc {
};
}
export function getLogErrorAction(error: serializeError.ErrorObject, displayable = false) {
export function getLogErrorAction(error: ErrorObject, displayable = false) {
return {
type: ErrorTypes.LOG_ERROR,
displayable,
......
......@@ -7,6 +7,7 @@ import {Action, batchActions, DispatchFunc, GetStateFunc, ActionFunc} from 'type
import {logError} from './errors';
import {bindClientFunc, forceLogoutIfNecessary} from './helpers';
import {FileUploadResponse} from 'types/files';
export function getFilesForPost(postId: string): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
......@@ -34,7 +35,7 @@ export function uploadFile(channelId: string, rootId: string, clientIds: Array<s
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
dispatch({type: FileTypes.UPLOAD_FILES_REQUEST, data: {}}, getState);
let files;
let files: FileUploadResponse;
try {
files = await Client4.uploadFile(fileFormData, formBoundary);
} catch (error) {
......
This diff is collapsed.
......@@ -27,7 +27,7 @@ export function linkGroupSyncable(groupID: string, syncableID: string, syncableT
const dispatches: Action[] = [];
let type;
let type = '';
switch (syncableType) {
case Groups.SYNCABLE_TYPE_TEAM:
dispatches.push({type: GroupTypes.RECEIVED_GROUPS_ASSOCIATED_TO_TEAM, data: {teamID: syncableID, groups: [{id: groupID}]}});
......@@ -65,7 +65,7 @@ export function unlinkGroupSyncable(groupID: string, syncableID: string, syncabl
const dispatches: Action[] = [];
let type;
let type = '';
const data = {group_id: groupID, syncable_id: syncableID};
switch (syncableType) {
case Groups.SYNCABLE_TYPE_TEAM:
......@@ -105,7 +105,7 @@ export function getGroupSyncables(groupID: string, syncableType: SyncableType):
return {error};
}
let type;
let type = '';
switch (syncableType) {
case Groups.SYNCABLE_TYPE_TEAM:
type = GroupTypes.RECEIVED_GROUP_TEAMS;
......
......@@ -68,7 +68,7 @@ export function bindClientFunc({
onFailure,
params = [],
}: {
clientFunc: (...args) => Promise<any>;
clientFunc: (...args: any[]) => Promise<any>;
onRequest?: ActionType;
onSuccess?: ActionType | Array<ActionType>;
onFailure?: ActionType;
......@@ -79,7 +79,7 @@ export function bindClientFunc({
dispatch(requestData(onRequest), getState);
}
let data = null;
let data: any = null;
try {
data = await clientFunc(...params);
} catch (error) {
......@@ -107,7 +107,7 @@ export function bindClientFunc({
// Debounce function based on underscores modified to use es6 and a cb
export function debounce(func: (...args: any) => unknown, wait: number, immediate: boolean, cb: () => unknown) {
let timeout;
let timeout: NodeJS.Timeout|null;
return function fx(...args: Array<any>) {
const runLater = () => {
timeout = null;
......
......@@ -8,7 +8,14 @@ import {PluginTypes} from 'action_types';
import {ActionFunc} from 'types/actions';
export function getMarketplacePlugins(filter): ActionFunc {
export type MarketplacePluginFilter = {
Page: number;
PerPage: number;
Filter: string;
ServerVersion: string;
}
export function getMarketplacePlugins(filter: MarketplacePluginFilter): ActionFunc {
return bindClientFunc({
clientFunc: Client4.getMarketplacePlugins,
onSuccess: PluginTypes.RECEIVED_MARKETPLACE_PLUGINS,
......
This diff is collapsed.
......@@ -12,6 +12,7 @@ import {getProfilesAndStatusesForPosts, receivedPosts} from './posts';
import {ActionResult, batchActions, DispatchFunc, GetStateFunc, ActionFunc} from 'types/actions';
import {RelationOneToOne} from 'types/utilities';
import {Post} from 'types/posts';
import {SearchParameter} from 'types/search';
const WEBAPP_SEARCH_PER_PAGE = 20;
export function getMissingChannelsFromPosts(posts: RelationOneToOne<Post, Post>): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
......@@ -36,7 +37,7 @@ export function getMissingChannelsFromPosts(posts: RelationOneToOne<Post, Post>)
};
}
export function searchPostsWithParams(teamId, params): ActionFunc {
export function searchPostsWithParams(teamId: string, params: SearchParameter): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
const isGettingMore = params.page > 0;
dispatch({
......@@ -85,7 +86,7 @@ export function searchPostsWithParams(teamId, params): ActionFunc {
};
}
export function searchPosts(teamId, terms, isOrSearch, includeDeletedChannels) {
export function searchPosts(teamId: string, terms: string, isOrSearch: boolean, includeDeletedChannels: boolean) {
return searchPostsWithParams(teamId, {terms, is_or_search: isOrSearch, include_deleted_channels: includeDeletedChannels, page: 0, per_page: WEBAPP_SEARCH_PER_PAGE});
}
......@@ -147,7 +148,7 @@ export function getFlaggedPosts(): ActionFunc {
};
}
export function getPinnedPosts(channelId): ActionFunc {
export function getPinnedPosts(channelId: string): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
dispatch({type: SearchTypes.SEARCH_PINNED_POSTS_REQUEST});
......@@ -186,7 +187,7 @@ export function getPinnedPosts(channelId): ActionFunc {
};
}
export function clearPinnedPosts(channelId): ActionFunc {
export function clearPinnedPosts(channelId: string): ActionFunc {
return async (dispatch) => {
dispatch({
type: SearchTypes.REMOVE_SEARCH_PINNED_POSTS,
......@@ -245,7 +246,7 @@ export function getRecentMentions(): ActionFunc {
};
}
export function removeSearchTerms(teamId, terms): ActionFunc {
export function removeSearchTerms(teamId: string, terms: string): ActionFunc {
return async (dispatch) => {
dispatch({
type: SearchTypes.REMOVE_SEARCH_TERM,
......
......@@ -13,7 +13,7 @@ import {getCurrentUserId} from 'selectors/entities/users';
import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult, batchActions, Action} from 'types/actions';
import {Team} from 'types/teams';
import {Team, TeamMembership} from 'types/teams';
import {selectChannel} from './channels';
import {logError} from './errors';
......@@ -22,7 +22,7 @@ import {getProfilesByIds, getStatusesByIds} from './users';
import {loadRolesIfNeeded} from './roles';
import {UserProfile} from 'types/users';
async function getProfilesAndStatusesForMembers(userIds, dispatch, getState) {
async function getProfilesAndStatusesForMembers(userIds: string[], dispatch: DispatchFunc, getState: GetStateFunc) {
const {
currentUserId,
profiles,
......@@ -423,7 +423,7 @@ export function addUsersToTeam(teamId: string, userIds: Array<string>): ActionFu
}
const profiles: Partial<UserProfile>[] = [];
members.forEach((m) => profiles.push({id: m.user_id}));
members.forEach((m: TeamMembership) => profiles.push({id: m.user_id}));
dispatch(batchActions([
{
......@@ -495,7 +495,7 @@ export function removeUserFromTeam(teamId: string, userId: string): ActionFunc {
};
}
export function updateTeamMemberRoles(teamId: string, userId: string, roles: string): ActionFunc {
export function updateTeamMemberRoles(teamId: string, userId: string, roles: string[]): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
try {
await Client4.updateTeamMemberRoles(teamId, userId, roles);
......
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from 'types/actions';
import {UserProfile} from 'types/users';
import {UserProfile, UserStatus} from 'types/users';
import {TeamMembership} from 'types/teams';
import {Client4} from 'client';
import {General} from '../constants';
......@@ -21,6 +21,7 @@ import {getCurrentUserId, getUsers} from 'selectors/entities/users';
import {logError} from './errors';
import {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers';
import {getMyPreferences, makeDirectChannelVisibleIfNecessary, makeGroupMessageVisibleIfNecessary} from './preferences';
import {Dictionary} from 'types/utilities';
export function checkMfa(loginId: string): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
dispatch({type: UserTypes.CHECK_MFA_REQUEST, data: null}, getState);
......@@ -314,7 +315,7 @@ export function getMissingProfilesByUsernames(usernames: Array<string>): ActionF
const usernameProfiles = Object.values(profiles).reduce((acc, profile: any) => {
acc[profile.username] = profile;
return acc;
}, {});
}, {} as Dictionary<UserProfile>);
const missingUsernames: string[] = [];
usernames.forEach((username) => {
if (!usernameProfiles[username]) {
......@@ -709,7 +710,7 @@ export function getStatus(userId: string): ActionFunc {
});
}
export function setStatus(status: string): ActionFunc {
export function setStatus(status: UserStatus): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
try {
await Client4.updateStatus(status);
......@@ -961,7 +962,7 @@ export function searchProfiles(term: string, options: any = {}): ActionFunc {
};
}
let statusIntervalId;
let statusIntervalId: NodeJS.Timeout|null;
export function startPeriodicStatusUpdates(): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
if (statusIntervalId) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -11,7 +11,7 @@ export default ((url?: string, options: Options = {headers: {}}) => {
const etag = etags[url!];
const cachedResponse = data[`${url}${etag}`]; // ensure etag is for url
if (etag) {
options.headers['If-None-Match'] = etag;
options.headers!['If-None-Match'] = etag;
}
return fetch(url!, options).
......
......@@ -5,12 +5,12 @@ const MIN_WEBSOCKET_RETRY_TIME = 3000; // 3 sec
const MAX_WEBSOCKET_RETRY_TIME = 300000; // 5 mins
let Socket;
let Socket: any;
class WebSocketClient {
conn?: WebSocket;
connectionUrl: null;
token: null;
token: string|null;
sequence: number;
connectFailCount: number;
eventCallback?: Function;
......@@ -32,7 +32,7 @@ class WebSocketClient {
this.platform = '';
}
initialize(token, opts) {
initialize(token: string|null, opts: any) {
const defaults = {
forceConnection: true,
connectionUrl: this.connectionUrl,
......@@ -182,27 +182,27 @@ class WebSocketClient {
});
}
setConnectingCallback(callback) {
setConnectingCallback(callback: Function) {
this.connectingCallback = callback;
}
setEventCallback(callback) {
setEventCallback(callback: Function) {
this.eventCallback = callback;
}
setFirstConnectCallback(callback) {
setFirstConnectCallback(callback: Function) {
this.firstConnectCallback = callback;
}
setReconnectCallback(callback) {
setReconnectCallback(callback: Function) {
this.reconnectCallback = callback;
}
setErrorCallback(callback) {
setErrorCallback(callback: Function) {
this.errorCallback = callback;
}
setCloseCallback(callback) {
setCloseCallback(callback: Function) {
this.closeCallback = callback;
}
......@@ -218,7 +218,7 @@ class WebSocketClient {
}
}
sendMessage(action, data) {
sendMessage(action: string, data: any) {
const msg = {
action,
seq: this.sequence++,
......@@ -233,7 +233,7 @@ class WebSocketClient {
}
}
userTyping(channelId, parentId) {
userTyping(channelId: string, parentId: string) {
this.sendMessage('user_typing', {
channel_id: channelId,
parent_id: parentId,
......@@ -244,7 +244,7 @@ class WebSocketClient {
this.sendMessage('get_statuses', null);
}
getStatusesByIds(userIds) {
getStatusesByIds(userIds: string[]) {
this.sendMessage('get_statuses_by_ids', {
user_ids: userIds,
});
......
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export default {
import {Dictionary} from 'types/utilities';
const Files: Dictionary<string[]> = {
AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac', 'ogg'],
CODE_TYPES: ['as', 'applescript', 'osascript', 'scpt', 'bash', 'sh', 'zsh', 'clj', 'boot', 'cl2', 'cljc', 'cljs', 'cljs.hl', 'cljscm', 'cljx', 'hic', 'coffee', '_coffee', 'cake', 'cjsx', 'cson', 'iced', 'cpp', 'c', 'cc', 'h', 'c++', 'h++', 'hpp', 'cs', 'csharp', 'css', 'd', 'di', 'dart', 'delphi', 'dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm', 'diff', 'django', 'jinja', 'dockerfile', 'docker', 'erl', 'f90', 'f95', 'fsharp', 'fs', 'gcode', 'nc', 'go', 'groovy', 'handlebars', 'hbs', 'html.hbs', 'html.handlebars', 'hs', 'hx', 'java', 'jsp', 'js', 'jsx', 'json', 'jl', 'kt', 'ktm', 'kts', 'less', 'lisp', 'lua', 'mk', 'mak', 'md', 'mkdown', 'mkd', 'matlab', 'm', 'mm', 'objc', 'obj-c', 'ml', 'perl', 'pl', 'php', 'php3', 'php4', 'php5', 'php6', 'ps', 'ps1', 'pp', 'py', 'gyp', 'r', 'ruby', 'rb', 'gemspec', 'podspec', 'thor', 'irb', 'rs', 'scala', 'scm', 'sld', 'scss', 'st', 'sql', 'swift', 'tex', 'txt', 'vbnet', 'vb', 'bas', 'vbs', 'v', 'veo', 'xml', 'html', 'xhtml', 'rss', 'atom', 'xsl', 'plist', 'yaml'],
IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png', 'jpeg', 'tiff', 'tif'],
......@@ -11,3 +14,5 @@ export default {
VIDEO_TYPES: ['mp4', 'avi', 'webm', 'mkv', 'wmv', 'mpg', 'mov', 'flv'],
WORD_TYPES: ['doc', 'docx'],
};
export default Files;
\ No newline at end of file
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export default {
import {Dictionary} from 'types/utilities';
const Preferences: Dictionary<any> = {
CATEGORY_CHANNEL_OPEN_TIME: 'channel_open_time',
CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME: 'channel_approximate_view_time',
CATEGORY_DIRECT_CHANNEL_SHOW: 'direct_channel_show',
......@@ -145,3 +148,5 @@ export default {
},
},
};
export default Preferences;
\ No newline at end of file
......@@ -5,8 +5,9 @@ import {combineReducers} from 'redux';
import {AdminTypes, UserTypes} from 'action_types';
import {Stats, Plugins} from '../../constants';
import PluginState from '../../constants/plugins';
import {GenericAction} from 'types/actions';
function logs(state = [], action) {
function logs(state = [], action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_LOGS: {
return action.data;
......@@ -19,7 +20,7 @@ function logs(state = [], action) {
}
}
function audits(state = {}, action) {
function audits(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_AUDITS: {
const nextState = {...state};
......@@ -36,7 +37,7 @@ function audits(state = {}, action) {
}
}
function config(state: any = {}, action) {
function config(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_CONFIG: {
return action.data;
......@@ -63,7 +64,7 @@ function config(state: any = {}, action) {
}
}
function environmentConfig(state = {}, action) {
function environmentConfig(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_ENVIRONMENT_CONFIG: {
return action.data;
......@@ -76,7 +77,7 @@ function environmentConfig(state = {}, action) {
}
}
function complianceReports(state = {}, action) {
function complianceReports(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_COMPLIANCE_REPORT: {
const nextState = {...state};
......@@ -98,7 +99,7 @@ function complianceReports(state = {}, action) {
}
}
function clusterInfo(state = [], action) {
function clusterInfo(state = [], action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_CLUSTER_STATUS: {
return action.data;
......@@ -111,7 +112,7 @@ function clusterInfo(state = [], action) {
}
}
function samlCertStatus(state = {}, action) {
function samlCertStatus(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_SAML_CERT_STATUS: {
return action.data;
......@@ -124,8 +125,8 @@ function samlCertStatus(state = {}, action) {
}
}
export function convertAnalyticsRowsToStats(data, name) {
const stats = {};
export function convertAnalyticsRowsToStats(data: any, name: string) {
const stats: any = {};
const clonedData = [...data];
if (name === 'post_counts_day') {
......@@ -210,7 +211,7 @@ export function convertAnalyticsRowsToStats(data, name) {
return stats;
}
function analytics(state = {}, action) {
function analytics(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_SYSTEM_ANALYTICS: {
const stats = convertAnalyticsRowsToStats(action.data, action.name);
......@@ -224,7 +225,7 @@ function analytics(state = {}, action) {
}
}
function teamAnalytics(state = {}, action) {
function teamAnalytics(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_TEAM_ANALYTICS: {
const nextState = {...state};
......@@ -241,13 +242,13 @@ function teamAnalytics(state = {}, action) {
}
}
function userAccessTokens(state = {}, action) {
function userAccessTokens(state: any = {}, action: GenericAction) {
switch (action.type) {
case AdminTypes.RECEIVED_USER_ACCESS_TOKEN: {
return {...state, [action.data.id]: action.data};
}
case AdminTypes.RECEIVED_USER_ACCESS_TOKENS_FOR_USER: {
const nextState = {};
const nextState: any = {};
for (const uat of action.data) {