Skip to content

Commit

Permalink
Add support for new SMTP config schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Nov 27, 2024
1 parent 7780403 commit 2b5e505
Show file tree
Hide file tree
Showing 4 changed files with 882 additions and 237 deletions.
135 changes: 135 additions & 0 deletions shared/studio/tabs/auth/authAdmin.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,141 @@
resize: vertical;
}

.newDraftSMTPProvider {
display: flex;
flex-direction: column;
width: 100%;

.configGrid {
margin-top: 0;
}

.buttons {
display: flex;
gap: 16px;
justify-content: flex-end;
margin-top: 24px;
flex-direction: row;
}
}

.emailProvidersUpdating {
opacity: 0.7;
pointer-events: none;
}

.emailProviderCard {
.details {
display: flex;
flex-direction: column;
color: var(--main_text_color);
line-height: 22px;

.name {
font-weight: 500;
}

.senderhost {
color: var(--tertiary_text_color);

span {
font-size: 11px;
margin: 0 6px;
opacity: 0.5;
}
}
}

.selectCurrentProvider {
width: 32px;
height: 32px;
stroke-width: 1px;
stroke: var(--Grey75);
cursor: pointer;
flex-shrink: 0;

&.selected {
fill: #a565cd;
stroke: #9c56b4 !important;
pointer-events: none;
}

@include darkTheme {
stroke: var(--Grey40);
}
}

.updatingSpinner {
color: var(--Grey50);
width: 32px;
flex-shrink: 0;
}

.buttons {
display: flex;
gap: 16px;
justify-content: flex-end;
flex-direction: row;
padding: 4px 16px 16px 16px;
}
}

.expandedEmailProviderConfig {
margin: -2px 12px 12px 12px;
background: var(--Grey97);
border-radius: 8px;
border: 1px solid var(--Grey93);

@include darkTheme {
background: var(--Grey16);
border-color: var(--Grey25);
}

.configGrid {
margin-top: 20px;
margin-bottom: 12px;

@include isMobile {
margin: 16px;
}
}
}

.emailProviderWarning {
position: relative;
padding: 16px 20px;
padding-left: 48px;
background: #f7e9c8;
border-radius: 8px;
border: 1px solid #c1a970;
color: #7b6226;
font-weight: 450;
line-height: 20px;
margin-top: 16px;

& > svg {
position: absolute;
left: 16px;
top: 14px;
}

& > span {
font-weight: 500;
}

.link {
font-weight: inherit;
cursor: pointer;
text-decoration: underline;
}

@include darkTheme {
background: #453d2c;
border: 1px solid #72623b;
color: #d1bd8f;
}
}

.docsNote {
display: flex;
align-items: flex-start;
Expand Down
28 changes: 23 additions & 5 deletions shared/studio/tabs/auth/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
Select,
SelectItem,
TextInput,
WarningIcon,
} from "@edgedb/common/newui";

import styles from "./authAdmin.module.scss";
Expand All @@ -50,11 +51,28 @@ export const ProvidersTab = observer(function ProvidersTab() {
{state.providers ? (
<>
{state.providers.length ? (
<div className={styles.cardList}>
{state.providers.map((provider) => (
<ProviderCard key={provider.name} provider={provider} />
))}
</div>
<>
{state.noEmailProviderWarning ? (
<div className={styles.emailProviderWarning}>
<WarningIcon />
<span>Warning:</span> You have enabled auth providers
requiring email, but no SMTP provider is configured.
<br />
<span
className={styles.link}
onClick={() => state.setSelectedTab("smtp")}
>
Enable an SMTP provider
</span>
</div>
) : null}

<div className={styles.cardList}>
{state.providers.map((provider) => (
<ProviderCard key={provider.name} provider={provider} />
))}
</div>
</>
) : null}

{state.draftProviderConfig ? (
Expand Down
Loading

0 comments on commit 2b5e505

Please sign in to comment.