Skip to content

Commit afd88bf

Browse files
feat(onboarding-ui): Create Cloud Workspace Form (#499)
* new translations * Form * Move List and ListItem to common * Fix subtitle, more translations * Create page * Update list * New icon * Loki * new input * Fix type * Fix domain * Fix loki * Fix review Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
1 parent 99b873e commit afd88bf

File tree

39 files changed

+536
-15
lines changed

39 files changed

+536
-15
lines changed

packages/onboarding-ui/.i18n/en.i18n.json

+41-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"back": "Back",
77
"next": "Next"
88
},
9-
"requiredField": "This field is required"
9+
"requiredField": "This field is required",
10+
"termsAndConditions": "I agree with <1>Terms and Conditions</1> and <3>Privacy Policy</3>"
1011
}
1112
},
1213
"page": {
@@ -25,6 +26,18 @@
2526
"confirmationProcess": {
2627
"title": "Confirmation in Process"
2728
},
29+
"cloudDescription": {
30+
"tryGold": "Try our best Gold plan for 14 days for free",
31+
"availability": "High availability",
32+
"auditing": "Message audit panel / Audit logs",
33+
"integrations": "1,000 integrations",
34+
"ldap": "LDAP enhanced sync",
35+
"omnichannel": "Omnichannel premium",
36+
"sla": "SLA: Premium",
37+
"push": "Secured push notifications",
38+
"goldIncludes": "* Golden plan includes all features from other plans"
39+
},
40+
"alreadyHaveAccount": "Already have an account? <1>Manage your workspaces.</1>",
2841
"invalidLink": {
2942
"title": "Your Link is no Longer Valid",
3043
"content": "Seems like you have already used invite link. It’s generated for a single sign in. Request a new one to join your workspace.",
@@ -102,8 +115,7 @@
102115
"oAuth": "OAuth proxy for social network",
103116
"apps": "Apps Marketplace"
104117
},
105-
"includeUpdates": "Include product and security updates",
106-
"agreement": "I agree with <1>Terms and Conditions</1> and <3>Privacy Policy</3>"
118+
"includeUpdates": "Include product and security updates"
107119
},
108120
"standalone": {
109121
"title": "Standalone server",
@@ -115,6 +127,32 @@
115127
}
116128
}
117129
},
130+
"createCloudWorkspace": {
131+
"title": "Create Cloud Workspace",
132+
"fields": {
133+
"orgName": "Organization name",
134+
"orgEmail": {
135+
"label": "Organization email",
136+
"placeholder": "Email",
137+
"invalid": "Invalid email"
138+
},
139+
"workspaceName": {
140+
"label": "Workspace name",
141+
"tooltip": "How should be a good Workspace name"
142+
},
143+
"workspaceUrl": {
144+
"label": "Workspace URL",
145+
"placeholder": "workspaceurl",
146+
"tooltip": "URL of your Workspace",
147+
"exists": "Workspace already exists"
148+
},
149+
"serverRegion": {
150+
"label": "Server region",
151+
"tooltip": "Where is your server located"
152+
},
153+
"keepMePosted": "Keep me posted about Rocket.Chat updates"
154+
}
155+
},
118156
"requestTrialForm": {
119157
"request": "Request Trial",
120158
"emailAddress": {
Loading
Loading
Loading
Loading
Loading
Loading
Loading

packages/onboarding-ui/src/common/FormPageLayout.styles.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ export const Title = styled('div')`
7272
`;
7373

7474
export const Subtitle = styled('div')`
75-
font-size: ${String(40 / 16)}rem;
75+
font-size: ${String(16 / 16)}rem;
76+
line-height: ${String(22 / 16)}rem;
7677
font-family: ${sans};
77-
line-height: ${String(42 / 16)}rem;
78+
font-weight: 500;
7879
text-align: center;
7980
8081
@media (min-width: 1440px) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import styled from '@rocket.chat/styled';
2+
import type { CSSProperties } from 'react';
3+
4+
type ListComponentProps = {
5+
color: string;
6+
icon?: string;
7+
listStyleType: CSSProperties['listStyleType'];
8+
};
9+
10+
export const ListComponent = styled(
11+
'ul',
12+
({ color, icon, listStyleType, ...props }: ListComponentProps) => props
13+
)`
14+
padding: 0;
15+
margin: 0;
16+
color: ${(p) => p.color};
17+
list-style: ${(p) =>
18+
p.icon
19+
? `none url('data:image/svg+xml,${p.icon}') inside`
20+
: `${p.listStyleType || 'none'} inside`};
21+
`;
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
import { Box, Margins } from '@rocket.chat/fuselage';
2+
import colors from '@rocket.chat/fuselage-tokens/colors.json';
23
import type {
34
ReactElement,
45
ReactNode,
56
ComponentProps,
67
CSSProperties,
78
} from 'react';
89

10+
import { ListComponent } from './List.styles';
11+
912
const List = ({
1013
children,
11-
listStyle,
14+
listStyleType,
15+
icon,
1216
spacing = 'x6',
13-
color = 'default',
17+
color = colors.n900,
1418
}: {
1519
children: ReactNode;
1620
spacing?: ComponentProps<typeof Margins>['block'];
17-
listStyle?: CSSProperties['listStyle'];
21+
listStyleType?: CSSProperties['listStyleType'];
1822
color?: ComponentProps<typeof Box>['color'];
23+
icon?: string;
1924
}): ReactElement => (
20-
<Box is='ul' style={{ listStyle: listStyle || 'none' }} color={color}>
25+
<ListComponent icon={icon} listStyleType={listStyleType} color={color}>
2126
<Margins block={spacing}>{children}</Margins>
22-
</Box>
27+
</ListComponent>
2328
);
2429

2530
export default List;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import List from './List';
2+
import ListItem from './ListItem';
3+
4+
export default Object.assign(List, {
5+
Item: ListItem,
6+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type { Meta, Story } from '@storybook/react';
2+
import type { ComponentProps } from 'react';
3+
4+
import CreateCloudWorkspaceForm from './CreateCloudWorkspaceForm';
5+
import WorkspaceUrlInput from './WorkspaceUrlInput';
6+
7+
type Args = ComponentProps<typeof CreateCloudWorkspaceForm>;
8+
9+
export default {
10+
title: 'forms/CreateCloudWorkspaceForm',
11+
component: CreateCloudWorkspaceForm,
12+
parameters: {
13+
layout: 'centered',
14+
actions: { argTypesRegex: '^on.*' },
15+
},
16+
args: {
17+
currentStep: 1,
18+
stepCount: 2,
19+
serverRegionOptions: [
20+
['us', 'US'],
21+
['br', 'BR'],
22+
],
23+
domain: 'rocket.chat',
24+
validateUrl: async (url) => url !== 'rocket',
25+
validateEmail: async (email) => email !== 'rocket',
26+
},
27+
} as Meta<Args>;
28+
29+
export const _CreateCloudWorkspaceForm: Story<Args> = (args) => (
30+
<CreateCloudWorkspaceForm {...args} />
31+
);
32+
33+
export const _WorkspaceUrlInput: Story<Args> = () => (
34+
<WorkspaceUrlInput domain='rocket.chat' />
35+
);
36+
_CreateCloudWorkspaceForm.storyName = 'CreateCloudWorkspaceForm';

0 commit comments

Comments
 (0)