@fishawack/lab-velocity 1.11.1 → 2.0.0-beta.10

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.
Files changed (138) hide show
  1. package/README.md +177 -49
  2. package/_Build/vue/components/Icon.vue +33 -0
  3. package/_Build/vue/components/Svg.vue +45 -0
  4. package/{basic → _Build/vue/components/basic}/Button.vue +17 -19
  5. package/{basic → _Build/vue/components/basic}/link.vue +8 -7
  6. package/{form → _Build/vue/components/form}/Cascader.vue +13 -13
  7. package/{form → _Build/vue/components/form}/CheckboxGroup.vue +28 -6
  8. package/{form → _Build/vue/components/form}/DatePicker.vue +23 -7
  9. package/{form → _Build/vue/components/form}/InputNumber.vue +1 -2
  10. package/{form → _Build/vue/components/form}/Select.vue +10 -11
  11. package/_Build/vue/components/form/Spinner.vue +5 -0
  12. package/{form → _Build/vue/components/form}/Switch.vue +2 -2
  13. package/{form → _Build/vue/components/form}/Upload.vue +4 -6
  14. package/{form → _Build/vue/components/form}/Wysiwyg.vue +14 -14
  15. package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
  16. package/{form → _Build/vue/components/form}/basic.vue +25 -7
  17. package/{form → _Build/vue/components/form}/file.vue +1 -1
  18. package/{form → _Build/vue/components/form}/input.js +2 -2
  19. package/{form → _Build/vue/components/form}/input.vue +31 -11
  20. package/{layout → _Build/vue/components/layout}/Alert.vue +10 -10
  21. package/_Build/vue/components/layout/Footer.vue +50 -0
  22. package/{layout → _Build/vue/components/layout}/Header.vue +5 -7
  23. package/_Build/vue/components/layout/Loader.vue +59 -0
  24. package/{layout → _Build/vue/components/layout}/Tooltip.vue +12 -12
  25. package/{layout → _Build/vue/components/layout}/pageTitle.vue +4 -4
  26. package/{layout → _Build/vue/components/layout}/sideBar.vue +4 -6
  27. package/{navigation → _Build/vue/components/navigation}/Breadcrumbs.vue +15 -10
  28. package/{navigation → _Build/vue/components/navigation}/BreadcrumbsItem.vue +6 -6
  29. package/_Build/vue/components/navigation/Menu.vue +14 -0
  30. package/_Build/vue/components/navigation/MenuItem.vue +20 -0
  31. package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
  32. package/_Build/vue/components/navigation/SubMenu.vue +20 -0
  33. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +259 -0
  34. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
  35. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
  36. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
  37. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +181 -0
  38. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +267 -0
  39. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
  40. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +113 -0
  41. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +101 -0
  42. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
  43. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +174 -0
  44. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +123 -0
  45. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
  46. package/{AuthModule → _Build/vue/modules/AuthModule}/components/AuthModal.vue +30 -35
  47. package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
  48. package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
  49. package/_Build/vue/modules/AuthModule/components/FormRole.vue +117 -0
  50. package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +33 -0
  51. package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +52 -0
  52. package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
  53. package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
  54. package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
  55. package/_Build/vue/modules/AuthModule/components/VTable.vue +136 -0
  56. package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +252 -0
  57. package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
  58. package/_Build/vue/modules/AuthModule/js/axios.js +81 -0
  59. package/_Build/vue/modules/AuthModule/js/router.js +295 -0
  60. package/_Build/vue/modules/AuthModule/js/store.js +62 -0
  61. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/account-exists.vue +6 -8
  62. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/change-password.vue +39 -38
  63. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/container.vue +4 -8
  64. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-reset.vue +17 -15
  65. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-verification.vue +21 -20
  66. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/force-reset.vue +45 -40
  67. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/forgot.vue +15 -11
  68. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/login.vue +27 -26
  69. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logincallback.vue +6 -13
  70. package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
  71. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/loginsso.vue +34 -29
  72. package/_Build/vue/modules/AuthModule/routes/logout.vue +19 -0
  73. package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +25 -0
  74. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/register.vue +52 -37
  75. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/reset.vue +29 -19
  76. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-forgot.vue +22 -19
  77. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-reset.vue +6 -6
  78. package/_Build/vue/modules/AuthModule/routes/success-verify.vue +30 -0
  79. package/{AuthModule → _Build/vue/modules/AuthModule}/routes/verify.vue +26 -26
  80. package/_base.scss +0 -1
  81. package/_defaults.scss +3 -15
  82. package/_variables.scss +24 -21
  83. package/components/_alert.scss +2 -2
  84. package/components/_auth.scss +163 -0
  85. package/components/_basic.scss +5 -4
  86. package/components/_breadcrumbs.scss +7 -8
  87. package/components/_button.scss +11 -12
  88. package/components/_cascader.scss +1 -1
  89. package/components/_checkbox.scss +27 -26
  90. package/components/_chip.scss +24 -0
  91. package/components/_collapse.scss +2 -3
  92. package/components/_datepicker.scss +7 -6
  93. package/components/_footer.scss +1 -1
  94. package/components/_form.scss +6 -4
  95. package/components/_header.scss +4 -5
  96. package/components/_icon.scss +4 -3
  97. package/components/_inputNumber.scss +4 -3
  98. package/components/_link.scss +7 -7
  99. package/components/_loader.scss +3 -4
  100. package/components/_menu.scss +22 -22
  101. package/{modules → components}/_modal.scss +3 -3
  102. package/components/_pageTitle.scss +3 -3
  103. package/components/_permissionLegend.scss +18 -0
  104. package/components/_select.scss +3 -2
  105. package/components/_sidebar.scss +5 -6
  106. package/components/_switch.scss +2 -2
  107. package/components/_table.scss +3 -3
  108. package/components/_tooltip.scss +2 -2
  109. package/components/_typography.scss +71 -62
  110. package/components/_upload.scss +1 -1
  111. package/components/_wysiwyg.scss +3 -2
  112. package/components/_wysiwyg2.scss +37 -31
  113. package/general.scss +1 -2
  114. package/index.js +38 -30
  115. package/package.json +104 -102
  116. package/vendor.scss +2 -3
  117. package/AuthModule/components/VPasswordValidation.vue +0 -66
  118. package/AuthModule/js/AuthAxios.js +0 -59
  119. package/AuthModule/js/AuthRoutes.js +0 -186
  120. package/AuthModule/js/AuthStore.js +0 -99
  121. package/AuthModule/js/FakeAPI.js +0 -84
  122. package/AuthModule/routes/loginheadless.vue +0 -16
  123. package/AuthModule/routes/logout.vue +0 -21
  124. package/AuthModule/routes/success-verify.vue +0 -29
  125. package/Icon.vue +0 -33
  126. package/Svg.vue +0 -40
  127. package/components/_input.scss +0 -0
  128. package/form/Wysiwyg2.vue +0 -278
  129. package/layout/Footer.vue +0 -35
  130. package/layout/Loader.vue +0 -39
  131. package/modules/_AuthModule.scss +0 -209
  132. package/modules/_AuthVariables.scss +0 -7
  133. package/navigation/Menu.vue +0 -16
  134. package/navigation/MenuItem.vue +0 -20
  135. package/navigation/MenuItemGroup.vue +0 -20
  136. package/navigation/SubMenu.vue +0 -20
  137. /package/{form → _Build/vue/components/form}/Checkbox.vue +0 -0
  138. /package/{form → _Build/vue/components/form}/color.vue +0 -0
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <h1 class="h2 h2--small">Sign in</h1>
3
- <p class="AM-mb-3 AM-mt-2">Enter your password to continue.</p>
3
+ <p class="mb-3 mt-2">Enter your password to continue.</p>
4
4
 
