mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
eslint fix
This commit is contained in:
parent
fa4d51360b
commit
5fb3445741
6 changed files with 9248 additions and 18023 deletions
17999
package-lock.json
generated
17999
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,20 +1,13 @@
|
||||||
import React, {
|
import React, {
|
||||||
FC,
|
FC,
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useState,
|
|
||||||
ChangeEventHandler,
|
ChangeEventHandler,
|
||||||
DragEventHandler
|
DragEventHandler
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import uuid from 'uuid4';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import assocPath from 'ramda/es/assocPath';
|
import { INode } from '~/redux/types';
|
||||||
import append from 'ramda/es/append';
|
|
||||||
import { INode, IFileWithUUID, IFile } from '~/redux/types';
|
|
||||||
import * as UPLOAD_ACTIONS from '~/redux/uploads/actions';
|
import * as UPLOAD_ACTIONS from '~/redux/uploads/actions';
|
||||||
import { selectUploads } from '~/redux/uploads/selectors';
|
import { selectUploads } from '~/redux/uploads/selectors';
|
||||||
import { ImageGrid } from '~/components/editors/ImageGrid';
|
import { ImageGrid } from '~/components/editors/ImageGrid';
|
||||||
import { moveArrItem } from '~/utils/fn';
|
|
||||||
import { IUploadStatus } from '~/redux/uploads/reducer';
|
import { IUploadStatus } from '~/redux/uploads/reducer';
|
||||||
|
|
||||||
const mapStateToProps = selectUploads;
|
const mapStateToProps = selectUploads;
|
||||||
|
|
|
@ -11,7 +11,7 @@ export const UPLOAD_ACTIONS = {
|
||||||
DROP_STATUS: `${prefix}DROP_STATUS`,
|
DROP_STATUS: `${prefix}DROP_STATUS`,
|
||||||
SET_STATUS: `${prefix}SET_STATUS`,
|
SET_STATUS: `${prefix}SET_STATUS`,
|
||||||
|
|
||||||
ADD_FILE: `${prefix}ADD_FILE`,
|
ADD_FILE: `${prefix}ADD_FILE`
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EMPTY_FILE: IFile = {
|
export const EMPTY_FILE: IFile = {
|
||||||
|
@ -25,7 +25,7 @@ export const EMPTY_FILE: IFile = {
|
||||||
url: 'https://cdn.arstechnica.net/wp-content/uploads/2017/09/mario-collage-800x450.jpg',
|
url: 'https://cdn.arstechnica.net/wp-content/uploads/2017/09/mario-collage-800x450.jpg',
|
||||||
size: 2400000,
|
size: 2400000,
|
||||||
type: 'image',
|
type: 'image',
|
||||||
mime: 'image/jpeg',
|
mime: 'image/jpeg'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EMPTY_UPLOAD_STATUS: IUploadStatus = {
|
export const EMPTY_UPLOAD_STATUS: IUploadStatus = {
|
||||||
|
@ -37,5 +37,5 @@ export const EMPTY_UPLOAD_STATUS: IUploadStatus = {
|
||||||
progress: 0,
|
progress: 0,
|
||||||
thumbnail_url: null,
|
thumbnail_url: null,
|
||||||
type: null,
|
type: null,
|
||||||
temp_id: null,
|
temp_id: null
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import {
|
import { takeEvery, all, spawn, call, put, take, fork, race } from 'redux-saga/effects';
|
||||||
takeEvery, all, spawn, call, put, take, fork, race
|
|
||||||
} from 'redux-saga/effects';
|
|
||||||
import { UPLOAD_ACTIONS } from '~/redux/uploads/constants';
|
import { UPLOAD_ACTIONS } from '~/redux/uploads/constants';
|
||||||
import {
|
import {
|
||||||
uploadUploadFiles, uploadSetStatus, uploadAddStatus, uploadDropStatus, uploadAddFile
|
uploadUploadFiles, uploadSetStatus, uploadAddStatus, uploadDropStatus, uploadAddFile
|
||||||
|
|
|
@ -23,22 +23,22 @@ export const HTTP_RESPONSES = {
|
||||||
TOO_MANY_REQUESTS: 429,
|
TOO_MANY_REQUESTS: 429,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const resultMiddleware = (<)T extends {}>({
|
export const resultMiddleware = (<T extends {}>({
|
||||||
status,
|
status,
|
||||||
data,
|
data,
|
||||||
}: {
|
}: {
|
||||||
status: number;
|
status: number;
|
||||||
data: T;
|
data: T;
|
||||||
}): { status: number; data: T } => data && { status, data };
|
}): { status: number; data: T } => ({ status, data }));
|
||||||
|
|
||||||
export const errorMiddleware = <T extends any>(debug): IResultWithStatus<T> => debug && debug.response
|
export const errorMiddleware = <T extends any>(debug): IResultWithStatus<T> => (debug && debug.response
|
||||||
? debug.response
|
? debug.response
|
||||||
: {
|
: {
|
||||||
status: HTTP_RESPONSES.CONNECTION_REFUSED,
|
status: HTTP_RESPONSES.CONNECTION_REFUSED,
|
||||||
data: {},
|
data: {},
|
||||||
debug,
|
debug,
|
||||||
error: 'Ошибка сети',
|
error: 'Ошибка сети',
|
||||||
};
|
});
|
||||||
|
|
||||||
export const configWithToken = (
|
export const configWithToken = (
|
||||||
access: string,
|
access: string,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue