Skip to content

Commit 4c73f9f

Browse files
committed
Updates to the calendar settings UI
1 parent 67e9e8c commit 4c73f9f

File tree

2 files changed

+76
-64
lines changed

2 files changed

+76
-64
lines changed

frontend/pages/admin/IntegrationsPage/cards/Calendars/Calendars.tsx

+74-62
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AppContext } from "context/app";
77
import configAPI from "services/entities/config";
88
// @ts-ignore
99
import { stringToClipboard } from "utilities/copy_text";
10+
import paths from "router/paths";
1011

1112
// @ts-ignore
1213
import InputField from "components/forms/fields/InputField";
@@ -17,6 +18,7 @@ import Spinner from "components/Spinner";
1718
import DataError from "components/DataError";
1819
import PremiumFeatureMessage from "components/PremiumFeatureMessage/PremiumFeatureMessage";
1920
import Icon from "components/Icon";
21+
import Card from "components/Card";
2022

2123
const CREATING_SERVICE_ACCOUNT =
2224
"https://www.fleetdm.com/learn-more-about/creating-service-accounts";
@@ -236,6 +238,9 @@ const Calendars = (): JSX.Element => {
236238
For "Organization" and "Location", select
237239
your calendar's organization.
238240
</li>
241+
<li>
242+
Click <b>Create</b>.
243+
</li>
239244
</ul>
240245
</p>
241246

@@ -277,69 +282,72 @@ const Calendars = (): JSX.Element => {
277282
<li>
278283
Click <b>Create</b> to create the key & download a JSON file.
279284
</li>
280-
<li className={`${baseClass}__configuration`}>
281-
Configure your service account integration in Fleet using the
282-
form below:
283-
<form onSubmit={onFormSubmit} autoComplete="off">
284-
<InputField
285-
label="API key JSON"
286-
onChange={onInputChange}
287-
name="apiKeyJson"
288-
value={apiKeyJson}
289-
parseTarget
290-
type="textarea"
291-
tooltip={
292-
<>
293-
Paste the full contents of the JSON file downloaded{" "}
294-
<br />
295-
when creating your service account API key.
296-
</>
297-
}
298-
placeholder={API_KEY_JSON_PLACEHOLDER}
299-
ignore1password
300-
inputClassName={`${baseClass}__api-key-json`}
301-
error={formErrors.apiKeyJson}
302-
/>
303-
<InputField
304-
label="Primary domain"
305-
onChange={onInputChange}
306-
name="domain"
307-
value={domain}
308-
parseTarget
309-
tooltip={
310-
<>
311-
If the end user is signed into multiple Google accounts,
312-
this will be used to identify their work calendar.
313-
</>
314-
}
315-
placeholder="example.com"
316-
helpText={
317-
<>
318-
You can find your primary domain in Google Workspace{" "}
319-
<CustomLink
320-
url={GOOGLE_WORKSPACE_DOMAINS}
321-
text="here"
322-
newTab
323-
/>
324-
</>
325-
}
326-
error={formErrors.domain}
327-
/>
328-
<Button
329-
type="submit"
330-
variant="brand"
331-
disabled={Object.keys(formErrors).length > 0}
332-
className="save-loading"
333-
isLoading={isUpdatingSettings}
334-
>
335-
Save
336-
</Button>
337-
</form>
285+
</ul>
286+
</p>
287+
<p className={`${baseClass}__configuration`}>
288+
Configure your service account integration in Fleet using the form
289+
below:
290+
<ul>
291+
<li>
292+
Paste the full contents of the JSON file downloaded when
293+
creating your service account API key.
294+
</li>
295+
<li>
296+
Set your primary domain. (If the end user is signed into
297+
multiple Google accounts, this will be used to identify their
298+
work calendar.)
299+
</li>
300+
<li>
301+
Save your changes.
302+
<Card>
303+
<form onSubmit={onFormSubmit} autoComplete="off">
304+
<InputField
305+
label="API key JSON"
306+
onChange={onInputChange}
307+
name="apiKeyJson"
308+
value={apiKeyJson}
309+
parseTarget
310+
type="textarea"
311+
placeholder={API_KEY_JSON_PLACEHOLDER}
312+
ignore1password
313+
inputClassName={`${baseClass}__api-key-json`}
314+
error={formErrors.apiKeyJson}
315+
/>
316+
<InputField
317+
label="Primary domain"
318+
onChange={onInputChange}
319+
name="domain"
320+
value={domain}
321+
parseTarget
322+
placeholder="example.com"
323+
helpText={
324+
<>
325+
You can find your primary domain in Google Workspace{" "}
326+
<CustomLink
327+
url={GOOGLE_WORKSPACE_DOMAINS}
328+
text="here"
329+
newTab
330+
/>
331+
</>
332+
}
333+
error={formErrors.domain}
334+
/>
335+
<Button
336+
type="submit"
337+
variant="brand"
338+
disabled={Object.keys(formErrors).length > 0}
339+
className="save-loading"
340+
isLoading={isUpdatingSettings}
341+
>
342+
Save
343+
</Button>
344+
</form>
345+
</Card>
338346
</li>
339347
</ul>
340348
</p>
341349
<p>
342-
5. Authorize the service account via domain-wide delegation.
350+
6. Authorize the service account via domain-wide delegation.
343351
<ul>
344352
<li>
345353
In Google Workspace, go to{" "}
@@ -381,7 +389,7 @@ const Calendars = (): JSX.Element => {
381389
</ul>
382390
</p>
383391
<p>
384-
6. Enable the Google Calendar API.
392+
7. Enable the Google Calendar API.
385393
<ul>
386394
<li>
387395
In the Google Cloud console API library, go to the Google
@@ -402,8 +410,12 @@ const Calendars = (): JSX.Element => {
402410
</ul>
403411
</p>
404412
<p>
405-
You&apos;re ready to automatically schedule calendar events for end
406-
users.
413+
Now head over to{" "}
414+
<CustomLink
415+
url={paths.MANAGE_POLICIES}
416+
text="Policies &gt; Manage automations"
417+
/>{" "}
418+
to finish setup.
407419
</p>
408420
</div>
409421
</>

frontend/pages/admin/IntegrationsPage/cards/Calendars/_styles.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
margin: $pad-small 0;
1717
}
1818

19-
form {
20-
margin-top: $pad-large;
19+
.card {
20+
margin-top: $pad-small;
2121
}
2222

2323
&__configuration {

0 commit comments

Comments
 (0)