@fishawack/lab-velocity 2.0.0-beta.32 → 2.0.0-beta.33

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.
@@ -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">
6
+ <div>
10
7
  <p class="mt-2 mb-0 color-highlight">
11
- <strong class=""
12
- >Email:
13
- {{ $store.state?.auth?.user?.email }}</strong
14
- >
8
+ <strong class="">Email: {{ email }}</strong>
15
9
  </p>
16
10
  <p class="mt-0.5">
17
- <strong
18
- >Hello {{ $store.state?.auth?.user?.name }}</strong
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
@@ -42,26 +35,13 @@
42
35
  native-type="submit"
43
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
58
- tag="router-link"
59
- type="primary"
60
- :to="{ name: $store.state.auth.redirect }"
61
- >
62
- <span v-text="'Continue'" />
63
- </elButton>
64
- </div>
65
45
  </form>
66
46
  </section>
67
47
  </div>
@@ -69,6 +49,7 @@
69
49
 
70
50
  <script>
71
51
  import Form from "form-backend-validation";
52
+ import { ElNotification } from "element-plus";
72
53
 
73
54
  export default {
74
55
  components: {
@@ -89,11 +70,17 @@ export default {
89
70
  { resetOnSuccess: false },
90
71
  ),
91
72
  isPasswordValid: false,
73
+ loading: false,
74
+ name: "",
75
+ email: "",
92
76
  };
93
77
  },
94
78
 
95
79
  mounted() {
96
80
  this.$store.dispatch("getUser");
81
+
82
+ this.name = this.$store.state?.auth?.user?.name;
83
+ this.email = this.$store.state?.auth?.user?.email;
97
84
  },
98
85
 
99
86
  methods: {
@@ -110,8 +97,6 @@ export default {
110
97
  }
111
98
  },
112
99
  async login() {
113
- this.loading = true;
114
-
115
100
  try {
116
101
  const res = await this.form.post("/login");
117
102
 
@@ -125,13 +110,21 @@ export default {
125
110
  } catch (e) {
126
111
  console.log(e);
127
112
  } finally {
128
- this.loading = false;
129
113
  await this.postLogin();
130
114
  }
131
115
  },
132
116
 
133
117
  async postLogin() {
134
118
  const { data: user } = await this.$store.dispatch("getUser");
119
+
120
+ this.$router.push({ name: this.$store.state.auth.redirect });
121
+
122
+ ElNotification({
123
+ type: "success",
124
+ message: "Password updated successfully",
125
+ duration: 10000,
126
+ class: "el-notification--success el-notification--right-override",
127
+ });
135
128
  },
136
129
 
137
130
  updatePasswordValidity(isValid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-velocity",
3
- "version": "2.0.0-beta.32",
3
+ "version": "2.0.0-beta.33",
4
4
  "description": "Avalere Health branded style system",
5
5
  "scripts": {
6
6
  "setup": "npm ci || npm i && npm run content",