@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,15 +1,19 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <section id="resetPasswordForm">
4
- <h1 class="h2 h2--small" v-html="!form.successful ? 'Change password' : 'Success'" />
4
+ <h1
5
+ class="h2 h2--small"
6
+ v-html="!form.successful ? 'Change password' : 'Success'"
7
+ />
5
8
  <form class="form" @submit.prevent="submit">
6
9
  <div v-if="!form.successful">
7
- <p class="AM-mt-2 AM-mb-0">
8
- Please complete the fields below to change your password.
10
+ <p class="mt-2 mb-0">
11
+ Please complete the fields below to change your
12
+ password.
9
13
  </p>
10
14
 
11
15
  <el-input
12
- class="AM-mt-3"
16
+ class="mt-3"
13
17
  label="Current password"
14
18
  placeholder="Enter your current password"
15
19
  name="current_password"
@@ -21,7 +25,7 @@
21
25
  />
22
26
  <el-input
23
27
  v-model="form.password"
24
- class="AM-mt-2 AM-mb-2"
28
+ class="mt-2 mb-2"
25
29
  label="New Password"
26
30
  placeholder="Enter your new password"
27
31
  name="password"
@@ -32,9 +36,13 @@
32
36
  :password="true"
33
37
  />
34
38
 
35
- <VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
36
- <div class="flex AM-mt-3">
39
+ <VPasswordValidation
40
+ :password="form.password"
41
+ @passwordValid="updatePasswordValidity"
42
+ />
43
+ <div class="flex mt-3">
37
44
  <elButton
45
+ native-type="submit"
38
46
  class=""
39
47
  type="primary"
40
48
  :disabled="form.processing || !isPasswordValid"
@@ -54,12 +62,14 @@
54
62
  </div>
55
63
  </div>
56
64
  <div v-else>
57
- <strong class="">Email: {{ $store.state.auth?.user?.email }}</strong>
65
+ <strong class=""
66
+ >Email: {{ $store.state.auth?.user?.email }}</strong
67
+ >
58
68
  <p v-text="`Your password has been updated.`" />
59
69
  <elButton
60
- class=""
61
- type="secondary"
62
- @click="handleButton"
70
+ tag="router-link"
71
+ type="primary"
72
+ :to="{ name: $store.state.auth.redirect }"
63
73
  >
64
74
  <span v-text="'Continue'" />
65
75
  </elButton>
@@ -78,20 +88,17 @@ export default {
78
88
  form: new Form(
79
89
  {
80
90
  email: this.$store.state.auth.user?.email,
81
- password: '',
82
- current_password: ''
91
+ password: "",
92
+ current_password: "",
83
93
  },
84
- { resetOnSuccess: false }
94
+ { resetOnSuccess: false },
85
95
  ),
86
96
  isPasswordValid: false,
87
97
  };
88
98
  },
89
99
 
90
100
  mounted() {
91
-
92
- this.$store.dispatch("getUser", {
93
- errors: this.$root.errors,
94
- });
101
+ this.$store.dispatch("getUser");
95
102
  },
96
103
 
