Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into release/2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Aug 11, 2023
2 parents b22d167 + 8d53287 commit 2d68f58
Show file tree
Hide file tree
Showing 484 changed files with 11,953 additions and 9,029 deletions.
77 changes: 40 additions & 37 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"jasmine": true
'env': {
'browser': true,
'es6': true,
'jasmine': true
},
"globals": {
"$": true,
"sectionNames": "readonly",
'globals': {
'$': true,
'sectionNames': 'readonly',
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
'extends': ['eslint:recommended', 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended'],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaFeatures': {
'experimentalObjectRestSpread': true,
'jsx': true
},
"sourceType": "module"
'sourceType': 'module'
},
"plugins": [
"react"
'plugins': [
'react',
'@typescript-eslint',
],
"rules": {
"indent": [
"error",
'rules': {
'@typescript-eslint/no-explicit-any': 0,
'indent': [
'error',
4
],
"linebreak-style": [
"error",
"unix"
'linebreak-style': [
'error',
'unix'
],
"quotes": [
"error",
"single"
'quotes': [
'error',
'single'
],
"semi": [
"error",
"always"
'semi': [
'error',
'always'
],
"no-console": [
"error",
{"allow": ["warn", "error"]}
'no-console': [
'error',
{'allow': ['warn', 'error']}
],
"object-curly-spacing": ["error", "never"],
"react/no-deprecated": [
'object-curly-spacing': ['error', 'never'],
'react/no-deprecated': [
1,
],
"react/jsx-no-target-blank": [
'react/jsx-no-target-blank': [
0,
],
"react/display-name": [0]
'react/display-name': [0]
},
"settings": {
"react": {
"version": "16.2"
'settings': {
'react': {
'version': '16.2'
}
}
};
32 changes: 19 additions & 13 deletions assets/actions.js → assets/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {get, differenceBy} from 'lodash';
import server from 'server';

export const RENDER_MODAL = 'RENDER_MODAL';
export function renderModal(modal, data) {
export function renderModal(modal: any, data: any) {
return {type: RENDER_MODAL, modal, data};
}

Expand All @@ -11,19 +11,25 @@ export function closeModal() {
return {type: CLOSE_MODAL};
}

export const SET_USER = 'SET_USER';
export function setUser(user: any) {
return {type: SET_USER, data: user};
}


export const SAVED_ITEMS_COUNT = 'SAVED_ITEMS_COUNT';
export function setSavedItemsCount(count) {
export function setSavedItemsCount(count: any) {
return {type: SAVED_ITEMS_COUNT, count: count};
}

export const SET_UI_CONFIG = 'SET_UI_CONFIG';
export function setUiConfig(config) {
export function setUiConfig(config: any) {
return {type: SET_UI_CONFIG, config: config};
}

export const MODAL_FORM_VALID = 'MODAL_FORM_VALID';
export function modalFormValid() {
return (dispatch, getState) => {
return (dispatch: any, getState: any) => {
if (!get(getState(), 'modal.formValid')) {
dispatch({type: MODAL_FORM_VALID});
}
Expand All @@ -34,7 +40,7 @@ export function modalFormValid() {

export const MODAL_FORM_INVALID = 'MODAL_FORM_INVALID';
export function modalFormInvalid() {
return (dispatch, getState) => {
return (dispatch: any, getState: any) => {
if (get(getState(), 'modal.formValid')) {
dispatch({type: MODAL_FORM_INVALID});
}
Expand All @@ -49,30 +55,30 @@ export function userProfileClosed() {
}

export const ADD_EDIT_USERS = 'ADD_EDIT_USERS';
export function getEditUsers(item) {
return function (dispatch, getState) {
export function getEditUsers(item: any) {
return function (dispatch: any, getState: any) {
let findUsers = [];
const itemUsers = ([
item.original_creator,
item.version_creator
].filter((u) => u));
].filter((u: any) => u));
const editUsers = getState().editUsers || [];

if (!get(item, 'version_creator') && !get(item, 'original_creator')) {
return Promise.resolve();
}
findUsers = differenceBy(editUsers, itemUsers.map((u) => ({'_id': u})), '_id');

findUsers = differenceBy(editUsers, itemUsers.map((u: any) => ({'_id': u})), '_id');
if (editUsers.length === 0 || findUsers.length > 0) {
return server.get(`/users/search?ids=${itemUsers.join(',')}`)
.then((data) => {
.then((data: any) => {
dispatch({
type: ADD_EDIT_USERS,
data
});
});
});
}

return Promise.resolve();
};
};
}
Loading

0 comments on commit 2d68f58

Please sign in to comment.