web/satellite: logic for beta satellites terms confirmation

WHAT:
this logic is used on us2 sign up page to accept additional beta terms.

WHY:
to make US2 users know that their data can be removed.

Change-Id: I43f25bc945a5957bacc6662499830cb2dd6d4079
This commit is contained in:
Vitalii Shpital 2021-02-19 17:39:53 +02:00
parent 21a6dccd36
commit fce5c95eb2

View File

@ -48,6 +48,9 @@ export default class RegisterArea extends Vue {
private password: string = '';
private repeatedPassword: string = '';
// Only for beta sats (like US2).
private areBetaTermsAccepted: boolean = false;
private fullNameError: string = '';
private emailError: string = '';
private passwordError: string = '';
@ -55,6 +58,9 @@ export default class RegisterArea extends Vue {
private isTermsAcceptedError: boolean = false;
private isLoading: boolean = false;
// Only for beta sats (like US2).
private areBetaTermsAcceptedError: boolean = false;
private readonly auth: AuthHttpApi = new AuthHttpApi();
public isPasswordStrengthShown: boolean = false;
@ -208,6 +214,17 @@ export default class RegisterArea extends Vue {
this.repeatedPasswordError = '';
}
/**
* Only for US2 tardigrade beta satellite.
* Sets user's repeat password field from value string.
*/
public get isBetaSatellite(): boolean {
const US2_SAT_NAME_PART = 'US2';
const satName: string = this.$store.state.appStateModule.satelliteName;
return satName.includes(US2_SAT_NAME_PART);
}
/**
* Validates input values to satisfy expected rules.
*/
@ -239,6 +256,12 @@ export default class RegisterArea extends Vue {
isNoErrors = false;
}
// only for beta US2 sats.
if (this.isBetaSatellite && !this.areBetaTermsAccepted) {
this.areBetaTermsAcceptedError = true;
isNoErrors = false;
}
return isNoErrors;
}