97
104
  methods: {
@@ -99,10 +106,10 @@ export default {
99
106
  this.loading = true;
100
107
 
101
108
  try {
102
- await this.form.put('/user/password');
109
+ await this.form.put("/user/password");
103
110
  await this.login();
104
111
  } catch (e) {
105
- this.$root.errors(e);
112
+ console.log(e);
106
113
  } finally {
107
114
  this.loading = false;
108
115
  }
@@ -113,18 +120,15 @@ export default {
113
120
  try {
114
121
  const res = await this.form.post("/login");
115
122
 
116
- if(res['logged-in']){
117
- try{
118
- await this.$store.dispatch("logout", {
119
- // errors: this.$root.errors,
120
- });
121
- } catch(e){}
123
+ if (res["logged-in"]) {
124
+ try {
125
+ await this.$store.dispatch("logout");
126
+ } catch (e) {}
122
127
 
123
128
  await this.form.post("/login");
124
129
  }
125
-
126
130
  } catch (e) {
127
- this.$root.errors(e);
131
+ console.log(e);
128
132
  } finally {
129
133
  this.loading = false;
130
134
  this.postLogin();
@@ -135,15 +139,11 @@ export default {
135
139
  this.isPasswordValid = isValid;
136
140
  },
137
141
  handleButton() {
138
- this.$emit('close');
142
+ this.$emit("close");
139
143
  },
140
-
141
- async postLogin() {
142
- this.$store.commit("setAuth", true);
143
144
 
144
- const { data: user } = await this.$store.dispatch("getUser", {
145
- errors: this.$root.errors,
146
- });
145
+ async postLogin() {
146
+ const { data: user } = await this.$store.dispatch("getUser");
147
147
  },
148
148
  },
149
149
 
@@ -154,9 +154,10 @@ export default {
154
154
  },
155
155
 
156
156
  components: {
157
- VPasswordValidation: require("./../components/VPasswordValidation.vue").default,
158
- elInput: require('../../form/basic.vue').default,
159
- elButton: require('../../basic/Button.vue').default,
157
+ VPasswordValidation: require("./../components/VPasswordValidation.vue")
158
+ .default,
159
+ elInput: require("../../../components/form/basic.vue").default,
160
+ elButton: require("../../../components/basic/Button.vue").default,
160
161
  },
161
162
  };
162
163
  </script>
@@ -22,17 +22,13 @@
22
22
 
23
23
  <script>
24
24
  export default {
25
- mounted() {
26
-
27
- },
25
+ mounted() {},
28
26
  data() {
29
27
  return {
30
- logoName: process.env.HYDRATE_LOGO,
31
- }
28
+ logoName: process.env.HYDRATE_LOGO,
29
+ };
32
30
  },
33
31
 
34
- components: {
35
-
36
- },
32
+ components: {},
37
33
  };
38
34
  </script>
@@ -1,15 +1,16 @@
1
1
  <template>
2
2
  <h1 class="h2 h2--small">Sorry, your password reset has expired</h1>
3
3
 
4
- <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
4
+ <p class="mt-2 mb-0 color-highlight">
5
5
  <strong class="">Email: {{ form?.email }}</strong>
6
6
  </p>
7
- <p class="AM-mt-0.5">
8
- For security, password reset requests are only <strong>active for 1&nbsp;hour</strong>. If you still want to reset your password, please request a new password reset-link.</p>
7
+ <p class="mt-0.5">
8
+ For security, password reset requests are only
9
+ <strong>active for 1&nbsp;hour</strong>. If you still want to reset your
10
+ password, please request a new password reset-link.
11
+ </p>
9
12
 
10
- <form class="form"
11
- @submit.prevent="submit"
12
- >
13
+ <form class="form" @submit.prevent="submit">
13
14
  <el-input
14
15
  class="hidden"
15
16
  v-model="form.email"
@@ -21,6 +22,7 @@
21
22
  required
22
23
  />
23
24
  <elButton
25
+ native-type="submit"
24
26
  type="primary"
25
27
  :disabled="form.processing"
26
28
  :loading="form.processing"
@@ -29,8 +31,8 @@
29
31
  Request new reset-link
30
32
  </elButton>
31
33
 
32
- <p class="disclaimer AM-mt-3">
33
- <router-link class="color-1 underline" :to="{ name: `${$store.state.auth.authBase}.login` }">
34
+ <p class="disclaimer mt-3">
35
+ <router-link class="color-1 underline" :to="{ name: 'auth.login' }">
34
36
  Back to Sign in
35
37
  </router-link>
36
38
  </p>
@@ -42,15 +44,15 @@ import Form from "form-backend-validation";
42
44
 
43
45
  export default {
44
46
  components: {
45
- elInput: require('../../form/basic.vue').default,
46
- elButton: require('../../basic/Button.vue').default,
47
+ elInput: require("../../../components/form/basic.vue").default,
48
+ elButton: require("../../../components/basic/Button.vue").default,
47
49
  },
48
50
  data: () => ({
49
51
  form: new Form(
50
52
  {
51
53
  email: "",
52
54
  },
53
- { resetOnSuccess: false }
55
+ { resetOnSuccess: false },
54
56
  ),
55
57
  }),
56
58
 
@@ -60,17 +62,17 @@ export default {
60
62
  await this.form.post("/forgot-password");
61
63
 
62
64
  this.$router.push({
63
- name: `${this.$store.state.auth.authBase}.success-forgot`,
65
+ name: "auth.success-forgot",
64
66
  query: { email: this.form.email },
65
67
  });
66
68
  } catch (e) {
67
- this.$root.errors(e);
69
+ console.log(e);
68
70
  }
69
71
  },
70
72
  },
71
73
 
72
- mounted(){
74
+ mounted() {
73
75
  this.form.email = this.$route.query.email;
74
- }
76
+ },
75
77
  };
76
78
  </script>
@@ -2,15 +2,16 @@
2
2
  <h1 class="h2 h2--small">Verification link expired</h1>
3
3
 
4
4
  <form class="form" @submit.prevent="submit">
5
- <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
5
+ <p class="mt-2 mb-0 color-highlight">
6
6
  <strong class="">Email: {{ form?.email }}</strong>
7
7
  </p>
8
- <p class="AM-mt-0.5">
9
- This email verification link has expired. Not to worry, we can email you a new one.
8
+ <p class="mt-0.5">
9
+ This email verification link has expired. Not to worry, we can email
10
+ you a new one.
10
11
  </p>
11
12
 
12
13
  <el-input
13
- class="AM-mt-2 AM-mb-2.5 hidden"
14
+ class="mt-2 mb-2.5 hidden"
14
15
  v-model="form.email"
15
16
  label="Email address"
16
17
  name="email"
@@ -21,6 +22,7 @@
21
22
  />
22
23
 
23
24
  <elButton
25
+ native-type="submit"
24
26
  type="primary"
25
27
  :disabled="form.processing"
26
28
  :loading="form.processing"
@@ -30,29 +32,29 @@
30
32
  </elButton>
31
33
  </form>
32
34
 
33
- <p class="disclaimer AM-mt-3">
35
+ <p class="disclaimer mt-3">
34
36
  Having trouble singing in?
35
- <a :href="contact" class="underline">Contact us</a>
37
+ <a :href="$store.state.auth.contact" class="underline">Contact us</a>
36
38
  </p>
37
39
  </template>
38
40
 
39
41
  <script>
40
42
  import Form from "form-backend-validation";
43
+ import { ElNotification } from "element-plus";
41
44
 
42
45
  export default {
43
46
  components: {
44
- elInput: require('../../form/basic.vue').default,
45
- elButton: require('../../basic/Button.vue').default,
47
+ elInput: require("../../../components/form/basic.vue").default,
48
+ elButton: require("../../../components/basic/Button.vue").default,
46
49
  },
47
50
  data: () => ({
48
51
  form: new Form(
49
52
  {
50
53
  email: "",
51
54
  },
52
- { resetOnSuccess: false }
55
+ { resetOnSuccess: false },
53
56
  ),
54
57
  notification: null,
55
- contact: process.env.HYDRATE_CONTACT ?? 'mailto:EP@avalerehealth.com',
56
58
  }),
57
59
 
58
60
  methods: {
@@ -65,29 +67,28 @@ export default {
65
67
 
66
68
  await this.form.post("/email/verification-notification");
67
69
 
68
- this.$notify.success({
70
+ ElNotification.success({
69
71
  message: "Email has been re-sent",
70
72
  duration: 10000,
71
- class: 'el-notification--success el-notification--right-override'
73
+ class: "el-notification--success el-notification--right-override",
72
74
  });
73
75
  } catch (e) {
74
76
  if (e.response && e.response.status === 429) {
75
- this.notification = this.$notify({
77
+ this.notification = ElNotification({
76
78
  type: "warning",
77
- message: 'Please allow 10 minutes before re-requesting',
79
+ message: "Please allow 10 minutes before re-requesting",
78
80
  duration: 0,
79
- class: 'el-notification--warning el-notification--right-override'
81
+ class: "el-notification--warning el-notification--right-override",
80
82
  });
81
83
  } else if (e.response && e.response.status === 422) {
82
- this.notification = this.$notify({
84
+ this.notification = ElNotification({
83
85
  type: "error",
84
86
  message: e.response.data.message,
85
87
  duration: 0,
86
- class: 'el-notification--error el-notification--right-override'
88
+ class: "el-notification--error el-notification--right-override",
87
89
  });
88
- }
89
- else {
90
- this.$root.errors(e);
90
+ } else {
91
+ console.log(e);
91
92
  }
92
93
  }
93
94
  },
@@ -1,18 +1,29 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <section id="resetPasswordForm">
4
- <h1 class="h2 h2--small" v-html="!form.successful ? 'Welcome' : 'Success'" />
4
+ <h1
5
+ class="h2 h2--small"
6
+ v-html="!form.successful ? 'Welcome' : 'Success'"
7
+ />
5
8
  <form class="form" @submit.prevent="submit">
6
9
  <div v-if="!form.successful">
7
- <p class="AM-mt-2 AM-mb-0 AM-color-highlight">
8
- <strong class="">Email: {{ $store.state?.auth?.user?.email }}</strong>
10
+ <p class="mt-2 mb-0 color-highlight">
11
+ <strong class=""
12
+ >Email:
13
+ {{ $store.state?.auth?.user?.email }}</strong
14
+ >
9
15
  </p>
10
- <p class="AM-mt-0.5">
11
- <strong>Hello {{ $store.state?.auth?.user?.name }}</strong>, and welcome to {{ $store.state.auth.platformName }}. To maintain security, anyone signing in with a one-time-password must <strong>create a new password</strong> the first time they access the {{ $store.state.auth.platformName }} portal.
16
+ <p class="mt-0.5">
17
+ <strong
18
+ >Hello {{ $store.state?.auth?.user?.name }}</strong
19
+ >, and welcome to {{ $root.appName }}. To maintain
20
+ security, anyone signing in with a one-time-password
21
+ must <strong>create a new password</strong> the first
22
+ time they access the {{ $root.appName }} portal.
12
23
  </p>
13
24
  <el-input
14
25
  v-model="form.password"
15
- class="AM-mt-2"
26
+ class="mt-2"
16
27
  label="New Password"
17
28
  placeholder="Enter new password"
18
29
  name="password"
@@ -22,10 +33,14 @@
22
33
  required
23
34
  />
24
35
 
25
- <VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
36
+ <VPasswordValidation
37
+ :password="form.password"
38
+ @passwordValid="updatePasswordValidity"
39
+ />
26
40
 
27
41
  <elButton
28
- class="AM-mt-3"
42
+ native-type="submit"
43
+ class="mt-3"
29
44
  type="primary"
30
45
  :disabled="form.processing || !isPasswordValid"
31
46
  :loading="form.processing"
@@ -35,13 +50,16 @@
35
50
  </elButton>
36
51
  </div>
37
52
  <div v-else>
38
- <strong class="">Email: {{ $store.state.auth?.user?.email }}</strong>
53
+ <strong class=""
54
+ >Email: {{ $store.state.auth?.user?.email }}</strong
55
+ >
39
56
  <p v-text="`Your password has been updated.`" />
40
57
  <elButton
58
+ tag="router-link"
41
59
  type="primary"
42
- @click="handleButton"
60
+ :to="{ name: $store.state.auth.redirect }"
43
61
  >
44
- Continue
62
+ <span v-text="'Continue'" />
45
63
  </elButton>
46
64
  </div>
47
65
  </form>
@@ -58,20 +76,16 @@ export default {
58
76
  form: new Form(
59
77
  {
60
78
  email: this.$store.state.auth.user?.email,
61
- password: '',
62
- otp: true,
79
+ password: "",
63
80
  },
64
- { resetOnSuccess: false }
81
+ { resetOnSuccess: false },
65
82
  ),
66
83
  isPasswordValid: false,
67
84
  };
68
85
  },
69
86
 
70
87
  mounted() {
71
-
72
- this.$store.dispatch("getUser", {
73
- errors: this.$root.errors,
74
- });
88
+ this.$store.dispatch("getUser");
75
89
  },
76
90
 
77
91
  methods: {
@@ -79,10 +93,10 @@ export default {
79
93
  this.loading = true;
80
94
 
81
95
  try {
82
- await this.form.put('/user/password');
96
+ await this.form.put("/user/password");
83
97
  await this.login();
84
98
  } catch (e) {
85
- this.$root.errors(e);
99
+ console.log(e);
86
100
  } finally {
87
101
  this.loading = false;
88
102
  }
@@ -93,38 +107,28 @@ export default {
93
107
  try {
94
108
  const res = await this.form.post("/login");
95
109
 
96
- if(res['logged-in']){
97
- try{
98
- await this.$store.dispatch("logout", {
99
- errors: this.$root.errors,
100
- });
101
- } catch(e){}
110
+ if (res["logged-in"]) {
111
+ try {
112
+ await this.$store.dispatch("logout");
113
+ } catch (e) {}
102
114
 
103
115
  await this.form.post("/login");
104
116
  }
105
-
106
117
  } catch (e) {
107
- this.$root.errors(e);
118
+ console.log(e);
108
119
  } finally {
109
120
  this.loading = false;
110
121
  await this.postLogin();
111
122
  }
112
123
  },
113
-
114
- async postLogin() {
115
- this.$store.commit("setAuth", true);
116
124
 
117
- const { data: user } = await this.$store.dispatch("getUser", {
118
- errors: this.$root.errors,
119
- });
125
+ async postLogin() {
126
+ const { data: user } = await this.$store.dispatch("getUser");
120
127
  },
121
128
 
122
129
  updatePasswordValidity(isValid) {
123
130
  this.isPasswordValid = isValid;
124
131
  },
125
- handleButton() {
126
- this.$emit('close');
127
- }
128
132
  },
129
133
 
130
134
  metaInfo() {
@@ -134,9 +138,10 @@ export default {
134
138
  },
135
139
 
136
140
  components: {
137
- VPasswordValidation: require("./../components/VPasswordValidation.vue").default,
138
- elInput: require('../../form/basic.vue').default,
139
- elButton: require('../../basic/Button.vue').default,
141
+ VPasswordValidation: require("./../components/VPasswordValidation.vue")
142
+ .default,
143
+ elInput: require("../../../components/form/basic.vue").default,
144
+ elButton: require("../../../components/basic/Button.vue").default,
140
145
  },
141
146
  };
142
147
  </script>
@@ -3,13 +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">
7
- Enter the email address associated with your account to continue.
6
+ <p class="mt-2">
7
+ Enter the email address associated with your account to
8
+ continue.
8
9
  </p>
9
10
 
10
11
  <el-input
11
12
  v-if="!form.successful"
12
- class="AM-mt-3 AM-mb-3"
13
+ class="mt-3 mb-3"
13
14
  v-model="form.email"
14
15
  label="Email "
15
16
  placeholder="Enter email address"
@@ -20,18 +21,21 @@
20
21
  />
21
22
 
22
23
  <elButton
24
+ native-type="submit"
23
25
  type="primary"
24
- :disabled="form.processing || !form.email || form.email?.length < 5"
26
+ :disabled="
27
+ form.processing || !form.email || form.email?.length < 5
28
+ "
25
29
  :loading="form.processing"
26
30
  @click="onSubmit"
27
31
  >
28
32
  Continue
29
33
  </elButton>
30
34
 
31
- <p class="disclaimer AM-mt-3">
35
+ <p class="disclaimer mt-3">
32
36
  <router-link
33
37
  class="color-1 underline"
34
- :to="{ name: `${$store.state.auth.authBase}.login` }"
38
+ :to="{ name: 'auth.login' }"
35
39
  >
36
40
  Back to Sign in
37
41
  </router-link>
@@ -46,8 +50,8 @@ import Form from "form-backend-validation";
46
50
 
47
51
  export default {
48
52
  components: {
49
- elInput: require('../../form/basic.vue').default,
50
- elButton: require('../../basic/Button.vue').default,
53
+ elInput: require("../../../components/form/basic.vue").default,
54
+ elButton: require("../../../components/basic/Button.vue").default,
51
55
  },
52
56
 
53
57
  data: () => ({
@@ -55,7 +59,7 @@ export default {
55
59
  {
56
60
  email: "",
57
61
  },
58
- { resetOnSuccess: false }
62
+ { resetOnSuccess: false },
59
63
  ),
60
64
  }),
61
65
 
@@ -65,11 +69,11 @@ export default {
65
69
  await this.form.post("/forgot-password");
66
70
 
67
71
  this.$router.push({
68
- name: `${this.$store.state.auth.authBase}.success-forgot`,
72
+ name: "auth.success-forgot",
69
73
  query: { email: this.form.email },
70
74
  });
71
75
  } catch (e) {
72
- this.$root.errors(e);
76
+ console.log(e);
73
77
  }
74
78
  },
75
79
  },