5
5
  <form @submit.prevent="submit" class="form" id="memberLoginForm">
6
6
  <el-input
7
- class="AM-mb-3"
7
+ class="mb-3"
8
8
  label="Email"
9
9
  placeholder="Enter your email address"
10
10
  name="email"
@@ -15,7 +15,7 @@
15
15
  />
16
16
 
17
17
  <el-input
18
- class="AM-mb-3"
18
+ class="mb-3"
19
19
  label="Password"
20
20
  placeholder="Enter your password"
21
21
  name="password"
@@ -37,20 +37,28 @@
37
37
  </div>
38
38
 
39
39
  <el-button
40
+ native-type="submit"
40
41
  type="primary"
41
- :disabled="loading || (form.email?.length < 5 || form.password?.length < 8 )"
42
+ :disabled="
43
+ loading || form.email?.length < 5 || form.password?.length < 8
44
+ "
42
45
  @click="onSubmit"
43
46
  >
44
47
  Continue
45
48
  </el-button>
46
49
 
47
- <p class="disclaimer AM-mt-3">
50
+ <p class="disclaimer mt-3">
48
51
  Having trouble signing in?
49
- <router-link class="color-1 underline" :to="{ name: `${$store.state.auth.authBase}.forgot` }">
52
+ <router-link
53
+ class="color-1 underline"
54
+ :to="{ name: 'auth.forgot' }"
55
+ >
50
56
  Reset password
