@fishawack/lab-velocity 2.0.0-beta.5 → 2.0.0-beta.50

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 (111) hide show
  1. package/README.md +467 -36
  2. package/_Build/js/libs/build-id.js +14 -0
  3. package/_Build/js/libs/filters.js +36 -0
  4. package/_Build/js/libs/globals.js +7 -0
  5. package/_Build/js/libs/router.js +22 -0
  6. package/_Build/js/libs/routes.js +29 -0
  7. package/_Build/js/libs/store.js +21 -0
  8. package/_Build/js/libs/utility.js +161 -0
  9. package/_Build/vue/components/basic/Button.vue +1 -1
  10. package/_Build/vue/components/form/Avatar.vue +90 -0
  11. package/_Build/vue/components/form/Checkbox.vue +10 -0
  12. package/_Build/vue/components/form/InputNumber.vue +1 -1
  13. package/_Build/vue/components/form/Select.vue +223 -33
  14. package/_Build/vue/components/form/Spinner.vue +5 -0
  15. package/_Build/vue/components/layout/Alert.vue +5 -5
  16. package/_Build/vue/components/layout/Audit.vue +143 -0
  17. package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -4
  18. package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
  19. package/_Build/vue/components/layout/Footer.vue +11 -10
  20. package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +13 -7
  21. package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +10 -8
  22. package/_Build/vue/components/layout/Layout.vue +94 -0
  23. package/_Build/vue/components/layout/Navigation.vue +77 -0
  24. package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +14 -8
  25. package/_Build/vue/components/layout/SideBar.vue +26 -0
  26. package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +37 -16
  27. package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +108 -52
  28. package/_Build/vue/components/layout/TokenDisplay.vue +52 -0
  29. package/_Build/vue/components/layout/pageTitle.vue +1 -1
  30. package/_Build/vue/components/navigation/MenuItem.vue +7 -2
  31. package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
  32. package/_Build/vue/modules/AuthModule/js/axios.js +21 -1
  33. package/_Build/vue/modules/AuthModule/js/guest-request.js +32 -0
  34. package/_Build/vue/modules/AuthModule/js/impersonation-banner.js +102 -0
  35. package/_Build/vue/modules/AuthModule/js/router.js +91 -114
  36. package/_Build/vue/modules/AuthModule/js/store.js +23 -6
  37. package/_Build/vue/modules/AuthModule/routes/PCompanies/columns.js +268 -0
  38. package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +213 -0
  39. package/_Build/vue/modules/AuthModule/routes/PIntegrations/columns.js +58 -0
  40. package/_Build/vue/modules/AuthModule/routes/PIntegrations/resource.js +79 -0
  41. package/_Build/vue/modules/AuthModule/routes/PTeams/columns.js +78 -0
  42. package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +251 -0
  43. package/_Build/vue/modules/AuthModule/routes/PUsers/SetPasswordAction.vue +51 -0
  44. package/_Build/vue/modules/AuthModule/routes/PUsers/SetPasswordDialog.vue +138 -0
  45. package/_Build/vue/modules/AuthModule/routes/PUsers/columns.js +349 -0
  46. package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +239 -0
  47. package/_Build/vue/modules/AuthModule/routes/account-exists.vue +2 -2
  48. package/_Build/vue/modules/AuthModule/routes/change-password.vue +28 -32
  49. package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
  50. package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +4 -4
  51. package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +10 -9
  52. package/_Build/vue/modules/AuthModule/routes/force-reset.vue +44 -58
  53. package/_Build/vue/modules/AuthModule/routes/forgot.vue +10 -5
  54. package/_Build/vue/modules/AuthModule/routes/login.vue +12 -19
  55. package/_Build/vue/modules/AuthModule/routes/logincallback.vue +1 -3
  56. package/_Build/vue/modules/AuthModule/routes/loginsso.vue +14 -10
  57. package/_Build/vue/modules/AuthModule/routes/logout.vue +17 -5
  58. package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
  59. package/_Build/vue/modules/AuthModule/routes/register.vue +24 -28
  60. package/_Build/vue/modules/AuthModule/routes/reset.vue +20 -14
  61. package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +14 -8
  62. package/_Build/vue/modules/AuthModule/routes/success-reset.vue +2 -2
  63. package/_Build/vue/modules/AuthModule/routes/success-verify.vue +1 -3
  64. package/_Build/vue/modules/AuthModule/routes/verify.vue +11 -14
  65. package/_Build/vue/modules/resource/Children/create.vue +81 -0
  66. package/_Build/vue/modules/resource/Children/edit.vue +106 -0
  67. package/_Build/vue/modules/resource/Children/index.vue +42 -0
  68. package/_Build/vue/modules/resource/Children/partials/form.vue +111 -0
  69. package/_Build/vue/modules/resource/Children/show.vue +166 -0
  70. package/_Build/vue/modules/resource/index.js +561 -0
  71. package/_Build/vue/modules/resource/parent.vue +63 -0
  72. package/_Build/vue/modules/resource/trashable.js +104 -0
  73. package/_base.scss +0 -1
  74. package/_defaults.scss +2 -13
  75. package/_variables.scss +9 -4
  76. package/{modules/_AuthModule.scss → components/_auth.scss} +19 -68
  77. package/components/_datepicker.scss +1 -0
  78. package/components/_descriptions.scss +2 -0
  79. package/components/_footer.scss +1 -0
  80. package/components/_form.scss +18 -0
  81. package/components/_header.scss +3 -27
  82. package/components/_layout.scss +56 -0
  83. package/components/_menu.scss +0 -5
  84. package/components/_sidebar.scss +12 -27
  85. package/components/_table.scss +3 -0
  86. package/components/_token-display.scss +41 -0
  87. package/general.scss +1 -0
  88. package/index.js +31 -1
  89. package/package.json +7 -4
  90. package/vendor.scss +0 -1
  91. package/_Build/vue/components/layout/sideBar.vue +0 -25
  92. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
  93. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
  94. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
  95. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
  96. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +0 -173
  97. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -262
  98. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
  99. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
  100. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
  101. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
  102. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +0 -169
  103. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
  104. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
  105. package/components/_input.scss +0 -0
  106. package/modules/_AuthVariables.scss +0 -7
  107. /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
  108. /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
  109. /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
  110. /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
  111. /package/{modules → components}/_modal.scss +0 -0
