@mongoosejs/studio 0.0.49 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -578,18 +578,54 @@ video {
578
578
  }
579
579
  }
580
580
 
581
+ .sr-only {
582
+ position: absolute;
583
+ width: 1px;
584
+ height: 1px;
585
+ padding: 0;
586
+ margin: -1px;
587
+ overflow: hidden;
588
+ clip: rect(0, 0, 0, 0);
589
+ white-space: nowrap;
590
+ border-width: 0;
591
+ }
592
+
581
593
  .fixed {
582
594
  position: fixed;
583
595
  }
584
596
 
597
+ .absolute {
598
+ position: absolute;
599
+ }
600
+
585
601
  .relative {
586
602
  position: relative;
587
603
  }
588
604
 
605
+ .-inset-1 {
606
+ inset: -0.25rem;
607
+ }
608
+
609
+ .-inset-1\.5 {
610
+ inset: -0.375rem;
611
+ }
612
+
613
+ .right-0 {
614
+ right: 0px;
615
+ }
616
+
617
+ .top-\[82\%\] {
618
+ top: 82%;
619
+ }
620
+
589
621
  .isolate {
590
622
  isolation: isolate;
591
623
  }
592
624
 
625
+ .z-10 {
626
+ z-index: 10;
627
+ }
628
+
593
629
  .m-0 {
594
630
  margin: 0px;
595
631
  }
@@ -702,6 +738,20 @@ video {
702
738
  display: flow-root;
703
739
  }
704
740
 
741
+ .size-5 {
742
+ width: 1.25rem;
743
+ height: 1.25rem;
744
+ }
745
+
746
+ .size-8 {
747
+ width: 2rem;
748
+ height: 2rem;
749
+ }
750
+
751
+ .h-48 {
752
+ height: 12rem;
753
+ }
754
+
705
755
  .h-5 {
706
756
  height: 1.25rem;
707
757
  }
@@ -730,6 +780,10 @@ video {
730
780
  max-height: 50vh;
731
781
  }
732
782
 
783
+ .w-48 {
784
+ width: 12rem;
785
+ }
786
+
733
787
  .w-5 {
734
788
  width: 1.25rem;
735
789
  }
@@ -766,6 +820,10 @@ video {
766
820
  flex-shrink: 1;
767
821
  }
768
822
 
823
+ .shrink-0 {
824
+ flex-shrink: 0;
825
+ }
826
+
769
827
  .flex-grow {
770
828
  flex-grow: 1;
771
829
  }
@@ -774,6 +832,10 @@ video {
774
832
  flex-grow: 1;
775
833
  }
776
834
 
835
+ .origin-top-right {
836
+ transform-origin: top right;
837
+ }
838
+
777
839
  .cursor-pointer {
778
840
  cursor: pointer;
779
841
  }
@@ -880,6 +942,10 @@ video {
880
942
  border-radius: 0.25rem;
881
943
  }
882
944
 
945
+ .rounded-full {
946
+ border-radius: 9999px;
947
+ }
948
+
883
949
  .rounded-lg {
884
950
  border-radius: 0.5rem;
885
951
  }
@@ -941,20 +1007,25 @@ video {
941
1007
  border-color: rgb(209 213 219 / var(--tw-border-opacity));
942
1008
  }
943
1009
 
944
- .border-teal-500 {
945
- --tw-border-opacity: 1;
946
- border-color: rgb(0 208 201 / var(--tw-border-opacity));
947
- }
948
-
949
1010
  .border-transparent {
950
1011
  border-color: transparent;
951
1012
  }
952
1013
 
1014
+ .border-ultramarine-500 {
1015
+ --tw-border-opacity: 1;
1016
+ border-color: rgb(63 83 255 / var(--tw-border-opacity));
1017
+ }
1018
+
953
1019
  .bg-blue-500 {
954
1020
  --tw-bg-opacity: 1;
955
1021
  background-color: rgb(59 130 246 / var(--tw-bg-opacity));
956
1022
  }
957
1023
 
