From 235273d1e3e26ad5fd393adb6c6546b6f16a76fd Mon Sep 17 00:00:00 2001 From: Abhinav Jha Date: Fri, 31 Jan 2020 10:46:43 +0000 Subject: [PATCH] P1 issues --- .../editorComponents/ResizableUtils.tsx | 10 +++---- .../ActionSelectorControl.tsx | 1 - .../ColumnActionSelectorControl.tsx | 1 - app/client/src/constants/routes.ts | 1 + app/client/src/index.tsx | 3 ++ app/client/src/pages/Editor/EditorHeader.tsx | 2 +- .../CustomizedDropdown/OrgDropdownData.tsx | 4 +-- app/client/src/pages/organization/index.tsx | 2 -- .../src/pages/organization/settings.tsx | 19 +----------- app/client/src/pages/organization/users.tsx | 27 +++++++++++++++++ app/client/src/pages/users/index.tsx | 29 +++++++++++++++++-- .../entityReducers/canvasWidgetsReducer.tsx | 1 - app/client/src/sagas/PageSagas.tsx | 5 ++-- 13 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 app/client/src/pages/organization/users.tsx diff --git a/app/client/src/components/editorComponents/ResizableUtils.tsx b/app/client/src/components/editorComponents/ResizableUtils.tsx index 32090e08d1..7605791a84 100644 --- a/app/client/src/components/editorComponents/ResizableUtils.tsx +++ b/app/client/src/components/editorComponents/ResizableUtils.tsx @@ -119,16 +119,16 @@ export const hasCollision = ( props.rightColumn + (delta.width + position.x) / props.parentColumnSpace; const bottom = props.bottomRow + (delta.height + position.y) / props.parentRowSpace; - if (maxBottomRow && bottom - top - 1 < maxBottomRow) { return true; } + return isDropZoneOccupied( { - left, - top, - bottom, - right, + left: Math.round(left), + top: Math.round(top), + bottom: Math.round(bottom), + right: Math.round(right), }, props.widgetId, occupiedSpaces, diff --git a/app/client/src/components/propertyControls/ActionSelectorControl.tsx b/app/client/src/components/propertyControls/ActionSelectorControl.tsx index d82dfb6e17..2eb1756daa 100644 --- a/app/client/src/components/propertyControls/ActionSelectorControl.tsx +++ b/app/client/src/components/propertyControls/ActionSelectorControl.tsx @@ -10,7 +10,6 @@ import { import { DropdownOption } from "widgets/DropdownWidget"; import { connect } from "react-redux"; import { AppState } from "reducers"; -import { ActionDataState } from "reducers/entityReducers/actionsReducer"; import styled from "styled-components"; import ActionSelector from "./ActionSelector"; import { RestAction } from "api/ActionAPI"; diff --git a/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx b/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx index 1438091bca..09358a0a12 100644 --- a/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx +++ b/app/client/src/components/propertyControls/ColumnActionSelectorControl.tsx @@ -4,7 +4,6 @@ import BaseControl, { ControlProps } from "./BaseControl"; import { ControlWrapper, StyledPropertyPaneButton } from "./StyledControls"; import { ControlType } from "constants/PropertyControlConstants"; import { AppState } from "reducers"; -import { ActionDataState } from "reducers/entityReducers/actionsReducer"; import { connect } from "react-redux"; import { ActionPayload } from "constants/ActionConstants"; import { FinalActionSelector } from "./ActionSelectorControl"; diff --git a/app/client/src/constants/routes.ts b/app/client/src/constants/routes.ts index 9221364853..fa89fef516 100644 --- a/app/client/src/constants/routes.ts +++ b/app/client/src/constants/routes.ts @@ -4,6 +4,7 @@ export const ORG_URL = "/org"; export const APPLICATIONS_URL = `/applications`; export const BUILDER_URL = "/applications/:applicationId/pages/:pageId/edit"; export const USER_AUTH_URL = "/user"; +export const USERS_URL = "/users"; export type BuilderRouteParams = { applicationId: string; diff --git a/app/client/src/index.tsx b/app/client/src/index.tsx index 0c4858e90f..b0cb55caa5 100755 --- a/app/client/src/index.tsx +++ b/app/client/src/index.tsx @@ -25,6 +25,7 @@ import { SIGN_UP_URL, BASE_LOGIN_URL, BASE_SIGNUP_URL, + USERS_URL, } from "constants/routes"; const loadingIndicator = ; @@ -35,6 +36,7 @@ const Applications = lazy(() => import("./pages/Applications")); const PageNotFound = lazy(() => import("./pages/common/PageNotFound")); const AppViewer = lazy(() => import("./pages/AppViewer")); const Organization = lazy(() => import("./pages/organization")); +const Users = lazy(() => import("./pages/users")); appInitializer(); @@ -56,6 +58,7 @@ ReactDOM.render( + diff --git a/app/client/src/pages/Editor/EditorHeader.tsx b/app/client/src/pages/Editor/EditorHeader.tsx index 21f53b0f10..e45fcbd831 100644 --- a/app/client/src/pages/Editor/EditorHeader.tsx +++ b/app/client/src/pages/Editor/EditorHeader.tsx @@ -126,7 +126,7 @@ export const EditorHeader = (props: EditorHeaderProps) => { return ( - + {props.isSaving ? "Saving..." : "All changes saved"} diff --git a/app/client/src/pages/common/CustomizedDropdown/OrgDropdownData.tsx b/app/client/src/pages/common/CustomizedDropdown/OrgDropdownData.tsx index 28b3553362..8e9175ddb7 100644 --- a/app/client/src/pages/common/CustomizedDropdown/OrgDropdownData.tsx +++ b/app/client/src/pages/common/CustomizedDropdown/OrgDropdownData.tsx @@ -78,9 +78,9 @@ export const options = ( content: "Members", onSelect: () => getOnSelectAction(DropdownOnSelectActions.REDIRECT, { - path: "/org/users", + path: "/users", }), - active: history.location.pathname === "/org/users", + active: history.location.pathname === "/users", }, ], }, diff --git a/app/client/src/pages/organization/index.tsx b/app/client/src/pages/organization/index.tsx index 95819ba3e6..c197cd7034 100644 --- a/app/client/src/pages/organization/index.tsx +++ b/app/client/src/pages/organization/index.tsx @@ -2,7 +2,6 @@ import React from "react"; import { Switch, Route, useRouteMatch, useLocation } from "react-router-dom"; import { TransitionGroup, CSSTransition } from "react-transition-group"; import PageWrapper from "pages/common/PageWrapper"; -import Users from "pages/users"; import Settings from "./settings"; import Invite from "./invite"; import DefaultOrgPage from "./defaultOrgPage"; @@ -15,7 +14,6 @@ export const Organization = () => { - diff --git a/app/client/src/pages/organization/settings.tsx b/app/client/src/pages/organization/settings.tsx index a1cbb3feb0..15124c2fa7 100644 --- a/app/client/src/pages/organization/settings.tsx +++ b/app/client/src/pages/organization/settings.tsx @@ -4,7 +4,6 @@ import { useHistory } from "react-router-dom"; import { AppState } from "reducers"; import { getCurrentOrg } from "selectors/organizationSelectors"; import { ORG_INVITE_USERS_PAGE_URL } from "constants/routes"; -import EditableText from "components/editorComponents/EditableText"; import PageSectionDivider from "pages/common/PageSectionDivider"; import PageSectionHeader from "pages/common/PageSectionHeader"; import { ReduxActionTypes } from "constants/ReduxActionConstants"; @@ -17,28 +16,12 @@ export type PageProps = { }; export const OrgSettings = (props: PageProps) => { - const changeOrgName = (value: string) => { - if (props.org && value.trim().length > 0 && value !== props.org.name) { - props.changeOrgName(value); - } - }; - const history = useHistory(); return ( -

- {props.org && ( - - )} -

+ {props.org &&

{props.org.name}

}
diff --git a/app/client/src/pages/organization/users.tsx b/app/client/src/pages/organization/users.tsx new file mode 100644 index 0000000000..2feed942c8 --- /dev/null +++ b/app/client/src/pages/organization/users.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import { useHistory } from "react-router-dom"; +import { ORG_INVITE_USERS_PAGE_URL } from "constants/routes"; +import PageSectionHeader from "pages/common/PageSectionHeader"; +import Button from "components/editorComponents/Button"; + +export const OrgMembers = () => { + const history = useHistory(); + + return ( + + +

Users

+