@@ -1,21 +1,14 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <section id="resetPasswordForm">
4
- <h1
5
- class="h2 h2--small"
6
- v-html="!form.successful ? 'Welcome' : 'Success'"
7
- />
4
+ <h1 class="h2 h2--small" v-html="'Welcome'" />
8
5
  <form class="form" @submit.prevent="submit">
9
- <div v-if="!form.successful">
10
- <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
11
- <strong class=""
12
- >Email:
13
- {{ $store.state?.auth?.user?.email }}</strong
14
- >
6
+ <div>
7
+ <p class="mt-2 mb-0 color-highlight">
8
+ <strong class="">Email: {{ email }}</strong>
15
9
  </p>
16
- <p class="AM-mt-0.5">
17
- <strong
18
- >Hello {{ $store.state?.auth?.user?.name }}</strong
10
+ <p class="mt-0.5">
11
+ <strong>Hello {{ name }}</strong
19
12
  >, and welcome to {{ $root.appName }}. To maintain
20
13
  security, anyone signing in with a one-time-password
21
14
  must <strong>create a new password</strong> the first
@@ -23,7 +16,7 @@
23
16
  </p>
24
17
  <el-input
25
18
  v-model="form.password"
26
- class="AM-mt-2"
19
+ class="mt-2"
27
20
  label="New Password"
28
21
  placeholder="Enter new password"
29
22
  name="password"
@@ -33,31 +26,22 @@
33
26
  required
34
27
  />
35
28
 
