Add min and max password range in profile settings
-Api used to get the min and max value is redfish/v1/AccountService.
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: I0f211496bef85aefe843052a6b6ba72156d2e4c7
diff --git a/src/views/ProfileSettings/ProfileSettings.vue b/src/views/ProfileSettings/ProfileSettings.vue
index df74b4b..32278b2 100644
--- a/src/views/ProfileSettings/ProfileSettings.vue
+++ b/src/views/ProfileSettings/ProfileSettings.vue
@@ -95,10 +95,7 @@
</template>
<script>
-import PageTitle from '@/components/Global/PageTitle';
-import PageSection from '@/components/Global/PageSection';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
-import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
import InputPasswordToggle from '@/components/Global/InputPasswordToggle';
import {
maxLength,
@@ -106,23 +103,37 @@
required,
sameAs
} from 'vuelidate/lib/validators';
+import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
+import PageTitle from '@/components/Global/PageTitle';
+import PageSection from '@/components/Global/PageSection';
+import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
export default {
name: 'ProfileSettings',
- components: { PageTitle, PageSection, InputPasswordToggle },
- mixins: [BVToastMixin, VuelidateMixin],
+ components: { InputPasswordToggle, PageSection, PageTitle },
+ mixins: [BVToastMixin, LoadingBarMixin, VuelidateMixin],
data() {
return {
- passwordRequirements: {
- minLength: 8,
- maxLength: 20
- },
form: {
newPassword: '',
confirmPassword: ''
}
};
},
+ computed: {
+ username() {
+ return this.$store.getters['global/username'];
+ },
+ passwordRequirements() {
+ return this.$store.getters['localUsers/accountPasswordRequirements'];
+ }
+ },
+ created() {
+ this.startLoader();
+ this.$store
+ .dispatch('localUsers/getAccountSettings')
+ .finally(() => this.endLoader());
+ },
validations() {
return {
form: {
@@ -138,11 +149,6 @@
}
};
},
- computed: {
- username() {
- return this.$store.getters['global/username'];
- }
- },
methods: {
submitForm() {
this.$v.$touch();