Fix: Organization rename and toast issues (#1954)
* Toast message removed when renaming an organization
This commit is contained in:
parent
29d0c49962
commit
5d820c7203
|
|
@ -22,7 +22,7 @@ describe("Update Application", function() {
|
||||||
cy.get(homePage.appMoreIcon)
|
cy.get(homePage.appMoreIcon)
|
||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(homePage.applicationName).type(appname + "{enter}");
|
cy.get(homePage.applicationName).type(`${appname} updated` + "{enter}");
|
||||||
cy.wait("@updateApplication").should(
|
cy.wait("@updateApplication").should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,9 @@ export const EditableText = (props: EditableTextProps) => {
|
||||||
} else if (changeStarted) {
|
} else if (changeStarted) {
|
||||||
onTextChanged && onTextChanged(_value);
|
onTextChanged && onTextChanged(_value);
|
||||||
}
|
}
|
||||||
|
if (_value !== defaultValue) {
|
||||||
onBlur(_value);
|
onBlur(_value);
|
||||||
|
}
|
||||||
setIsEditing(false);
|
setIsEditing(false);
|
||||||
setChangeStarted(false);
|
setChangeStarted(false);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ export const StyledToastContainer = (props: ToastOptions) => {
|
||||||
|
|
||||||
const ToastBody = styled.div<{
|
const ToastBody = styled.div<{
|
||||||
variant?: Variant;
|
variant?: Variant;
|
||||||
onUndo?: () => void;
|
isUndo?: boolean;
|
||||||
dispatchableAction?: { type: ReduxActionType; payload: any };
|
dispatchableAction?: { type: ReduxActionType; payload: any };
|
||||||
}>`
|
}>`
|
||||||
width: 264px;
|
width: 264px;
|
||||||
|
|
@ -56,6 +56,7 @@ const ToastBody = styled.div<{
|
||||||
${props => props.theme.spaces[5]}px;
|
${props => props.theme.spaces[5]}px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
.${Classes.ICON} {
|
.${Classes.ICON} {
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
|
|
@ -83,9 +84,9 @@ const ToastBody = styled.div<{
|
||||||
}
|
}
|
||||||
|
|
||||||
${props =>
|
${props =>
|
||||||
props.onUndo || props.dispatchableAction
|
props.isUndo || props.dispatchableAction
|
||||||
? `
|
? `
|
||||||
.${Classes.TEXT}:last-child {
|
.undo-section .${Classes.TEXT} {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: ${props.theme.spaces[3]}px;
|
margin-left: ${props.theme.spaces[3]}px;
|
||||||
color: ${props.theme.colors.toast.undo};
|
color: ${props.theme.colors.toast.undo};
|
||||||
|
|
@ -96,16 +97,22 @@ const ToastBody = styled.div<{
|
||||||
: null}
|
: null}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const FlexContainer = styled.div`
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
`;
|
||||||
|
|
||||||
const ToastComponent = (props: ToastProps & { undoAction?: () => void }) => {
|
const ToastComponent = (props: ToastProps & { undoAction?: () => void }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToastBody
|
<ToastBody
|
||||||
variant={props.variant || Variant.info}
|
variant={props.variant || Variant.info}
|
||||||
onUndo={props.onUndo}
|
isUndo={props.onUndo ? true : false}
|
||||||
dispatchableAction={props.dispatchableAction}
|
dispatchableAction={props.dispatchableAction}
|
||||||
className="t--toast-action"
|
className="t--toast-action"
|
||||||
>
|
>
|
||||||
|
<FlexContainer>
|
||||||
{props.variant === Variant.success ? (
|
{props.variant === Variant.success ? (
|
||||||
<Icon name="success" size={IconSize.XXL} />
|
<Icon name="success" size={IconSize.XXL} />
|
||||||
) : props.variant === Variant.warning ? (
|
) : props.variant === Variant.warning ? (
|
||||||
|
|
@ -115,6 +122,8 @@ const ToastComponent = (props: ToastProps & { undoAction?: () => void }) => {
|
||||||
<Icon name="error" size={IconSize.XXL} />
|
<Icon name="error" size={IconSize.XXL} />
|
||||||
) : null}
|
) : null}
|
||||||
<Text type={TextType.P1}>{props.text}</Text>
|
<Text type={TextType.P1}>{props.text}</Text>
|
||||||
|
</FlexContainer>
|
||||||
|
<div className="undo-section">
|
||||||
{props.onUndo || props.dispatchableAction ? (
|
{props.onUndo || props.dispatchableAction ? (
|
||||||
<Text
|
<Text
|
||||||
type={TextType.H6}
|
type={TextType.H6}
|
||||||
|
|
@ -130,6 +139,7 @@ const ToastComponent = (props: ToastProps & { undoAction?: () => void }) => {
|
||||||
UNDO
|
UNDO
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
|
</div>
|
||||||
</ToastBody>
|
</ToastBody>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ import NoSearchImage from "../../assets/images/NoSearchResult.svg";
|
||||||
import { getNextEntityName } from "utils/AppsmithUtils";
|
import { getNextEntityName } from "utils/AppsmithUtils";
|
||||||
import Spinner from "components/ads/Spinner";
|
import Spinner from "components/ads/Spinner";
|
||||||
import ProfileImage from "pages/common/ProfileImage";
|
import ProfileImage from "pages/common/ProfileImage";
|
||||||
import { Toaster } from "components/ads/Toast";
|
|
||||||
|
|
||||||
const OrgDropDown = styled.div`
|
const OrgDropDown = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -465,9 +464,6 @@ const ApplicationsSection = (props: any) => {
|
||||||
const Form: any = OrgInviteUsersForm;
|
const Form: any = OrgInviteUsersForm;
|
||||||
|
|
||||||
const OrgNameChange = (newName: string, orgId: string) => {
|
const OrgNameChange = (newName: string, orgId: string) => {
|
||||||
Toaster.show({
|
|
||||||
text: "Updating organization name...",
|
|
||||||
});
|
|
||||||
dispatch(
|
dispatch(
|
||||||
saveOrg({
|
saveOrg({
|
||||||
id: orgId as string,
|
id: orgId as string,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user