Fix delete logic. Attempt upgrading blueprintjs. Fixes #7, #10, #11, #12

This commit is contained in:
Abhinav Jha 2019-09-23 17:27:55 +05:30
parent 6c34d4a404
commit 2e2f32b1cd
5 changed files with 12 additions and 12 deletions

View File

@ -7,11 +7,11 @@
"npm": "6.9.0"
},
"dependencies": {
"@blueprintjs/core": "^3.11.0",
"@blueprintjs/datetime": "^3.6.0",
"@blueprintjs/icons": "^3.5.0",
"@blueprintjs/core": "^3.18.1",
"@blueprintjs/datetime": "^3.13.0",
"@blueprintjs/icons": "^3.10.0",
"@blueprintjs/select": "^3.10.0",
"@blueprintjs/table": "^3.4.0",
"@blueprintjs/table": "^3.7.1",
"@sentry/browser": "^5.6.3",
"@types/axios": "^0.14.0",
"@types/fontfaceobserver": "^0.0.6",

View File

@ -1,8 +1,7 @@
import { ContentType, EncodingType } from "../constants/ApiConstants";
import { ContentType } from "../constants/ApiConstants";
export interface APIHeaders {
"Content-Type": ContentType;
"Accept-Encoding": EncodingType;
}
export interface APIRequest {

View File

@ -13,7 +13,6 @@ export const BASE_URL = STAGE_BASE_URL;
export const REQUEST_TIMEOUT_MS = 2000;
export const REQUEST_HEADERS: APIHeaders = {
"Content-Type": "application/json",
"Accept-Encoding": "gzip",
};
export interface APIException {

View File

@ -56,9 +56,10 @@ export function* deleteSaga(deleteAction: ReduxAction<WidgetDelete>) {
try {
const { widgetId } = deleteAction.payload;
const widgets = yield select(getWidgets) as any;
widgets[widgetId] = undefined;
delete widgets[widgetId];
const parent = Object.values(widgets).find(
(widget: any) =>
widget &&
widget.children &&
widget.children.length > 0 &&
widget.children.indexOf(widgetId) > -1,
@ -72,6 +73,7 @@ export function* deleteSaga(deleteAction: ReduxAction<WidgetDelete>) {
payload: { widgets },
});
} catch (err) {
console.log(err);
yield put({
type: ReduxActionTypes.WIDGET_OPERATION_ERROR,
action: ReduxActionTypes.WIDGET_DELETE,

View File

@ -894,7 +894,7 @@
lodash "^4.17.13"
to-fast-properties "^2.0.0"
"@blueprintjs/core@^3.11.0", "@blueprintjs/core@^3.18.0", "@blueprintjs/core@^3.18.1":
"@blueprintjs/core@^3.18.0", "@blueprintjs/core@^3.18.1":
version "3.18.1"
resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-3.18.1.tgz#cf180d470710a0e9123fb2449113be06cf0d81ce"
integrity sha512-G+IhJsN006Mb32NLOrne5TLScxyyd3Id9g2MvfYFq9zuyBcBA5+V/uQy3pTO9vkmuKEz0GLLy8ZbrQ7Us/+zTw==
@ -910,7 +910,7 @@
resize-observer-polyfill "^1.5.1"
tslib "~1.9.0"
"@blueprintjs/datetime@^3.6.0":
"@blueprintjs/datetime@^3.13.0":
version "3.13.0"
resolved "https://registry.yarnpkg.com/@blueprintjs/datetime/-/datetime-3.13.0.tgz#ba511a32870b1af82f49d06f8631cfb5995cdcc3"
integrity sha512-0MShc0IJo4rSdhzKkVS+tKGIV9d4ZS/hh4jAtxCsAC7/fBFJ++rUZ+1QpWeRzG9yXi52pNLBXZyx+xxN/Vptsw==
@ -920,7 +920,7 @@
react-day-picker "^7.3.2"
tslib "~1.9.0"
"@blueprintjs/icons@^3.10.0", "@blueprintjs/icons@^3.5.0":
"@blueprintjs/icons@^3.10.0":
version "3.10.0"
resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-3.10.0.tgz#45cdb3ca62110e74bcf9e741237a6b4e2cf2c3a4"
integrity sha512-lyAUpkr3qEStPcJpMnxRKuVAPvaRNSce1ySPbkE58zPmD4WBya2gNrWex41xoqRYM0GsiBSwH9CnpY8t6fZKUA==
@ -937,7 +937,7 @@
classnames "^2.2"
tslib "~1.9.0"
"@blueprintjs/table@^3.4.0":
"@blueprintjs/table@^3.7.1":
version "3.7.1"
resolved "https://registry.yarnpkg.com/@blueprintjs/table/-/table-3.7.1.tgz#3e3e876a2f0b8bebfc26d4bf8350a120614c88aa"
integrity sha512-NSdwjBhhsSTq1lgdRWwsDGavhAbG3j/CH86kmtBaH3msHz3ENjowjeuw1JBryJZLl0raGDV0Ln3kbQ93AKuPXw==