Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 4147548

Browse files
✨ Add domain settings
This is the UI for staart/api#114
1 parent 4b46879 commit 4147548

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

locales/en.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ export default {
7575
"billing-subscription-updated": "Your subscription has been updated",
7676
"billing-source-created": "Your payment method has been created",
7777
"billing-source-updated": "Your payment method has been updated",
78-
"billing-source-deleted": "Your payment method has been deleted"
78+
"billing-source-deleted": "Your payment method has been deleted",
79+
"domain-unable-to-verify": "We weren't able to verify your domain",
80+
"domain-missing-file": "We couldn't find the verification file",
81+
"domain-missing-dns": "We didn't find the DNS record",
82+
"domain-already-verified": "This domain is already verified",
83+
"cannot-invite-domain": "You cannot invite a member from this domain"
7984
},
8085
membershipRoles: {
8186
1: "Owner",

pages/manage/_team/domains/_id.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<main>
3-
<Loading v-if="loading" />
3+
<Loading v-if="loading" :message="loading" />
44
<div v-else-if="domain">
55
<div class="row">
66
<div>
@@ -47,6 +47,13 @@
4747
Add a DNS record to your domain
4848
</label>
4949
</div>
50+
<div v-if="hasError" style="margin-bottom: 2rem">
51+
<p>
52+
<strong>Error:</strong> We weren't able to verify your domain. If
53+
you've just added a DNS record, it may take up to 24 hours to
54+
propogate.
55+
</p>
56+
</div>
5057
<div v-if="verifyOption === 'file'" class="card card--type-padded">
5158
<h3>Steps to verify your domain</h3>
5259
<ol>
@@ -117,6 +124,12 @@
117124
</div>
118125
</form>
119126
</div>
127+
<LargeMessage
128+
v-else
129+
img="undraw_confirmation_2uy0.svg"
130+
heading="Domain verified"
131+
text="Nothing to do here, you've already verified your domain successfully"
132+
/>
120133
</div>
121134
</main>
122135
</template>
@@ -134,6 +147,7 @@ import {
134147
faArrowLeft
135148
} from "@fortawesome/free-solid-svg-icons";
136149
import download from "downloadjs";
150+
import LargeMessage from "@/components/LargeMessage.vue";
137151
import Loading from "@/components/Loading.vue";
138152
import Country from "@/components/Country.vue";
139153
import TimeAgo from "@/components/TimeAgo.vue";
@@ -146,6 +160,7 @@ library.add(faTrash, faPencilAlt, faSync, faArrowLeft);
146160
@Component({
147161
components: {
148162
Country,
163+
LargeMessage,
149164
TimeAgo,
150165
Loading,
151166
Input,

pages/manage/_team/settings.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
help="Changing your username can have unintended side effects"
3535
@input="val => (organization.username = val)"
3636
/>
37+
<Checkbox
38+
:value="organization.autoJoinDomain"
39+
label="Allow users with verified domain emails to automatically join this team"
40+
help="You can set up verified domains below to make it easy for your team to join"
41+
:question-mark="true"
42+
@input="val => (organization.autoJoinDomain = val)"
43+
/>
44+
<Checkbox
45+
:value="organization.onlyAllowDomain"
46+
label="Only allow users with verified domain emails to join this team"
47+
help="We won't let managers invite users with emails from other domains"
48+
:question-mark="true"
49+
@input="val => (organization.onlyAllowDomain = val)"
50+
/>
3751
<button class="button">
3852
Update settings
3953
</button>

types/manage.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export interface Organization extends IdRow {
55
name?: string;
66
stripeCustomerId?: string;
77
username: string;
8+
autoJoinDomain: boolean;
9+
onlyAllowDomain: boolean;
810
}
911

1012
export interface Membership extends IdRow {
@@ -132,7 +134,9 @@ export const emptyOrganization: Organization = {
132134
updatedAt: new Date().toString(),
133135
name: "",
134136
username: "",
135-
stripeCustomerId: ""
137+
stripeCustomerId: "",
138+
autoJoinDomain: false,
139+
onlyAllowDomain: false
136140
};
137141
export const emptyPagination = {
138142
data: [],

0 commit comments

Comments
 (0)