@mongoosejs/studio 0.0.60 → 0.0.62

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.
@@ -594,10 +594,6 @@ video {
594
594
  pointer-events: none;
595
595
  }
596
596
 
597
- .fixed {
598
- position: fixed;
599
- }
600
-
601
597
  .absolute {
602
598
  position: absolute;
603
599
  }
@@ -686,6 +682,14 @@ video {
686
682
  margin-bottom: 1rem;
687
683
  }
688
684
 
685
+ .ml-1 {
686
+ margin-left: 0.25rem;
687
+ }
688
+
689
+ .ml-2 {
690
+ margin-left: 0.5rem;
691
+ }
692
+
689
693
  .ml-3 {
690
694
  margin-left: 0.75rem;
691
695
  }
@@ -702,6 +706,10 @@ video {
702
706
  margin-right: 0.5rem;
703
707
  }
704
708
 
709
+ .mt-0 {
710
+ margin-top: 0px;
711
+ }
712
+
705
713
  .mt-1 {
706
714
  margin-top: 0.25rem;
707
715
  }
@@ -777,6 +785,14 @@ video {
777
785
  height: 2rem;
778
786
  }
779
787
 
788
+ .h-16 {
789
+ height: 4rem;
790
+ }
791
+
792
+ .h-4 {
793
+ height: 1rem;
794
+ }
795
+
780
796
  .h-48 {
781
797
  height: 12rem;
782
798
  }
@@ -813,6 +829,14 @@ video {
813
829
  max-height: 50vh;
814
830
  }
815
831
 
832
+ .w-16 {
833
+ width: 4rem;
834
+ }
835
+
836
+ .w-4 {
837
+ width: 1rem;
838
+ }
839
+
816
840
  .w-48 {
817
841
  width: 12rem;
818
842
  }
@@ -833,10 +857,6 @@ video {
833
857
  width: 100%;
834
858
  }
835
859
 
836
- .w-72 {
837
- width: 18rem;
838
- }
839
-
840
860
  .min-w-0 {
841
861
  min-width: 0px;
842
862
  }
@@ -903,6 +923,10 @@ video {
903
923
  grid-template-columns: repeat(1, minmax(0, 1fr));
904
924
  }
905
925
 
926
+ .grid-cols-2 {
927
+ grid-template-columns: repeat(2, minmax(0, 1fr));
928
+ }
929
+
906
930
  .flex-row {
907
931
  flex-direction: row;
908
932
  }
@@ -935,10 +959,18 @@ video {
935
959
  gap: 0.5rem;
936
960
  }
937
961
 
962
+ .gap-3 {
963
+ gap: 0.75rem;
964
+ }
965
+
938
966
  .gap-4 {
939
967
  gap: 1rem;
940
968
  }
941
969
 
