فهرست منبع

Merge pull request #2408 from porter-dev/hotfix-case-insensitive-invites

Hotfix case insensitive invites
jusrhee 3 سال پیش
والد
کامیت
84e9211600

+ 5 - 1
dashboard/babel.config.json

@@ -1,5 +1,9 @@
 {
 {
-  "plugins": ["lodash", "babel-plugin-styled-components", "@babel/plugin-syntax-dynamic-import"],
+  "plugins": [
+    "lodash",
+    "babel-plugin-styled-components",
+    "@babel/plugin-syntax-dynamic-import"
+  ],
   "presets": [
   "presets": [
     "@babel/preset-env",
     "@babel/preset-env",
     "@babel/preset-react",
     "@babel/preset-react",

+ 2 - 2
dashboard/src/main/home/modals/EditInviteOrCollaboratorModal.tsx

@@ -89,7 +89,7 @@ const EditCollaboratorModal = () => {
   return (
   return (
     <>
     <>
       <ModalTitle>
       <ModalTitle>
-        Update {isInvite ? "Invite for" : "Collaborator"} {user?.email}
+        Update {isInvite ? "invite for" : "collaborator"} {user?.email}
       </ModalTitle>
       </ModalTitle>
       <Subtitle>Specify a different role for this user.</Subtitle>
       <Subtitle>Specify a different role for this user.</Subtitle>
       <RoleSelectorWrapper>
       <RoleSelectorWrapper>
@@ -101,7 +101,7 @@ const EditCollaboratorModal = () => {
       </RoleSelectorWrapper>
       </RoleSelectorWrapper>
 
 
       <SaveButton
       <SaveButton
-        text={`Update ${isInvite ? "Invite" : "Collaborator"}`}
+        text={`Update ${isInvite ? "invite" : "collaborator"}`}
         color="#616FEEcc"
         color="#616FEEcc"
         onClick={() => handleUpdate()}
         onClick={() => handleUpdate()}
         status={status}
         status={status}

+ 9 - 5
dashboard/src/main/home/project-settings/InviteList.tsx

@@ -119,7 +119,11 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
 
 
   const createInvite = () => {
   const createInvite = () => {
     api
     api
-      .createInvite("<token>", { email, kind: role }, { id: currentProject.id })
+      .createInvite(
+        "<token>",
+        { email: email.toLowerCase(), kind: role },
+        { id: currentProject.id }
+      )
       .then(() => {
       .then(() => {
         getData();
         getData();
         setEmail("");
         setEmail("");
@@ -395,7 +399,7 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
   return (
   return (
     <>
     <>
       <>
       <>
-        <Heading isAtTop={true}>Share Project</Heading>
+        <Heading isAtTop={true}>Share project</Heading>
         <Helper>Generate a project invite for another user.</Helper>
         <Helper>Generate a project invite for another user.</Helper>
         <InputRowWrapper>
         <InputRowWrapper>
           <InputRow
           <InputRow
@@ -403,7 +407,7 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
             type="text"
             type="text"
             setValue={(newEmail: string) => setEmail(newEmail)}
             setValue={(newEmail: string) => setEmail(newEmail)}
             width="100%"
             width="100%"
-            placeholder="ex: mrp@getporter.dev"
+            placeholder="ex: mrp@porter.run"
           />
           />
         </InputRowWrapper>
         </InputRowWrapper>
         <Helper>Specify a role for this user.</Helper>
         <Helper>Specify a role for this user.</Helper>
@@ -416,7 +420,7 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
         </RoleSelectorWrapper>
         </RoleSelectorWrapper>
         <ButtonWrapper>
         <ButtonWrapper>
           <InviteButton disabled={!hasSeats} onClick={() => validateEmail()}>
           <InviteButton disabled={!hasSeats} onClick={() => validateEmail()}>
-            Create Invite
+            Create invite
           </InviteButton>
           </InviteButton>
           {isInvalidEmail && (
           {isInvalidEmail && (
             <Invalid>Invalid email address. Please try again.</Invalid>
             <Invalid>Invalid email address. Please try again.</Invalid>
@@ -429,7 +433,7 @@ const InvitePage: React.FunctionComponent<Props> = ({}) => {
         </ButtonWrapper>
         </ButtonWrapper>
       </>
       </>
 
 
-      <Heading>Invites & Collaborators</Heading>
+      <Heading>Invites & collaborators</Heading>
       <Helper>Manage pending invites and view collaborators.</Helper>
       <Helper>Manage pending invites and view collaborators.</Helper>
       {isLoading && <Loading height={"30%"} />}
       {isLoading && <Loading height={"30%"} />}
       {data?.length && !isLoading ? (
       {data?.length && !isLoading ? (

+ 5 - 5
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -64,7 +64,7 @@ class ProjectSettings extends Component<PropsType, StateType> {
     let { currentProject } = this.context;
     let { currentProject } = this.context;
     this.setState({ projectName: currentProject.name });
     this.setState({ projectName: currentProject.name });
     const tabOptions = [];
     const tabOptions = [];
-    tabOptions.push({ value: "manage-access", label: "Manage Access" });
+    tabOptions.push({ value: "manage-access", label: "Manage access" });
     tabOptions.push({
     tabOptions.push({
       value: "billing",
       value: "billing",
       label: "Billing",
       label: "Billing",
@@ -87,7 +87,7 @@ class ProjectSettings extends Component<PropsType, StateType> {
 
 
       tabOptions.push({
       tabOptions.push({
         value: "additional-settings",
         value: "additional-settings",
-        label: "Additional Settings",
+        label: "Additional settings",
       });
       });
     }
     }
 
 
@@ -132,7 +132,7 @@ class ProjectSettings extends Component<PropsType, StateType> {
     } else {
     } else {
       return (
       return (
         <>
         <>
-          <Heading isAtTop={true}>Delete Project</Heading>
+          <Heading isAtTop={true}>Delete project</Heading>
           <Helper>
           <Helper>
             Permanently delete this project. This will destroy all clusters tied
             Permanently delete this project. This will destroy all clusters tied
             to this project that have been provisioned by Porter. Note that this
             to this project that have been provisioned by Porter. Note that this
@@ -164,7 +164,7 @@ class ProjectSettings extends Component<PropsType, StateType> {
               });
               });
             }}
             }}
           >
           >
-            Delete Project
+            Delete project
           </DeleteButton>
           </DeleteButton>
         </>
         </>
       );
       );
@@ -174,7 +174,7 @@ class ProjectSettings extends Component<PropsType, StateType> {
   render() {
   render() {
     return (
     return (
       <StyledProjectSettings>
       <StyledProjectSettings>
-        <TitleSection>Project Settings</TitleSection>
+        <TitleSection>Project settings</TitleSection>
         <TabRegion
         <TabRegion
           currentTab={this.state.currentTab}
           currentTab={this.state.currentTab}
           setCurrentTab={(x: string) => this.setState({ currentTab: x })}
           setCurrentTab={(x: string) => this.setState({ currentTab: x })}

+ 1 - 1
dashboard/src/main/home/sidebar/Clusters.tsx

@@ -204,4 +204,4 @@ const InitializeButton = styled.div`
   :hover {
   :hover {
     background: #ffffff22;
     background: #ffffff22;
   }
   }
-`;
+`;