51
57
  </router-link>
52
58
  or
53
- <a :href="contact" class="underline">Contact us</a>
59
+ <a :href="$store.state.auth.contact" class="underline"
60
+ >Contact us</a
61
+ >
54
62
  </p>
55
63
  </form>
56
64
  </template>
@@ -60,25 +68,24 @@ import Form from "form-backend-validation";
60
68
 
61
69
  export default {
62
70
  components: {
63
- elInput: require('../../form/basic.vue').default,
64
- elButton: require('../../basic/Button.vue').default,
71
+ elInput: require("../../../components/form/basic.vue").default,
72
+ elButton: require("../../../components/basic/Button.vue").default,
65
73
  },
66
74
  data() {
67
75
  return {
68
76
  form: new Form(
69
77
  {
70
- email: this.$route.query.email ?? '',
71
- password: '',
78
+ email: this.$route.query.email ?? "",
79
+ password: "",
72
80
  device_name: "Mobile device",
73
81
  remember: true,
74
82
  },
75
- { resetOnSuccess: false }
83
+ { resetOnSuccess: false },
76
84
  ),
77
85
  loading: false,
78
- contact: process.env.HYDRATE_CONTACT ?? 'mailto:EP@avalerehealth.com',
79
86
  };
80
87
  },
81
-
88
+
82
89
  methods: {
83
90
  async onSubmit() {
84
91
  if (this.loading) return;
@@ -90,9 +97,7 @@ export default {
90
97
 
91
98
  if (res["logged-in"]) {
92
99
  try {
93
- await this.$store.dispatch("logout", {
94
- errors: this.$root.errors,
95
- });
100
+ await this.$store.dispatch("logout");
96
101
  } catch (e) {}
97
102
 
98
103
  await this.form.post("/login");
@@ -100,18 +105,14 @@ export default {
100
105
 
101
106
  await this.postLogin();
102
107
  } catch (e) {
103
- this.$root.errors(e);
108
+ console.log(e);
104
109
  } finally {
105
110
  this.loading = false;
106
111
  }
107
112
  },
108
113
 
109
114
  async postLogin() {
110
- this.$store.commit("setAuth", true);
111
-
112
- const { data: user } = await this.$store.dispatch("getUser", {
113
- errors: this.$root.errors,
114
- });
115
+ const { data: user } = await this.$store.dispatch("getUser");
115
116
 
116
117
  if (window.dataLayer) {
117
118
  window.dataLayer.push({ event: "login", user });
@@ -120,9 +121,9 @@ export default {
120
121
  if (this.$store.state.auth.intended) {
121
122
  this.$router.push(this.$store.state.auth.intended);
122
123
  } else {
123
- this.$router.push({ name: this.$store.state.auth.postLoginRedirect });
124
- // this.$router.push({ name: "members" });
125
- // Problem here
124
+ this.$router.push({
125
+ name: this.$store.state.auth.redirect,
126
+ });
126
127
  }
127
128
 
128
129
  this.$store.commit("setIntended", null);
@@ -1,29 +1,22 @@
1
1
  <template>
2
2
  <!-- Set Spinner -->
3
- <div class="mx-auto">
3
+ <div class="mx-auto">
4
4
  <VLoader class="mx-auto" />
5
- </div>
5
+ </div>
6
6
  </template>
7
7
 
8
8
  <script>
9
-
10
9
  export default {
11
10
  components: {
12
- VLoader: require("../../layout/Loader.vue").default
11
+ VLoader: require("../../../components/layout/Loader.vue").default,
13
12
  },
14
13
  data() {
15
- return {
16
-
17
- }
14
+ return {};
18
15
  },
19
-
16
+
20
17
  methods: {
21
18
  async postLogin() {
22
- this.$store.commit("setAuth", true);
23
-
24
- const { data: user } = await this.$store.dispatch("getUser", {
25
- errors: this.$root.errors,
26
- });
19
+ const { data: user } = await this.$store.dispatch("getUser");
27
20
 
28
21
  if (window.dataLayer) {
29
22
  window.dataLayer.push({ event: "login", user });
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <!-- Set Spinner -->
3
+ <div class="mx-auto">
4
+ <VLoader class="mx-auto" />
5
+ <p v-text="`Logging in...`" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ mounted() {
12
+ const { authenticated } = this.$store.getters;
13
+
14
+ if (!authenticated) {
15
+ window.location = `${process.env.APP_URL}/hydrate/sso/redirect`;
16
+ } else {
17
+ window.location = `${process.env.APP_URL}/`;
18
+ }
19
+ },
20
+ };
21
+ </script>
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <template v-if="stage === 1">
3
3
  <h1 class="h2 h2--small">Sign in</h1>
4
- <p class="AM-mb-3 AM-mt-2">Enter your email address to continue. </p>
4
+ <p class="mb-3 mt-2">Enter your email address to continue.</p>
5
5
 
6
6
  <form @submit.prevent="submit" class="form" id="memberLoginForm">
7
7
  <el-input
8
- class="AM-mb-3"
8
+ class="mb-3"
9
9
  label="Email"
10
10
  placeholder="Enter your email address"
11
11
  name="email"
@@ -27,23 +27,29 @@
27
27
  </div>
28
28
 
29
29
  <el-button
30
+ native-type="submit"
30
31
  type="primary"
31
- :disabled="loading || (!isValidEmail(form.email))"
32
+ :disabled="loading || !isValidEmail(form.email)"
32
33
  @click="onSubmit"
33
34
  >
34
35
  Continue
35
36
  </el-button>
36
37
 
37
- <p class="disclaimer AM-mt-3">
38
+ <p class="disclaimer mt-3">
38
39
  Having trouble signing in?
39
- <a :href="contact" class="underline">Contact us</a>
40
+ <a :href="$store.state.auth.contact" class="underline"
41
+ >Contact us</a
42
+ >
40
43
  </p>
41
44
  </form>
42
45
  </template>
43
46
  <template v-else>
44
47
  <h1 class="h2 h2--small">Sign in with SSO</h1>
45
- <p class="AM-mt-2">Redirecting you to your organisation’s Single Sign-On (SSO) gateway <span class="AM-color-highlight">in {{ countdown }} seconds...</span></p>
46
- <p class="disclaimer AM-mt-3">
48
+ <p class="mt-2">
49
+ Redirecting you to your organisation’s Single Sign-On (SSO) gateway
50
+ <span class="color-highlight">in {{ countdown }} seconds...</span>
51
+ </p>
52
+ <p class="disclaimer mt-3">
47
53
  <a :href="redirect_url" class="underline">Go to SSO gateway</a>
48
54
  </p>
49
55
  </template>
@@ -54,27 +60,26 @@ import Form from "form-backend-validation";
54
60
 
55
61
  export default {
56
62
  components: {
57
- elInput: require('../../form/basic.vue').default,
58
- elButton: require('../../basic/Button.vue').default,
63
+ elInput: require("../../../components/form/basic.vue").default,
64
+ elButton: require("../../../components/basic/Button.vue").default,
59
65
  },
60
66
  data() {
61
67
  return {
62
68
  form: new Form(
63
69
  {
64
- email: '',
70
+ email: "",
65
71
  device_name: "Mobile device",
66
72
  remember: true,
67
73
  },
68
- { resetOnSuccess: false }
74
+ { resetOnSuccess: false },
69
75
  ),
70
76
  countdown: 3,
71
77
  loading: false,
72
78
  redirect_url: null,
73
79
  stage: 1,
74
- contact: process.env.HYDRATE_CONTACT ?? 'mailto:EP@avalerehealth.com',
75
80
  };
76
81
  },
77
-
82
+
78
83
  methods: {
79
84
  async onSubmit() {
80
85
  if (this.loading) return;
@@ -82,46 +87,46 @@ export default {
82
87
  this.loading = true;
83
88
 
84
89
  try {
85
- const res = await this.form.post(`/sso`);
86
- if(res['redirect_url']) {
87
- this.redirect_url = res['redirect_url'];
90
+ const res = await this.form.post(`/hydrate/sso/check`);
91
+ if (res["redirect_url"]) {
92
+ this.redirect_url = res["redirect_url"];
88
93
  this.setRedirect();
89
94
  } else {
90
- this.$router.push({name: `${this.$store.state.auth.authBase}.logincreds`,query: {email: this.form.email}});
95
+ this.$router.push({
96
+ name: "auth.logincreds",
97
+ query: { email: this.form.email },
98
+ });
91
99
  }
92
100
  } catch (e) {
93
- this.$root.errors(e);
101
+ console.log(e);
94
102
  } finally {
95
103
  this.loading = false;
96
104
  }
97
105
  },
98
- setRedirect(){
106
+ setRedirect() {
99
107
  this.stage = 2;
100
108
  let vue = this;
101
- setTimeout(function() {
109
+ setTimeout(function () {
102
110
  vue.setCountdown();
103
- },1000);
111
+ }, 1000);
104
112
  },
105
113
  setCountdown() {
106
114
  this.countdown--;
107
- if(this.countdown === 0) {
115
+ if (this.countdown === 0) {
108
116
  window.location = this.redirect_url;
109
117
  } else {
110
118
  let vue = this;
111
- setTimeout(function() {
119
+ setTimeout(function () {
112
120
  vue.setCountdown();
113
- },1000);
121
+ }, 1000);
114
122
  }
115
123
  },
116
124
  isValidEmail(email) {
117
125
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
118
126
  return emailRegex.test(email);
119
- }
120
-
127
+ },
121
128
  },
122
129
 
123
- mounted() {
124
-
125
- },
130
+ mounted() {},
126
131
  };
127
132
  </script>
@@ -0,0 +1,19 @@
1
+ <script>
2
+ export default {
3
+ metaInfo() {
4
+ return {
5
+ title: "Logout",
6
+ };
7
+ },
8
+
9
+ async mounted() {
10
+ try {
11
+ await this.$store.dispatch("logout");
12
+ } catch {
13
+ /* empty */
14
+ } finally {
15
+ this.$router.push({ name: "auth.login" });
16
+ }
17
+ },
18
+ };
19
+ </script>
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <p v-text="done ? 'Logged out' : 'Logging out...'" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ metaInfo() {
8
+ return {
9
+ title: "Logout",
10
+ };
11
+ },
12
+
13
+ data: () => ({
14
+ done: false,
15
+ }),
16
+
17
+ async mounted() {
18
+ try {
19
+ await this.$store.dispatch("logout");
20
+ } finally {
21
+ this.done = true;
22
+ }
23
+ },
24
+ };
25
+ </script>
@@ -1,10 +1,16 @@
1
1
  <template>
2
2
  <h1 class="h2 h2--small">Register</h1>
3
- <p class="AM-mb-3 AM-mt-2">Please enter your personal details to complete your registration.</p>
4
-
5
- <form @submit.prevent="submit" :class="form.errors && form.errors.any() ? 'form error' : 'form'" id="memberLoginForm">
3
+ <p class="mb-3 mt-2">
4
+ Please enter your personal details to complete your registration.
5
+ </p>
6
+
7
+ <form
8
+ @submit.prevent="submit"
9
+ :class="form.errors && form.errors.any() ? 'form error' : 'form'"
10
+ id="memberLoginForm"
11
+ >
6
12
  <el-input
7
- class="AM-mb-2"
13
+ class="mb-2"
8
14
  label="Full name"
9
15
  placeholder="Enter your full name"
10
16
  name="name"
@@ -12,9 +18,9 @@
12
18
  v-model="form.name"
13
19
  :error="form.errors"
14
20
  />
15
-
21
+
16
22
  <el-input
17
- class="AM-mb-2"
23
+ class="mb-2"
18
24
  label="Email"
19
25
  placeholder="Enter your email address"
20
26
  name="email"
@@ -25,7 +31,7 @@
25
31
  />
26
32
 
27
33
  <el-input
28
- class="AM-mb-2"
34
+ class="mb-2"
29
35
  label="Password"
30
36
  name="password"
31
37
  placeholder="Create a unique password"
@@ -36,7 +42,10 @@
36
42
  :error="form.errors"
37
43
  />
38
44
 
39
- <VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
45
+ <VPasswordValidation
46
+ :password="form.password"
47
+ @passwordValid="updatePasswordValidity"
48
+ />
40
49
 
41
50
  <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
42
51
  <div style="position: absolute; left: -5000px" aria-hidden="true">
@@ -50,40 +59,48 @@
50
59
  </div>
51
60
 
52
61
  <elButton
62
+ native-type="submit"
53
63
  type="primary"
54
- :disabled="loading || (form.name?.length < 1 || form.email?.length < 5 || !isPasswordValid)"
64
+ :disabled="
65
+ loading ||
66
+ form.name?.length < 1 ||
67
+ form.email?.length < 5 ||
68
+ !isPasswordValid
69
+ "
55
70
  @click="onSubmit"
56
71
  >
57
72
  Register
58
73
  </elButton>
59
74
 
60
- <p class="disclaimer AM-mt-3">
75
+ <p class="disclaimer mt-3">
61
76
  Having trouble registering?
62
- <a :href="contact" class="underline">Contact us</a>
77
+ <a :href="$store.state.auth.contact" class="underline"
78
+ >Contact us</a
79
+ >
63
80
  </p>
64
81
  </form>
65
82
  </template>
66
83
 
67
84
  <script>
68
85
  import Form from "form-backend-validation";
86
+ import { ElNotification } from "element-plus";
69
87
 
70
88
  export default {
71
89
  data() {
72
90
  return {
73
91
  form: new Form(
74
92
  {
75
- name: '',
76
- email: '',
77
- password: '',
93
+ name: "",
94
+ email: "",
95
+ password: "",
78
96
  },
79
- { resetOnSuccess: false }
97
+ { resetOnSuccess: false },
80
98
  ),
81
99
  loading: false,
82
100
  isPasswordValid: false,
83
- contact: process.env.HYDRATE_CONTACT ?? 'mailto:EP@avalerehealth.com',
84
101
  };
85
102
  },
86
-
103
+
87
104
  methods: {
88
105
  async onSubmit() {
89
106
  if (this.loading) return;
@@ -95,39 +112,34 @@ export default {
95
112
 
96
113
  if (res["logged-in"]) {
97
114
  try {
98
- await this.$store.dispatch("logout", {
99
- errors: this.$root.errors,
100
- });
115
+ await this.$store.dispatch("logout");
101
116
  } catch (e) {}
102
117
 
103
118
  await this.form.post("/register");
104
-
105
119
  }
106
- if(res['redirect']) {
120
+ if (res["redirect"]) {
107
121
  // Redirect here
108
- this.$router.push({ name: `${this.$store.state.auth.authBase}.login`, query: {company:res['company']} });
109
- this.$notify.error({
122
+ this.$router.push({
123
+ name: `auth.login`,
124
+ query: { company: res["company"] },
125
+ });
126
+ ElNotification.error({
110
127
  title: "Domain is SSO enabled",
111
- message:"Sign in with your company email address",
128
+ message: "Sign in with your company email address",
112
129
  duration: 10000,
113
130
  });
114
- } else {
131
+ } else {
115
132
  await this.postLogin();
116
133
  }
117
-
118
134
  } catch (e) {
119
- this.$root.errors(e);
135
+ console.log(e);
120
136
  } finally {
121
137
  this.loading = false;
122
138
  }
123
139
  },
124
140
 
125
141
  async postLogin() {
126
- this.$store.commit("setAuth", true);
127
-
128
- const { data: user } = await this.$store.dispatch("getUser", {
129
- errors: this.$root.errors,
130
- });
142
+ const { data: user } = await this.$store.dispatch("getUser");
131
143
 
132
144
  if (window.dataLayer) {
133
145
  window.dataLayer.push({ event: "login", user });
@@ -136,7 +148,9 @@ export default {
136
148
  if (this.$store.state.auth.intended) {
137
149
  this.$router.push(this.$store.state.auth.intended);
138
150
  } else {
139
- this.$router.push({ name: `${this.$store.state.auth.authBase}.verify` });
151
+ this.$router.push({
152
+ name: `auth.verify`,
153
+ });
140
154
  // Problem Here
141
155
  }
142
156
 
@@ -148,9 +162,10 @@ export default {
148
162
  },
149
163
 
150
164
  components: {
151
- VPasswordValidation: require("./../components/VPasswordValidation.vue").default,
152
- elInput: require('../../form/basic.vue').default,
153
- elButton: require('../../basic/Button.vue').default,
165
+ VPasswordValidation: require("./../components/VPasswordValidation.vue")
166
+ .default,
167
+ elInput: require("../../../components/form/basic.vue").default,
168
+ elButton: require("../../../components/basic/Button.vue").default,
154
169
  },
155
170
  };
156
171
  </script>