970
+ .gap-8 {
971
+ gap: 2rem;
972
+ }
973
+
942
974
  .gap-x-4 {
943
975
  -moz-column-gap: 1rem;
944
976
  column-gap: 1rem;
@@ -1016,10 +1048,6 @@ video {
1016
1048
  overflow-x: auto;
1017
1049
  }
1018
1050
 
1019
- .overflow-y-auto {
1020
- overflow-y: auto;
1021
- }
1022
-
1023
1051
  .truncate {
1024
1052
  overflow: hidden;
1025
1053
  text-overflow: ellipsis;
@@ -1143,11 +1171,21 @@ video {
1143
1171
  background-color: rgb(107 114 128 / var(--tw-bg-opacity));
1144
1172
  }
1145
1173
 
1174
+ .bg-gray-600 {
1175
+ --tw-bg-opacity: 1;
1176
+ background-color: rgb(75 85 99 / var(--tw-bg-opacity));
1177
+ }
1178
+
1146
1179
  .bg-gray-800 {
1147
1180
  --tw-bg-opacity: 1;
1148
1181
  background-color: rgb(31 41 55 / var(--tw-bg-opacity));
1149
1182
  }
1150
1183
 
1184
+ .bg-green-50 {
1185
+ --tw-bg-opacity: 1;
1186
+ background-color: rgb(240 253 244 / var(--tw-bg-opacity));
1187
+ }
1188
+
1151
1189
  .bg-green-600 {
1152
1190
  --tw-bg-opacity: 1;
1153
1191
  background-color: rgb(22 163 74 / var(--tw-bg-opacity));
@@ -1173,6 +1211,11 @@ video {
1173
1211
  background-color: rgb(241 245 249 / var(--tw-bg-opacity));
1174
1212
  }
1175
1213
 
1214
+ .bg-slate-500 {
1215
+ --tw-bg-opacity: 1;
1216
+ background-color: rgb(100 116 139 / var(--tw-bg-opacity));
1217
+ }
1218
+
1176
1219
  .bg-slate-600 {
1177
1220
  --tw-bg-opacity: 1;
1178
1221
  background-color: rgb(71 85 105 / var(--tw-bg-opacity));
@@ -1197,6 +1240,11 @@ video {
1197
1240
  background-color: rgb(24 35 255 / var(--tw-bg-opacity));
1198
1241
  }
1199
1242
 
1243
+ .bg-valencia-500 {
1244
+ --tw-bg-opacity: 1;
1245
+ background-color: rgb(220 73 73 / var(--tw-bg-opacity));
1246
+ }
1247
+
1200
1248
  .bg-valencia-600 {
1201
1249
  --tw-bg-opacity: 1;
1202
1250
  background-color: rgb(202 56 56 / var(--tw-bg-opacity));
@@ -1441,6 +1489,11 @@ video {
1441
1489
  color: rgb(17 24 39 / var(--tw-text-opacity));
1442
1490
  }
1443
1491
 
1492
+ .text-green-700 {
1493
+ --tw-text-opacity: 1;
1494
+ color: rgb(21 128 61 / var(--tw-text-opacity));
1495
+ }
1496
+
1444
1497
  .text-red-400 {
1445
1498
  --tw-text-opacity: 1;
1446
1499
  color: rgb(248 113 113 / var(--tw-text-opacity));
@@ -1456,6 +1509,11 @@ video {
1456
1509
  color: rgb(153 27 27 / var(--tw-text-opacity));
1457
1510
  }
1458
1511
 
1512
+ .text-sky-600 {
1513
+ --tw-text-opacity: 1;
1514
+ color: rgb(2 132 199 / var(--tw-text-opacity));
1515
+ }
1516
+
1459
1517
  .text-sky-800 {
1460
1518
  --tw-text-opacity: 1;
1461
1519
  color: rgb(7 89 133 / var(--tw-text-opacity));
@@ -1466,11 +1524,20 @@ video {
1466
1524
  color: rgb(0 168 165 / var(--tw-text-opacity));
1467
1525
  }
1468
1526
 
1527
+ .text-valencia-500 {
1528
+ --tw-text-opacity: 1;
1529
+ color: rgb(220 73 73 / var(--tw-text-opacity));
1530
+ }
1531
+
1469
1532
  .text-white {
1470
1533
  --tw-text-opacity: 1;
1471
1534
  color: rgb(255 255 255 / var(--tw-text-opacity));
1472
1535
  }
1473
1536
 
1537
+ .accent-sky-600 {
1538
+ accent-color: #0284c7;
1539
+ }
1540
+
1474
1541
  .shadow-lg {
1475
1542
  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
1476
1543
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
@@ -1535,6 +1602,10 @@ video {
1535
1602
  --tw-ring-color: rgb(17 24 39 / 0.05);
1536
1603
  }
1537
1604
 
1605
+ .ring-green-600\/20 {
1606
+ --tw-ring-color: rgb(22 163 74 / 0.2);
1607
+ }
1608
+
1538
1609
  .filter {
1539
1610
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1540
1611
  }
@@ -1597,6 +1668,11 @@ video {
1597
1668
  background-color: rgb(249 250 251 / var(--tw-bg-opacity));
1598
1669
  }
1599
1670
 
1671
+ .hover\:bg-gray-500:hover {
1672
+ --tw-bg-opacity: 1;
1673
+ background-color: rgb(107 114 128 / var(--tw-bg-opacity));
1674
+ }
1675
+
1600
1676
  .hover\:bg-gray-600:hover {
1601
1677
  --tw-bg-opacity: 1;
1602
1678
  background-color: rgb(75 85 99 / var(--tw-bg-opacity));
@@ -1612,6 +1688,11 @@ video {
1612
1688
  background-color: rgb(220 38 38 / var(--tw-bg-opacity));
1613
1689
  }
1614
1690
 
1691
+ .hover\:bg-slate-400:hover {
1692
+ --tw-bg-opacity: 1;
1693
+ background-color: rgb(148 163 184 / var(--tw-bg-opacity));
1694
+ }
1695
+
1615
1696
  .hover\:bg-slate-500:hover {
1616
1697
  --tw-bg-opacity: 1;
1617
1698
  background-color: rgb(100 116 139 / var(--tw-bg-opacity));
@@ -1637,6 +1718,11 @@ video {
1637
1718
  background-color: rgb(63 83 255 / var(--tw-bg-opacity));
1638
1719
  }
1639
1720
 
1721
+ .hover\:bg-valencia-400:hover {
1722
+ --tw-bg-opacity: 1;
1723
+ background-color: rgb(235 126 126 / var(--tw-bg-opacity));
1724
+ }
1725
+
1640
1726
  .hover\:bg-valencia-500:hover {
1641
1727
  --tw-bg-opacity: 1;
1642
1728
  background-color: rgb(220 73 73 / var(--tw-bg-opacity));
@@ -1681,25 +1767,21 @@ video {
1681
1767
  outline-color: #1823ff;
1682
1768
  }
1683
1769
 
1684
- .focus\:outline-ultramarine-50:focus {
1685
- outline-color: #f1f5ff;
1686
- }
1687
-
1688
1770
  .focus\:ring-0:focus {
1689
1771
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1690
1772
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1691
1773
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1692
1774
  }
1693
1775
 
1694
- .focus\:ring-2:focus {
1776
+ .focus\:ring-1:focus {
1695
1777
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1696
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1778
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1697
1779
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1698
1780
  }
1699
1781
 
1700
- .focus\:ring-1:focus {
1782
+ .focus\:ring-2:focus {
1701
1783
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1702
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1784
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1703
1785
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1704
1786
  }
1705
1787
 
@@ -1728,29 +1810,34 @@ video {
1728
1810
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity));
1729
1811
  }
1730
1812
 
1731
- .focus\:ring-white:focus {
1813
+ .focus\:ring-sky-600:focus {
1732
1814
  --tw-ring-opacity: 1;
1733
- --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));
1815
+ --tw-ring-color: rgb(2 132 199 / var(--tw-ring-opacity));
1734
1816
  }
1735
1817
 
1736
- .focus\:ring-ultramarine-50:focus {
1818
+ .focus\:ring-ultramarine-200:focus {
1737
1819
  --tw-ring-opacity: 1;
1738
- --tw-ring-color: rgb(241 245 255 / var(--tw-ring-opacity));
1820
+ --tw-ring-color: rgb(206 218 255 / var(--tw-ring-opacity));
1739
1821
  }
1740
1822
 
1741
- .focus\:ring-ultramarine-200:focus {
1823
+ .focus\:ring-ultramarine-500:focus {
1742
1824
  --tw-ring-opacity: 1;
1743
- --tw-ring-color: rgb(206 218 255 / var(--tw-ring-opacity));
1825
+ --tw-ring-color: rgb(63 83 255 / var(--tw-ring-opacity));
1744
1826
  }
1745
1827
 
1746
- .focus\:ring-offset-2:focus {
1747
- --tw-ring-offset-width: 2px;
1828
+ .focus\:ring-white:focus {
1829
+ --tw-ring-opacity: 1;
1830
+ --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));
1748
1831
  }
1749
1832
 
1750
1833
  .focus\:ring-offset-0:focus {
1751
1834
  --tw-ring-offset-width: 0px;
1752
1835
  }
1753
1836
 
1837
+ .focus\:ring-offset-2:focus {
1838
+ --tw-ring-offset-width: 2px;
1839
+ }
1840
+
1754
1841
  .focus\:ring-offset-gray-800:focus {
1755
1842
  --tw-ring-offset-color: #1f2937;
1756
1843
  }
@@ -1775,10 +1862,18 @@ video {
1775
1862
  outline-color: #16a34a;
1776
1863
  }
1777
1864
 
1865
+ .focus-visible\:outline-orange-400:focus-visible {
1866
+ outline-color: #fb923c;
1867
+ }
1868
+
1778
1869
  .focus-visible\:outline-red-600:focus-visible {
1779
1870
  outline-color: #dc2626;
1780
1871
  }
1781
1872
 
1873
+ .focus-visible\:outline-slate-400:focus-visible {
1874
+ outline-color: #94a3b8;
1875
+ }
1876
+
1782
1877
  .focus-visible\:outline-slate-600:focus-visible {
1783
1878
  outline-color: #475569;
1784
1879
  }
@@ -1791,6 +1886,15 @@ video {
1791
1886
  outline-color: #1823ff;
1792
1887
  }
1793
1888
 
1889
+ .disabled\:cursor-not-allowed:disabled {
1890
+ cursor: not-allowed;
1891
+ }
1892
+
1893
+ .disabled\:bg-gray-500:disabled {
1894
+ --tw-bg-opacity: 1;
1895
+ background-color: rgb(107 114 128 / var(--tw-bg-opacity));
1896
+ }
1897
+
1794
1898
  @media (min-width: 640px) {
1795
1899
  .sm\:-mx-6 {
1796
1900
  margin-left: -1.5rem;
@@ -15,7 +15,7 @@
15
15
  </button>
16
16
  </div>
17
17
  </div>
18
- <div v-if="!showEditor" class="mt-4 mb-4">
18
+ <div v-if="!showEditor" class="mt-4 mb-4">
19
19
  <dashboard-result :result="result"></dashboard-result>
20
20
  </div>
21
21
  <div v-if="showEditor">
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  </div>
41
41
  </div>
42
-
42
+
43
43
  </div>
44
44
  <div v-if="!dashboard && status === 'loaded'">
45
45
  No dashboard with the given id could be found.
@@ -34,7 +34,8 @@ module.exports = app => app.component('dashboard', {
34
34
  }
35
35
  },
36
36
  mounted: async function() {
37
- const { dashboard, result, error } = await api.Dashboard.getDashboard({ dashboardId: this.dashboardId, evaluate: true });
37
+ this.showEditor = this.$route.query.edit;
38
+ const { dashboard, result, error } = await api.Dashboard.getDashboard({ dashboardId: this.dashboardId, evaluate: !this.showEditor });
38
39
  if (!dashboard) {
39
40
  return;
40
41
  }
@@ -1,15 +1,20 @@
1
1
  <div class="p-4 bg-gray-100 rounded-lg shadow-lg">
2
- <div>
3
- <input v-model="title" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Title"/>
2
+ <div v-show="status === 'loading'" class="max-w-5xl mx-auto text-center">
3
+ <img src="images/loader.gif" class="inline mt-10">
4
4
  </div>
5
- <div>
6
- <textarea v-model="description" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" rows="4" placeholder="Description">{{description}}</textarea>
7
- </div>
8
- <div>
9
- <textarea ref="codeEditor" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" rows="6">{{code}}</textarea>
10
- </div>
11
- <div class="flex space-x-2">
12
- <button @click="updateCode" class="px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500">Submit</button>
13
- <button @click="closeEditor" class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500">Cancel</button>
5
+ <div v-show="status !== 'loading'">
6
+ <div>
7
+ <input v-model="title" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Title"/>
8
+ </div>
9
+ <div>
10
+ <textarea v-model="description" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" rows="4" placeholder="Description">{{description}}</textarea>
11
+ </div>
12
+ <div>
13
+ <textarea ref="codeEditor" class="w-full p-2 mb-4 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" rows="6">{{code}}</textarea>
14
+ </div>
15
+ <div class="flex space-x-2">
16
+ <async-button @click="updateCode" class="px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500">Submit</async-button>
17
+ <button @click="closeEditor" class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500">Cancel</button>
18
+ </div>
14
19
  </div>
15
20
  </div>
@@ -8,7 +8,7 @@ module.exports = app => app.component('edit-dashboard', {
8
8
  props: ['dashboardId', 'code', 'currentDescription', 'currentTitle'],
9
9
  data: function() {
10
10
  return {
11
- status: 'loading',
11
+ status: 'loaded',
12
12
  editor: null,
13
13
  title: '',
14
14
  description: ''
@@ -19,7 +19,7 @@ module.exports = app => app.component('edit-dashboard', {
19
19
  this.$emit('close')
20
20
  },
21
21
  async updateCode() {
22
- console.log('this.title', this.title, 'this.description', this.description)
22
+ this.status = 'loading';
23
23
  const { doc, result, error } = await api.Dashboard.updateDashboard({
24
24
  dashboardId: this.dashboardId,
25
25
  code: this.editor.getValue(),
@@ -28,6 +28,7 @@ module.exports = app => app.component('edit-dashboard', {
28
28
  });
29
29
  this.$emit('update', { doc, result, error });
30
30
  this.editor.setValue(doc.code);
31
+ this.status = 'loaded';
31
32
  this.closeEditor();
32
33
  }
33
34
  },
@@ -43,12 +44,7 @@ module.exports = app => app.component('edit-dashboard', {
43
44
  lineWrapping: true,
44
45
  showCursorWhenSelecting: true,
45
46
  });
46
- // this.editor.setValue(this.code);
47
- // this.editor.setSize(300, 300); // Ensure the editor has a fixed height
48
-
49
- // this.editor.setCursor(this.editor.lineCount() - 1, this.editor.getLine(this.editor.lineCount() - 1).length);
50
-
51
- this.editor.focus();
47
+ // this.editor.focus();
52
48
  // this.editor.refresh(); // if anything weird happens on load, this usually fixes it. However, this breaks it in this case.
53
49
  this.description = this.currentDescription;
54
50
  this.title = this.currentTitle;
@@ -15,7 +15,7 @@ module.exports = app => app.component('dashboard-document', {
15
15
  return null;
16
16
  },
17
17
  schemaPaths() {
18
- return Object.keys(this.value.$document?.schemaPaths || {}).sort((k1, k2) => {
18
+ return Object.keys(this.value?.$document?.schemaPaths || {}).sort((k1, k2) => {
19
19
  if (k1 === '_id' && k2 !== '_id') {
20
20
  return -1;
21
21
  }
@@ -23,7 +23,7 @@ module.exports = app => app.component('dashboard-document', {
23
23
  return 1;
24
24
  }
25
25
  return 0;
26
- }).map(key => this.value.$document.schemaPaths[key]);
26
+ }).map(key => this.value?.$document.schemaPaths[key]);
27
27
  }
28
28
  }
29
29
  });
@@ -4,6 +4,7 @@ if (typeof process === 'undefined') {
4
4
  global.process = { env: {} }; // To make `util` package work
5
5
  }
6
6
 
7
+ const api = require('./api');
7
8
  const mothership = require('./mothership');
8
9
  const vanillatoasts = require('vanillatoasts');
9
10
 
@@ -51,8 +52,8 @@ require('./team/new-invitation/new-invitation')(app);
51
52
  app.component('app-component', {
52
53
  template: `
53
54
  <div>
54
- <div v-if="hasAPIKey && user == null">
55
- <splash />
55
+ <div v-if="hasAPIKey && (user == null || status === 'init')">
56
+ <splash :loading="status === 'init'" />
56
57
  </div>
57
58
  <div v-else-if="!hasAPIKey || user">
58
59
  <navbar :user="user" :roles="roles" />
@@ -79,19 +80,45 @@ app.component('app-component', {
79
80
  window.$router = this.$router;
80
81
 
81
82
  if (mothership.hasAPIKey) {
82
- const token = window.localStorage.getItem('_mongooseStudioAccessToken');
83
- if (token) {
84
- const { user, roles } = await mothership.me();
83
+ const href = window.location.href;
84
+ if (href.match(/\?code=([a-zA-Z0-9]+)$/)) {
85
+ const code = href.match(/\?code=([a-zA-Z0-9]+)$/)[1];
86
+ const { accessToken, user, roles } = await mothership.github(code);
87
+ if (roles == null) {
88
+ this.authError = 'You are not authorized to access this workspace';
89
+ return;
90
+ }
85
91
  this.user = user;
86
92
  this.roles = roles;
93
+ window.localStorage.setItem('_mongooseStudioAccessToken', accessToken._id);
94
+
95
+ const { nodeEnv } = await api.status();
96
+ this.nodeEnv = nodeEnv;
97
+ } else {
98
+ const token = window.localStorage.getItem('_mongooseStudioAccessToken');
99
+ if (token) {
100
+ const { user, roles } = await mothership.me();
101
+ this.user = user;
102
+ this.roles = roles;
103
+
104
+ const { nodeEnv } = await api.status();
105
+ this.nodeEnv = nodeEnv;
106
+ }
87
107
  }
108
+ } else {
109
+ const { nodeEnv } = await api.status();
110
+ this.nodeEnv = nodeEnv;
88
111
  }
112
+ this.status = 'loaded';
89
113
  },
90
114
  setup() {
91
115
  const user = Vue.ref(null);
92
116
  const roles = Vue.ref(null);
117
+ const status = Vue.ref('init');
118
+ const nodeEnv = Vue.ref(null);
119
+ const authError = Vue.ref(null);
93
120
 
94
- const state = Vue.reactive({ user, roles });
121
+ const state = Vue.reactive({ user, roles, status, nodeEnv, authError });
95
122
  Vue.provide('state', state);
96
123
 
97
124
  return state;
@@ -92,3 +92,7 @@
92
92
  justify-content: center;
93
93
  padding-bottom: 0.25em;
94
94
  }
95
+
96
+ .modal-container .modal-exit:hover {
97
+ background-color: #f1f5ff;
98
+ }
@@ -28,7 +28,7 @@
28
28
  <div class="documents-menu">
29
29
  <div class="flex flex-row items-center w-full gap-2">
30
30
  <form @submit.prevent="search" class="flex-grow m-0">
31
- <input class="w-full rounded-md p-1 outline-gray-300 text-lg focus:ring-1 focus:ring-ultramarine-200 focus:ring-offset-0 focus:outline-none" type="text" placeholder="Filter or text" v-model="searchText" />
31
+ <input class="w-full rounded-md p-1 border border-gray-300 outline-gray-300 text-lg focus:ring-1 focus:ring-ultramarine-200 focus:ring-offset-0 focus:outline-none" type="text" placeholder="Filter or text" v-model="searchText" />
32
32
  </form>
33
33
  <div>
34
34
  <span v-if="status === 'loading'">Loading ...</span>
@@ -47,7 +47,7 @@
47
47
  Create
48
48
  </button>
49
49
  <button
50
- @click="shouldShowFieldModal = true"
50
+ @click="openFieldSelection"
51
51
  type="button"
52
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
@@ -121,15 +121,16 @@
121
121
  <modal v-if="shouldShowFieldModal">
122
122
  <template v-slot:body>
123
123
  <div class="modal-exit" @click="shouldShowFieldModal = false; selectedPaths = [...filteredPaths];">&times;</div>
124
- <div v-for="(path, index) in schemaPaths" :key="index" style="margin-bottom: 0.5em">
125
- <input type="checkbox" :id="'path.path'+index" @change="addOrRemove(path)" :value="path.path" :checked="isSelected(path.path)" />
126
- <label :for="'path' + index">{{path.path}}</label>
124
+ <div v-for="(path, index) in schemaPaths" :key="index" class="w-5 flex items-center">
125
+ <input class="mt-0 h-4 w-4 rounded border-gray-300 text-sky-600 focus:ring-sky-600 accent-sky-600" type="checkbox" :id="'path.path'+index" @change="addOrRemove(path)" :value="path.path" :checked="isSelected(path.path)" />
126
+ <div class="ml-2 text-gray-700 grow shrink text-left">
127
+ <label :for="'path' + index">{{path.path}}</label>
128
+ </div>
127
129
  </div>
128
- <div style="margin-top: 1em">
129
- <button type="submit" @click="filterDocuments()" style="color: black;margin-right: 0.5em">Filter Selection</button>
130
- <button type="submit" @click="deselectAll()" class="gray" style="margin-right: 0.5em">Deselect All</button>
131
- <button type="submit" @click="resetDocuments()" class="gray">Cancel</button>
132
-
130
+ <div class="mt-4 flex gap-2">
131
+ <button type="submit" @click="filterDocuments()" 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">Filter Selection</button>
132
+ <button type="submit" @click="deselectAll()" 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">Deselect All</button>
133
+ <button type="submit" @click="resetDocuments()" class="rounded-md bg-gray-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-gray-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600" >Cancel</button>
133
134
  </div>
134
135
  </template>
135
136
  </modal>
@@ -211,8 +211,25 @@ module.exports = app => app.component('models', {
211
211
  }).map(key => this.selectedPaths[key]);
212
212
  }
213
213
  },
214
+ openFieldSelection() {
215
+ if (this.$route.query?.fields) {
216
+ this.selectedPaths.length = 0;
217
+ console.log('there are fields in play', this.$route.query.fields)
218
+ const fields = this.$route.query.fields.split(',');
219
+ for (let i = 0; i < fields.length; i++) {
220
+ this.selectedPaths.push({ path: fields[i] });
221
+ }
222
+ } else {
223
+ this.selectedPaths = [{ path: '_id' }];
224
+ }
225
+ this.shouldShowFieldModal = true;
226
+ },
214
227
  filterDocuments() {
215
- this.filteredPaths = [...this.selectedPaths];
228
+ if (this.selectedPaths.length > 0) {
229
+ this.filteredPaths = [...this.selectedPaths];
230
+ } else {
231
+ this.filteredPaths.length = 0;
232
+ }
216
233
  this.shouldShowFieldModal = false;
217
234
  const selectedParams = this.filteredPaths.map(x => x.path).join(',');
218
235
  this.query.fields = selectedParams;
@@ -24,16 +24,24 @@ exports.getWorkspaceTeam = function getWorkspaceTeam() {
24
24
  return client.post('/getWorkspaceTeam', { workspaceId: config__workspace._id }).then(res => res.data);
25
25
  };
26
26
 
27
- exports.inviteToWorkspace = function inviteToWorkspace(params) {
28
- return client.post('/inviteToWorkspace', { workspaceId: config__workspace._id, ...params }).then(res => res.data);
27
+ exports.getWorkspaceCustomerPortalLink = function getWorkspaceCustomerPortalLink(params) {
28
+ return client.post('/getWorkspaceCustomerPortalLink', { workspaceId: config__workspace._id, ...params }).then(res => res.data);
29
29
  };
30
30
 
31
31
  exports.github = function github(code) {
32
32
  return client.post('/github', { code, workspaceId: config__workspace._id }).then(res => res.data);
33
33
  };
34
34
 
35
+ exports.inviteToWorkspace = function inviteToWorkspace(params) {
36
+ return client.post('/inviteToWorkspace', { workspaceId: config__workspace._id, ...params }).then(res => res.data);
37
+ };
38
+
35
39
  exports.me = function me() {
36
40
  return client.post('/me', { workspaceId: config__workspace._id }).then(res => res.data);
37
41
  };
38
42
 
43
+ exports.removeFromWorkspace = function removeFromWorkspace(params) {
44
+ return client.post('/removeFromWorkspace', { workspaceId: config__workspace._id, ...params }).then(res => res.data);
45
+ };
46
+
39
47
  exports.hasAPIKey = client.hasAPIKey;
@@ -3,8 +3,8 @@
3
3
  <router-link to="/">
4
4
  <img src="images/logo.svg" alt="Mongoose Studio Logo" />
5
5
  </router-link>
6
- <div v-if="!!nodeEnv" class="inline-flex items-center rounded-md px-2 py-1 text-sm font-medium text-gray-900" :class="warnEnv ? 'bg-red-300' : 'bg-yellow-300'">
7
- {{nodeEnv}}
6
+ <div v-if="!!state.nodeEnv" class="inline-flex items-center rounded-md px-2 py-1 text-sm font-medium text-gray-900" :class="warnEnv ? 'bg-red-300' : 'bg-yellow-300'">
7
+ {{state.nodeEnv}}
8
8
  </div>
9
9
  </div>
10
10
  <div class="nav-right h-full">
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
 
38
38
  <div v-if="showFlyout" class="absolute right-0 z-10 top-[90%] 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
- <router-link to="team" v-if="canViewTeam" @click="showFlyout = false" 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">Team</router-link>
39
+ <router-link to="/team" v-if="canViewTeam" @click="showFlyout = false" 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">Team</router-link>
40
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
41
  </div>
42
42
  </div>