1024
+ .bg-forest-green-600 {
1025
+ --tw-bg-opacity: 1;
1026
+ background-color: rgb(0 202 44 / var(--tw-bg-opacity));
1027
+ }
1028
+
958
1029
  .bg-gray-100 {
959
1030
  --tw-bg-opacity: 1;
960
1031
  background-color: rgb(243 244 246 / var(--tw-bg-opacity));
@@ -965,16 +1036,31 @@ video {
965
1036
  background-color: rgb(229 231 235 / var(--tw-bg-opacity));
966
1037
  }
967
1038
 
1039
+ .bg-gray-400 {
1040
+ --tw-bg-opacity: 1;
1041
+ background-color: rgb(156 163 175 / var(--tw-bg-opacity));
1042
+ }
1043
+
968
1044
  .bg-gray-500 {
969
1045
  --tw-bg-opacity: 1;
970
1046
  background-color: rgb(107 114 128 / var(--tw-bg-opacity));
971
1047
  }
972
1048
 
1049
+ .bg-gray-800 {
1050
+ --tw-bg-opacity: 1;
1051
+ background-color: rgb(31 41 55 / var(--tw-bg-opacity));
1052
+ }
1053
+
973
1054
  .bg-green-600 {
974
1055
  --tw-bg-opacity: 1;
975
1056
  background-color: rgb(22 163 74 / var(--tw-bg-opacity));
976
1057
  }
977
1058
 
1059
+ .bg-red-300 {
1060
+ --tw-bg-opacity: 1;
1061
+ background-color: rgb(252 165 165 / var(--tw-bg-opacity));
1062
+ }
1063
+
978
1064
  .bg-red-50 {
979
1065
  --tw-bg-opacity: 1;
980
1066
  background-color: rgb(254 242 242 / var(--tw-bg-opacity));
@@ -985,11 +1071,6 @@ video {
985
1071
  background-color: rgb(239 68 68 / var(--tw-bg-opacity));
986
1072
  }
987
1073
 
988
- .bg-red-600 {
989
- --tw-bg-opacity: 1;
990
- background-color: rgb(220 38 38 / var(--tw-bg-opacity));
991
- }
992
-
993
1074
  .bg-slate-100 {
994
1075
  --tw-bg-opacity: 1;
995
1076
  background-color: rgb(241 245 249 / var(--tw-bg-opacity));
@@ -1000,11 +1081,6 @@ video {
1000
1081
  background-color: rgb(71 85 105 / var(--tw-bg-opacity));
1001
1082
  }
1002
1083
 
1003
- .bg-teal-100 {
1004
- --tw-bg-opacity: 1;
1005
- background-color: rgb(197 255 250 / var(--tw-bg-opacity));
1006
- }
1007
-
1008
1084
  .bg-teal-600 {
1009
1085
  --tw-bg-opacity: 1;
1010
1086
  background-color: rgb(0 168 165 / var(--tw-bg-opacity));
@@ -1014,14 +1090,24 @@ video {
1014
1090
  background-color: transparent;
1015
1091
  }
1016
1092
 
1017
- .bg-white {
1093
+ .bg-ultramarine-100 {
1018
1094
  --tw-bg-opacity: 1;
1019
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1095
+ background-color: rgb(229 234 255 / var(--tw-bg-opacity));
1020
1096
  }
1021
1097
 
1022
- .bg-red-300 {
1098
+ .bg-ultramarine-600 {
1023
1099
  --tw-bg-opacity: 1;
1024
- background-color: rgb(252 165 165 / var(--tw-bg-opacity));
1100
+ background-color: rgb(24 35 255 / var(--tw-bg-opacity));
1101
+ }
1102
+
1103
+ .bg-valencia-600 {
1104
+ --tw-bg-opacity: 1;
1105
+ background-color: rgb(202 56 56 / var(--tw-bg-opacity));
1106
+ }
1107
+
1108
+ .bg-white {
1109
+ --tw-bg-opacity: 1;
1110
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1025
1111
  }
1026
1112
 
1027
1113
  .bg-yellow-300 {
@@ -1041,6 +1127,10 @@ video {
1041
1127
  padding: 1rem;
1042
1128
  }
1043
1129
 
1130
+ .p-6 {
1131
+ padding: 1.5rem;
1132
+ }
1133
+
1044
1134
  .px-1 {
1045
1135
  padding-left: 0.25rem;
1046
1136
  padding-right: 0.25rem;
@@ -1295,6 +1385,10 @@ video {
1295
1385
  --tw-ring-inset: inset;
1296
1386
  }
1297
1387
 
1388
+ .ring-black\/5 {
1389
+ --tw-ring-color: rgb(0 0 0 / 0.05);
1390
+ }
1391
+
1298
1392
  .ring-gray-300 {
1299
1393
  --tw-ring-opacity: 1;
1300
1394
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
@@ -1371,11 +1465,6 @@ video {
1371
1465
  background-color: rgb(34 197 94 / var(--tw-bg-opacity));
1372
1466
  }
1373
1467
 
1374
- .hover\:bg-red-500:hover {
1375
- --tw-bg-opacity: 1;
1376
- background-color: rgb(239 68 68 / var(--tw-bg-opacity));
1377
- }
1378
-
1379
1468
  .hover\:bg-red-600:hover {
1380
1469
  --tw-bg-opacity: 1;
1381
1470
  background-color: rgb(220 38 38 / var(--tw-bg-opacity));
@@ -1386,14 +1475,29 @@ video {
1386
1475
  background-color: rgb(100 116 139 / var(--tw-bg-opacity));
1387
1476
  }
1388
1477
 
1389
- .hover\:bg-teal-100:hover {
1478
+ .hover\:bg-teal-500:hover {
1390
1479
  --tw-bg-opacity: 1;
1391
- background-color: rgb(197 255 250 / var(--tw-bg-opacity));
1480
+ background-color: rgb(0 208 201 / var(--tw-bg-opacity));
1392
1481
  }
1393
1482
 
1394
- .hover\:bg-teal-500:hover {
1483
+ .hover\:bg-ultramarine-100:hover {
1395
1484
  --tw-bg-opacity: 1;
1396
- background-color: rgb(0 208 201 / var(--tw-bg-opacity));
1485
+ background-color: rgb(229 234 255 / var(--tw-bg-opacity));
1486
+ }
1487
+
1488
+ .hover\:bg-ultramarine-200:hover {
1489
+ --tw-bg-opacity: 1;
1490
+ background-color: rgb(206 218 255 / var(--tw-bg-opacity));
1491
+ }
1492
+
1493
+ .hover\:bg-ultramarine-500:hover {
1494
+ --tw-bg-opacity: 1;
1495
+ background-color: rgb(63 83 255 / var(--tw-bg-opacity));
1496
+ }
1497
+
1498
+ .hover\:bg-valencia-500:hover {
1499
+ --tw-bg-opacity: 1;
1500
+ background-color: rgb(220 73 73 / var(--tw-bg-opacity));
1397
1501
  }
1398
1502
 
1399
1503
  .hover\:text-gray-700:hover {
@@ -1447,6 +1551,19 @@ video {
1447
1551
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity));
1448
1552
  }
1449
1553
 
1554
+ .focus\:ring-white:focus {
1555
+ --tw-ring-opacity: 1;
1556
+ --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));
1557
+ }
1558
+
1559
+ .focus\:ring-offset-2:focus {
1560
+ --tw-ring-offset-width: 2px;
1561
+ }
1562
+
1563
+ .focus\:ring-offset-gray-800:focus {
1564
+ --tw-ring-offset-color: #1f2937;
1565
+ }
1566
+
1450
1567
  .focus-visible\:outline:focus-visible {
1451
1568
  outline-style: solid;
1452
1569
  }
@@ -1479,6 +1596,10 @@ video {
1479
1596
  outline-color: #00a8a5;
1480
1597
  }
1481
1598
 
1599
+ .focus-visible\:outline-ultramarine-600:focus-visible {
1600
+ outline-color: #1823ff;
1601
+ }
1602
+
1482
1603
  @media (min-width: 640px) {
1483
1604
  .sm\:-mx-6 {
1484
1605
  margin-left: -1.5rem;
@@ -7,16 +7,14 @@ const client = axios.create({
7
7
  });
8
8
 
9
9
  window.apiClient = client;
10
- if (typeof config__setAuthorizationHeaderFrom === 'string' && config__setAuthorizationHeaderFrom) {
11
- client.interceptors.request.use(req => {
12
- const accessToken = window.localStorage.getItem(config__setAuthorizationHeaderFrom) || null;
13
- if (accessToken) {
14
- req.headers.authorization = accessToken;
15
- }
10
+ client.interceptors.request.use(req => {
11
+ const accessToken = window.localStorage.getItem('_mongooseStudioAccessToken') || null;
12
+ if (accessToken) {
13
+ req.headers.authorization = accessToken;
14
+ }
16
15
 
17
- return req;
18
- });
19
- }
16
+ return req;
17
+ });
20
18
 
21
19
  client.interceptors.response.use(
22
20
  res => res,
@@ -30,7 +28,7 @@ client.interceptors.response.use(
30
28
 
31
29
  if (config__isLambda) {
32
30
  exports.status = function status() {
33
- return client.get('', { action: 'status' }).then(res => res.data);
31
+ return client.post('', { action: 'status' }).then(res => res.data);
34
32
  };
35
33
  exports.Dashboard = {
36
34
  createDashboard(params) {
@@ -2,7 +2,7 @@
2
2
  <div class="mb-2">
3
3
  <textarea class="border border-gray-200 p-2 h-[300px] w-full" ref="codeEditor"></textarea>
4
4
  </div>
5
- <button @click="createDocument()" class="rounded-md bg-teal-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">Submit</button>
5
+ <button @click="createDocument()" class="rounded-md bg-ultramarine-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">Submit</button>
6
6
  <div v-if="errors.length > 0" class="rounded-md bg-red-50 p-4 mt-1">
7
7
  <div class="flex">
8
8
  <div class="flex-shrink-0">
@@ -22,4 +22,4 @@
22
22
  </div>
23
23
  </div>
24
24
  </div>
25
- </div>
25
+ </div>
@@ -1,7 +1,9 @@
1
1
  <div class="document">
2
2
  <div class="document-menu">
3
3
  <div class="left">
4
- <button @click="$router.push('/model/' + this.model)">
4
+ <button
5
+ @click="$router.push('/model/' + this.model)"
6
+ class="rounded-md bg-gray-400 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-slate-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-600">
5
7
  &lsaquo; Back
6
8
  </button>
7
9
  </div>
@@ -11,7 +13,7 @@
11
13
  v-if="!editting"
12
14
  @click="editting = true"
13
15
  type="button"
14
- class="rounded-md bg-teal-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
16
+ class="rounded-md bg-ultramarine-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
15
17
  <img src="images/edit.svg" class="inline" /> Edit
16
18
  </button>
17
19
  <button
@@ -25,13 +27,13 @@
25
27
  v-if="editting"
26
28
  @click="shouldShowConfirmModal=true;"
27
29
  type="button"
28
- class="rounded-md bg-green-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600">
30
+ class="rounded-md bg-forest-green-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600">
29
31
  <img src="images/save.svg" class="inline" /> Save
30
32
  </button>
31
33
  <button
32
34
  @click="shouldShowDeleteModal=true;"
33
35
  type="button"
34
- class="rounded-md bg-red-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600">
36
+ class="rounded-md bg-valencia-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-valencia-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600">
35
37
  <img src="images/delete.svg" class="inline" /> Delete
36
38
  </button>
37
39
  </div>
@@ -4,6 +4,7 @@ if (typeof process === 'undefined') {
4
4
  global.process = { env: {} }; // To make `util` package work
5
5
  }
6
6
 
7
+ const mothership = require('./mothership');
7
8
  const vanillatoasts = require('vanillatoasts');
8
9
 
9
10
  const app = Vue.createApp({
@@ -43,13 +44,19 @@ require('./list-subdocument/list-subdocument')(app);
43
44
  require('./modal/modal')(app);
44
45
  require('./models/models')(app);
45
46
  require('./navbar/navbar')(app);
47
+ require('./splash/splash')(app);
46
48
 
47
49
  app.component('app-component', {
48
50
  template: `
49
51
  <div>
50
- <navbar />
51
- <div class="view">
52
- <router-view :key="$route.fullPath" />
52
+ <div v-if="hasAPIKey && user == null">
53
+ <splash />
54
+ </div>
55
+ <div v-else-if="!hasAPIKey || user">
56
+ <navbar :user="user" />
57
+ <div class="view">
58
+ <router-view :key="$route.fullPath" />
59
+ </div>
53
60
  </div>
54
61
  </div>
55
62
  `,
@@ -60,6 +67,29 @@ app.component('app-component', {
60
67
  timeout: 10000,
61
68
  positionClass: 'bottomRight'
62
69
  });
70
+ },
71
+ computed: {
72
+ hasAPIKey() {
73
+ return mothership.hasAPIKey;
74
+ }
75
+ },
76
+ async mounted() {
77
+ window.$router = this.$router;
78
+
79
+ if (mothership.hasAPIKey) {
80
+ const token = window.localStorage.getItem('_mongooseStudioAccessToken');
81
+ if (token) {
82
+ this.user = await mothership.me().then(res => res.user);
83
+ }
84
+ }
85
+ },
86
+ setup() {
87
+ const user = Vue.ref(null);
88
+
89
+ const state = Vue.reactive({ user });
90
+ Vue.provide('state', state);
91
+
92
+ return state;
63
93
  }
64
94
  });
65
95
 
@@ -33,7 +33,7 @@
33
33
  .modal-header {
34
34
  margin-top: 0;
35
35
  font-size: 18px;
36
- font-weight: bold
36
+ font-weight: bold;
37
37
  }
38
38
 
39
39
  .modal-header-success {
@@ -82,4 +82,13 @@
82
82
  right: 0.25em;
83
83
  top: 0.25em;
84
84
  cursor: pointer;
85
+ font-size: 1.25em;
86
+ height: 1.25em;
87
+ width: 1.25em;
88
+ border-radius: 100%;
89
+ border: 1px solid #ddd;
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ padding-bottom: 0.25em;
85
94
  }
@@ -12,7 +12,7 @@
12
12
 
13
13
  .models .model-selector {
14
14
  background-color: #eee;
15
- flex-grow: 0;
15
+ flex-grow: 0;
16
16
  padding: 15px;
17
17
  padding-top: 0px;
18
18
  }
@@ -49,12 +49,12 @@
49
49
  }
50
50
 
51
51
  .models .documents table th:after {
52
- content: '';
52
+ content: "";
53
53
  position: absolute;
54
54
  left: 0;
55
55
  width: 100%;
56
56
  bottom: -1px;
57
- border-bottom: thin solid rgba(0,0,0,.12);
57
+ border-bottom: thin solid rgba(0, 0, 0, 0.12);
58
58
  }
59
59
 
60
60
  .models .documents table tr {
@@ -69,11 +69,12 @@
69
69
  }
70
70
 
71
71
  .models .documents table tr:hover {
72
- background-color: #55A3D4;
72
+ background-color: #a7b9ff;
73
73
  }
74
74
 
75
- .models .documents table th, td {
76
- border-bottom: thin solid rgba(0,0,0,.12);
75
+ .models .documents table th,
76
+ td {
77
+ border-bottom: thin solid rgba(0, 0, 0, 0.12);
77
78
  text-align: left;
78
79
  padding: 0 16px;
79
80
  height: 48px;
@@ -84,7 +85,7 @@
84
85
  }
85
86
 
86
87
  .models .path-type {
87
- color: rgba(0,0,0,.36);
88
+ color: rgba(0, 0, 0, 0.36);
88
89
  font-size: 0.8em;
89
90
  }
90
91
 
@@ -125,4 +126,4 @@
125
126
  display: inline-flex;
126
127
  justify-content: space-around;
127
128
  align-items: center;
128
- }
129
+ }
@@ -12,7 +12,7 @@
12
12
  <router-link
13
13
  :to="'/model/' + model"
14
14
  class="block rounded-md py-2 pr-2 pl-2 text-sm font-semibold text-gray-700"
15
- :class="model === currentModel ? 'bg-teal-100 font-bold' : 'hover:bg-teal-100'">
15
+ :class="model === currentModel ? 'bg-ultramarine-100 font-bold' : 'hover:bg-ultramarine-100'">
16
16
  {{model}}
17
17
  </router-link>
18
18
  </li>
@@ -21,7 +21,7 @@
21
21
  </ul>
22
22
  </nav>
23
23
  </div>
24
-
24
+
25
25
  </div>
26
26
  <div class="documents" ref="documentsList">
27
27
  <div>
@@ -37,19 +37,19 @@
37
37
  <button
38
38
  @click="shouldShowExportModal = true"
39
39
  type="button"
40
- class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
40
+ class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
41
41
  Export
42
42
  </button>
43
43
  <button
44
44
  @click="shouldShowCreateModal = true;"
45
45
  type="button"
46
- class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
46
+ class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
47
47
  Create
48
48
  </button>
49
49
  <button
50
50
  @click="shouldShowFieldModal = true"
51
51
  type="button"
52
- class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
52
+ class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
53
53
  Fields
54
54
  </button>
55
55
  <span class="isolate inline-flex rounded-md shadow-sm">
@@ -127,7 +127,7 @@
127
127
  <button type="submit" @click="filterDocuments()" style="color: black;margin-right: 0.5em">Filter Selection</button>
128
128
  <button type="submit" @click="deselectAll()" class="gray" style="margin-right: 0.5em">Deselect All</button>
129
129
  <button type="submit" @click="resetDocuments()" class="gray">Cancel</button>
130
-
130
+
131
131
  </div>
132
132
  </template>
133
133
  </modal>
@@ -138,4 +138,4 @@
138
138
  </template>
139
139
  </modal>
140
140
  </div>
141
- </div>
141
+ </div>
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const axios = require('axios');
4
+ const client = axios.create({
5
+ baseURL: config__mothershipUrl
6
+ });
7
+
8
+ client.hasAPIKey = !!config__mothershipUrl;
9
+
10
+ client.interceptors.request.use(req => {
11
+ const accessToken = window.localStorage.getItem('_mongooseStudioAccessToken') || null;
12
+ if (accessToken) {
13
+ req.headers.authorization = accessToken;
14
+ }
15
+
16
+ return req;
17
+ });
18
+
19
+ exports.githubLogin = function githubLogin() {
20
+ return client.post('/githubLogin', { state: window.location.href }).then(res => res.data);
21
+ };
22
+
23
+ exports.github = function github(code) {
24
+ return client.post('/github', { code, workspaceId: config__workspace._id }).then(res => res.data);
25
+ };
26
+
27
+ exports.me = function me() {
28
+ return client.post('/me', { workspaceId: config__workspace._id }).then(res => res.data);
29
+ };
30
+
31
+ exports.hasAPIKey = client.hasAPIKey;
@@ -12,11 +12,35 @@
12
12
  <a
13
13
  href="#/"
14
14
  class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
15
- :class="routeName === 'root' ? 'text-gray-900 border-teal-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Documents</a>
15
+ :class="routeName === 'root' ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Documents</a>
16
16
  <a
17
17
  href="#/dashboards"
18
18
  class="inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium"
19
- :class="routeName === 'dashboards' ? 'text-gray-900 border-teal-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Dashboards</a>
19
+ :class="routeName === 'dashboards' ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Dashboards</a>
20
+
21
+ <div class="h-full flex items-center" v-if="!user && hasAPIKey">
22
+ <button
23
+ type="button"
24
+ @click="loginWithGithub"
25
+ class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
26
+ Login
27
+ </button>
28
+ </div>
29
+ <div v-if="user && hasAPIKey" class="h-full flex items-center relative" v-clickOutside="hideFlyout">
30
+ <div>
31
+ <button type="button" @click="showFlyout = !showFlyout" class="relative flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
32
+ <span class="absolute -inset-1.5"></span>
33
+ <span class="sr-only">Open user menu</span>
34
+ <img class="size-8 rounded-full" :src="user.picture" alt="">
35
+ </button>
36
+ </div>
37
+
38
+ <div v-if="showFlyout" class="absolute right-0 z-10 top-[82%] w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
39
+ <!-- Active: "bg-gray-100 outline-none", Not Active: "" -->
40
+ <span @click="logout" class="cursor-pointer block px-4 py-2 text-sm text-gray-700 hover:bg-ultramarine-200" role="menuitem" tabindex="-1" id="user-menu-item-2">Sign out</span>
41
+ </div>
42
+ </div>
43
+
20
44
  </div>
21
45
  </div>
22
46
  <div style="clear: both"></div>