36
- <VPasswordValidation
29
+ <VelPasswordValidation
37
30
  :password="form.password"
38
31
  @passwordValid="updatePasswordValidity"
39
32
  />
40
33
 
41
34
  <elButton
42
35
  native-type="submit"
43
- class="AM-mt-3"
36
+ class="mt-3"
44
37
  type="primary"
45
- :disabled="form.processing || !isPasswordValid"
46
- :loading="form.processing"
38
+ :disabled="loading || !isPasswordValid"
39
+ :loading="loading"
47
40
  @click="onSubmit"
48
41
  >
49
42
  <span v-text="'Update password'" />
50
43
  </elButton>
51
44
  </div>
52
- <div v-else>
53
- <strong class=""
54
- >Email: {{ $store.state.auth?.user?.email }}</strong
55
- >
56
- <p v-text="`Your password has been updated.`" />
57
- <elButton type="primary" @click="handleButton">
58
- Continue
59
- </elButton>
60
- </div>
61
45
  </form>
62
46
  </section>
63
47
  </div>
@@ -65,8 +49,18 @@
65
49
 
66
50
  <script>
67
51
  import Form from "form-backend-validation";
52
+ import { ElNotification } from "element-plus";
53
+ import { guestRequest } from "../js/guest-request";
68
54
 
69
55
  export default {
56
+ components: {
57
+ VelPasswordValidation:
58
+ require("../../../components/layout/PasswordValidation.vue")
59
+ .default,
60
+ elInput: require("../../../components/form/basic.vue").default,
61
+ elButton: require("../../../components/basic/Button.vue").default,
62
+ },
63
+
70
64
  data() {
71
65
  return {
72
66
  form: new Form(
@@ -77,13 +71,17 @@ export default {
77
71
  { resetOnSuccess: false },
78
72
  ),
79
73
  isPasswordValid: false,
74
+ loading: false,
75
+ name: "",
76
+ email: "",
80
77
  };
81
78
  },
82
79
 
83
80
  mounted() {
84
- this.$store.dispatch("getUser", {
85
- errors: this.$root.errors,
86
- });
81
+ this.$store.dispatch("getUser");
82
+
83
+ this.name = this.$store.state?.auth?.user?.name;
84
+ this.email = this.$store.state?.auth?.user?.email;
87
85
  },
88
86
 
89
87
  methods: {
@@ -94,46 +92,41 @@ export default {
94
92
  await this.form.put("/user/password");
95
93
  await this.login();
96
94
  } catch (e) {
97
- this.$root.errors(e);
95
+ console.log(e);
98
96
  } finally {
99
97
  this.loading = false;
100
98
  }
101
99
  },
102
100
  async login() {
103
- this.loading = true;
104
-
105
101
  try {
106
- const res = await this.form.post("/login");
107
-
108
- if (res["logged-in"]) {
109
- try {
110
- await this.$store.dispatch("logout", {
111
- errors: this.$root.errors,
112
- });
113
- } catch (e) {}
114
-
115
- await this.form.post("/login");
116
- }
102
+ await guestRequest({
103
+ form: this.form,
104
+ url: "/login",
105
+ store: this.$store,
106
+ });
117
107
  } catch (e) {
118
- this.$root.errors(e);
108
+ console.log(e);
119
109
  } finally {
120
- this.loading = false;
121
110
  await this.postLogin();
122
111
  }
123
112
  },
124
113
 
125
114
  async postLogin() {
126
- const { data: user } = await this.$store.dispatch("getUser", {
127
- errors: this.$root.errors,
115
+ const { data: user } = await this.$store.dispatch("getUser");
116
+
117
+ this.$router.push({ name: this.$store.state.auth.redirect });
118
+
119
+ ElNotification({
120
+ type: "success",
121
+ message: "Password updated successfully",
122
+ duration: 10000,
123
+ class: "el-notification--success el-notification--right-override",
128
124
  });
129
125
  },
130
126
 
131
127
  updatePasswordValidity(isValid) {
132
128
  this.isPasswordValid = isValid;
133
129
  },
134
- handleButton() {
135
- this.$emit("close");
136
- },
137
130
  },
138
131
 
139
132
  metaInfo() {
@@ -141,12 +134,5 @@ export default {
141
134
  title: "Reset Password",
142
135
  };
143
136
  },
144
-
145
- components: {
146
- VPasswordValidation: require("./../components/VPasswordValidation.vue")
147
- .default,
148
- elInput: require("../../../components/form/basic.vue").default,
149
- elButton: require("../../../components/basic/Button.vue").default,
150
- },
151
137
  };
152
138
  </script>
@@ -3,14 +3,14 @@
3
3
  <section id="forgotPasswordForm">
4
4
  <h1 class="h2 h2--small">Reset password</h1>
5
5
  <form class="form" @submit.prevent="submit">
6
- <p class="AM-mt-2">
6
+ <p class="mt-2">
7
7
  Enter the email address associated with your account to
8
8
  continue.
9
9
  </p>
10
10
 
11
11
  <el-input
12
12
  v-if="!form.successful"
13
- class="AM-mt-3 AM-mb-3"
13
+ class="mt-3 mb-3"
14
14
  v-model="form.email"
15
15
  label="Email "
16
16
  placeholder="Enter email address"
@@ -32,7 +32,7 @@
32
32
  Continue
33
33
  </elButton>
34
34
 
35
- <p class="disclaimer AM-mt-3">
35
+ <p class="disclaimer mt-3">
36
36
  <router-link
37
37
  class="color-1 underline"
38
38
  :to="{ name: 'auth.login' }"
@@ -47,6 +47,7 @@
47
47
 
48
48
  <script>
49
49
  import Form from "form-backend-validation";
50
+ import { guestRequest } from "../js/guest-request";
50
51
 
51
52
  export default {
52
53
  components: {
@@ -66,14 +67,18 @@ export default {
66
67
  methods: {
67
68
  async onSubmit() {
68
69
  try {
69
- await this.form.post("/forgot-password");
70
+ await guestRequest({
71
+ form: this.form,
72
+ url: "/forgot-password",
73
+ store: this.$store,
74
+ });
70
75
 
71
76
  this.$router.push({
72
77
  name: "auth.success-forgot",
73
78
  query: { email: this.form.email },
74
79
  });
75
80
  } catch (e) {
76
- this.$root.errors(e);
81
+ console.log(e);
77
82
  }
78
83
  },
79
84
  },
@@ -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"
@@ -47,7 +47,7 @@
47
47
  Continue
48
48
  </el-button>
49
49
 
50
- <p class="disclaimer AM-mt-3">
50
+ <p class="disclaimer mt-3">
51
51
  Having trouble signing in?
52
52
  <router-link
53
53
  class="color-1 underline"
@@ -65,6 +65,7 @@
65
65
 
66
66
  <script>
67
67
  import Form from "form-backend-validation";
68
+ import { guestRequest } from "../js/guest-request";
68
69
 
69
70
  export default {
70
71
  components: {
@@ -93,30 +94,22 @@ export default {
93
94
  this.loading = true;
94
95
 
95
96
  try {
96
- const res = await this.form.post("/login");
97
-
98
- if (res["logged-in"]) {
99
- try {
100
- await this.$store.dispatch("logout", {
101
- errors: this.$root.errors,
102
- });
103
- } catch (e) {}
104
-
105
- await this.form.post("/login");
106
- }
97
+ const res = await guestRequest({
98
+ form: this.form,
99
+ url: "/login",
100
+ store: this.$store,
101
+ });
107
102
 
108
103
  await this.postLogin();
109
104
  } catch (e) {
110
- this.$root.errors(e);
105
+ console.log(e);
111
106
  } finally {
112
107
  this.loading = false;
113
108
  }
114
109
  },
115
110
 
116
111
  async postLogin() {
117
- const { data: user } = await this.$store.dispatch("getUser", {
118
- errors: this.$root.errors,
119
- });
112
+ const { data: user } = await this.$store.dispatch("getUser");
120
113
 
121
114
  if (window.dataLayer) {
122
115
  window.dataLayer.push({ event: "login", user });
@@ -16,9 +16,7 @@ export default {
16
16
 
17
17
  methods: {
18
18
  async postLogin() {
19
- const { data: user } = await this.$store.dispatch("getUser", {
20
- errors: this.$root.errors,
21
- });
19
+ const { data: user } = await this.$store.dispatch("getUser");
22
20
 
23
21
  if (window.dataLayer) {
24
22
  window.dataLayer.push({ event: "login", user });
@@ -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"
@@ -35,7 +35,7 @@
35
35
  Continue
36
36
  </el-button>
37
37
 
38
- <p class="disclaimer AM-mt-3">
38
+ <p class="disclaimer mt-3">
39
39
  Having trouble signing in?
40
40
  <a :href="$store.state.auth.contact" class="underline"
41
41
  >Contact us</a
@@ -45,13 +45,11 @@
45
45
  </template>
46
46
  <template v-else>
47
47
  <h1 class="h2 h2--small">Sign in with SSO</h1>
48
- <p class="AM-mt-2">
48
+ <p class="mt-2">
49
49
  Redirecting you to your organisation’s Single Sign-On (SSO) gateway
50
- <span class="AM-color-highlight"
51
- >in {{ countdown }} seconds...</span
52
- >
50
+ <span class="color-highlight">in {{ countdown }} seconds...</span>
53
51
  </p>
54
- <p class="disclaimer AM-mt-3">
52
+ <p class="disclaimer mt-3">
55
53
  <a :href="redirect_url" class="underline">Go to SSO gateway</a>
56
54
  </p>
57
55
  </template>
@@ -59,6 +57,7 @@
59
57
 
60
58
  <script>
61
59
  import Form from "form-backend-validation";
60
+ import { guestRequest } from "../js/guest-request";
62
61
 
63
62
  export default {
64
63
  components: {
@@ -89,7 +88,12 @@ export default {
89
88
  this.loading = true;
90
89
 
91
90
  try {
92
- const res = await this.form.post(`/hydrate/sso/check`);
91
+ const res = await guestRequest({
92
+ form: this.form,
93
+ url: "/hydrate/sso/check",
94
+ store: this.$store,
95
+ });
96
+
93
97
  if (res["redirect_url"]) {
94
98
  this.redirect_url = res["redirect_url"];
95
99
  this.setRedirect();
@@ -100,7 +104,7 @@ export default {
100
104
  });
101
105
  }
102
106
  } catch (e) {
103
- this.$root.errors(e);
107
+ console.log(e);
104
108
  } finally {
105
109
  this.loading = false;
106
110
  }
@@ -1,4 +1,7 @@
1
1
  <script>
2
+ import axios from "axios";
3
+ import Cookies from "js-cookie";
4
+
2
5
  export default {
3
6
  metaInfo() {
4
7
  return {
@@ -8,14 +11,23 @@ export default {
8
11
 
9
12
  async mounted() {
10
13
  try {
11
- await this.$store.dispatch("logout", {
12
- errors: this.$root.errors,
13
- });
14
+ await this.$store.dispatch("logout");
15
+ } catch {
16
+ /* empty */
17
+ }
18
+
19
+ // Clear all cookies
20
+ Object.keys(Cookies.get()).forEach(function (cookie, attributes) {
21
+ Cookies.remove(cookie, attributes);
22
+ });
23
+
24
+ try {
25
+ await axios.get("/sanctum/csrf-cookie");
14
26
  } catch {
15
27
  /* empty */
16
- } finally {
17
- this.$router.push({ name: "auth.login" });
18
28
  }
29
+
30
+ this.$router.push({ name: "auth.login" });
19
31
  },
20
32
  };
21
33
  </script>
@@ -16,9 +16,7 @@ export default {
16
16
 
17
17
  async mounted() {
18
18
  try {
19
- await this.$store.dispatch("logout", {
20
- errors: this.$root.errors,
21
- });
19
+ await this.$store.dispatch("logout");
22
20
  } finally {
23
21
  this.done = true;
24
22
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <h1 class="h2 h2--small">Register</h1>
3
- <p class="AM-mb-3 AM-mt-2">
3
+ <p class="mb-3 mt-2">
4
4
  Please enter your personal details to complete your registration.
5
5
  </p>
6
6
 
@@ -10,7 +10,7 @@
10
10
  id="memberLoginForm"
11
11
  >
12
12
  <el-input
13
- class="AM-mb-2"
13
+ class="mb-2"
14
14
  label="Full name"
15
15
  placeholder="Enter your full name"
16
16
  name="name"
@@ -20,7 +20,7 @@
20
20
  />
21
21
 
22
22
  <el-input
23
- class="AM-mb-2"
23
+ class="mb-2"
24
24
  label="Email"
25
25
  placeholder="Enter your email address"
26
26
  name="email"
@@ -31,7 +31,7 @@
31
31
  />
32
32
 
33
33
  <el-input
34
- class="AM-mb-2"
34
+ class="mb-2"
35
35
  label="Password"
36
36
  name="password"
37
37
  placeholder="Create a unique password"
@@ -42,7 +42,7 @@
42
42
  :error="form.errors"
43
43
  />
44
44
 
45
- <VPasswordValidation
45
+ <VelPasswordValidation
46
46
  :password="form.password"
47
47
  @passwordValid="updatePasswordValidity"
48
48
  />
@@ -72,7 +72,7 @@
72
72
  Register
73
73
  </elButton>
74
74
 
75
- <p class="disclaimer AM-mt-3">
75
+ <p class="disclaimer mt-3">
76
76
  Having trouble registering?
77
77
  <a :href="$store.state.auth.contact" class="underline"
78
78
  >Contact us</a
@@ -83,8 +83,18 @@
83
83
 
84
84
  <script>
85
85
  import Form from "form-backend-validation";
86
+ import { ElNotification } from "element-plus";
87
+ import { guestRequest } from "../js/guest-request";
86
88
 
87
89
  export default {
90
+ components: {
91
+ VelPasswordValidation:
92
+ require("../../../components/layout/PasswordValidation.vue")
93
+ .default,
94
+ elInput: require("../../../components/form/basic.vue").default,
95
+ elButton: require("../../../components/basic/Button.vue").default,
96
+ },
97
+
88
98
  data() {
89
99
  return {
90
100
  form: new Form(
@@ -107,24 +117,19 @@ export default {
107
117
  this.loading = true;
108
118
 
109
119
  try {
110
- const res = await this.form.post("/register");
111
-
112
- if (res["logged-in"]) {
113
- try {
114
- await this.$store.dispatch("logout", {
115
- errors: this.$root.errors,
116
- });
117
- } catch (e) {}
120
+ const res = await guestRequest({
121
+ form: this.form,
122
+ url: "/register",
123
+ store: this.$store,
124
+ });
118
125
 
119
- await this.form.post("/register");
120
- }
121
126
  if (res["redirect"]) {
122
127
  // Redirect here
123
128
  this.$router.push({
124
129
  name: `auth.login`,
125
130
  query: { company: res["company"] },
126
131
  });
127
- this.$notify.error({
132
+ ElNotification.error({
128
133
  title: "Domain is SSO enabled",
129
134
  message: "Sign in with your company email address",
130
135
  duration: 10000,
@@ -133,16 +138,14 @@ export default {
133
138
  await this.postLogin();
134
139
  }
135
140
  } catch (e) {
136
- this.$root.errors(e);
141
+ console.log(e);
137
142
  } finally {
138
143
  this.loading = false;
139
144
  }
140
145
  },
141
146
 
142
147
  async postLogin() {
143
- const { data: user } = await this.$store.dispatch("getUser", {
144
- errors: this.$root.errors,
145
- });
148
+ const { data: user } = await this.$store.dispatch("getUser");
146
149
 
147
150
  if (window.dataLayer) {
148
151
  window.dataLayer.push({ event: "login", user });
@@ -163,12 +166,5 @@ export default {
163
166
  this.isPasswordValid = isValid;
164
167
  },
165
168
  },
166
-
167
- components: {
168
- VPasswordValidation: require("./../components/VPasswordValidation.vue")
169
- .default,
170
- elInput: require("../../../components/form/basic.vue").default,
171
- elButton: require("../../../components/basic/Button.vue").default,
172
- },
173
169
  };
174
170
  </script>
@@ -4,16 +4,16 @@
4
4
  <h1 class="h2 h2--small">Reset password</h1>
5
5
  <form class="form" @submit.prevent="submit">
6
6
  <div v-if="!form.successful">
7
- <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
7
+ <p class="mt-2 mb-0 color-highlight">
8
8
  <strong class="">Email: {{ form?.email }}</strong>
9
9
  </p>
10
- <p class="AM-mt-0.5">
10
+ <p class="mt-0.5">
11
11
  Please create a new password. Passwords you have used
12
12
  previously aren’t permitted.
13
13
  </p>
14
14
  <el-input
15
15
  v-model="form.password"
16
- class="AM-mt-3"
16
+ class="mt-3"
17
17
  label="New Password"
18
18
  placeholder="Enter new password"
19
19
  name="password"
@@ -23,7 +23,7 @@
23
23
  required
24
24
  />
25
25
 
26
- <VPasswordValidation
26
+ <VelPasswordValidation
27
27
  :password="form.password"
28
28
  @passwordValid="updatePasswordValidity"
29
29
  />
@@ -51,7 +51,7 @@
51
51
  <h4 class="mt" v-text="`Success!`" />
52
52
  <p v-text="`Your password has been reset.`" />
53
53
  </div>
54
- <p class="disclaimer AM-mt-3">
54
+ <p class="disclaimer mt-3">
55
55
  <router-link
56
56
  class="color-1 underline"
57
57
  :to="{ name: 'auth.login' }"
@@ -66,8 +66,17 @@
66
66
 
67
67
  <script>
68
68
  import Form from "form-backend-validation";
69
+ import { guestRequest } from "../js/guest-request";
69
70
 
70
71
  export default {
72
+ components: {
73
+ VelPasswordValidation:
74
+ require("../../../components/layout/PasswordValidation.vue")
75
+ .default,
76
+ elInput: require("../../../components/form/basic.vue").default,
77
+ elButton: require("../../../components/basic/Button.vue").default,
78
+ },
79
+
71
80
  data() {
72
81
  return {
73
82
  form: new Form(
@@ -90,7 +99,11 @@ export default {
90
99
  methods: {
91
100
  async onSubmit() {
92
101
  try {
93
- const res = await this.form.post("/reset-password");
102
+ await guestRequest({
103
+ form: this.form,
104
+ url: "/reset-password",
105
+ store: this.$store,
106
+ });
94
107
 
95
108
  this.$router.push({
96
109
  name: "auth.success-reset",
@@ -108,7 +121,7 @@ export default {
108
121
  query: { email: this.form.email },
109
122
  });
110
123
  }
111
- this.$root.errors(e);
124
+ console.log(e);
112
125
  }
113
126
  },
114
127
 
@@ -122,12 +135,5 @@ export default {
122
135
  title: "Reset Password",
123
136
  };
124
137
  },
125
-
126
- components: {
127
- VPasswordValidation: require("./../components/VPasswordValidation.vue")
128
- .default,
129
- elInput: require("../../../components/form/basic.vue").default,
130
- elButton: require("../../../components/basic/Button.vue").default,
131
- },
132
138
  };
133
139
  </script>