Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JvnSlv committed Jan 24, 2025
1 parent 9530b74 commit a774f84
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ Success (200):
## Initiate Email Change
**Endpoint**: `PATCH /api/users/me/email`
**Headers**: `Authorization: Bearer <token>`
**Description**: Sends the email the new email address to the backend to initiate the email change. Backend checks if the email is already in use, and if not sends a UserModel to the application. On the beckend side a new temporary user is created with the new email and role of TempUser. The user is sent a confirmation link to their new email address.
**Description**: Sends the new email address to the backend to initiate the email change. Backend checks if the email is already in use, and if not sends a UserModel to the application. On the beckend side a new temporary user is created with the new email and role of TempUser. The user is sent a confirmation link to their new email address.


**Request**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class UsersController extends ApiController {
if (user == null) {
throw NotFoundException('User not found.');
}
// Create a

_usersService.createUser(
user.copyWith(email: email, role: UserRole.tempUser),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ Success (200):
## Initiate Email Change
**Endpoint**: `PATCH /api/users/me/email`
**Headers**: `Authorization: Bearer <token>`
**Description**: Sends the email the new email address to the backend to initiate the email change. Backend checks if the email is already in use, and if not sends a UserModel to the application. On the beckend side a new temporary user is created with the new email and role of TempUser. The user is sent a confirmation link to their new email address.
**Description**: Sends the new email address to the backend to initiate the email change. Backend checks if the email is already in use, and if not sends a UserModel to the application. On the beckend side a new temporary user is created with the new email and role of TempUser. The user is sent a confirmation link to their new email address.


**Request**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{> licence.dart }}

import 'package:rx_bloc/rx_bloc.dart';
import 'package:rxdart/rxdart.dart';

Expand Down Expand Up @@ -85,10 +87,7 @@ class EmailChangeBloc extends $EmailChangeBloc {

@override
Stream<bool> _mapToShowFieldErrorsState() => _$changeEmailEvent
.switchMap((_) => email
.map((email) => email.isNotEmpty)
.onErrorReturn(false)
.mapTo(true))
.switchMap((_) => email.map((email) => email.isEmpty).onErrorReturn(true))
.startWith(false)
.share();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{> licence.dart }}

import 'package:flutter/widgets.dart';
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart';
import 'package:provider/provider.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{> licence.dart }}

import '../../base/models/user_model.dart';
import '../../base/repositories/users_repository.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{> licence.dart }}

import 'package:flutter/material.dart';
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart';
import 'package:flutter_rx_bloc/rx_form.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract class OnboardingEmailConfirmedBlocStates {
class OnboardingEmailConfirmedBloc extends $OnboardingEmailConfirmedBloc {
OnboardingEmailConfirmedBloc(
this._verifyEmailToken,
this.isOnboarding,
this._isOnboarding,
this._onboardingService,
this._routerBloc,
) {
Expand All @@ -54,7 +54,7 @@ class OnboardingEmailConfirmedBloc extends $OnboardingEmailConfirmedBloc {
}

final String _verifyEmailToken;
final bool isOnboarding;
final bool _isOnboarding;
final OnboardingService _onboardingService;
final RouterBlocType _routerBloc;

Expand All @@ -79,15 +79,15 @@ class OnboardingEmailConfirmedBloc extends $OnboardingEmailConfirmedBloc {
ConnectableStream<void> _mapToOnRoutingState() => Rx.merge([
_$goToNextPageEvent.doOnData(
(_) {
if (isOnboarding) {
if (_isOnboarding) {
_routerBloc.events.pushReplace(const OnboardingPhoneRoute());
} else {
_routerBloc.events.go(const ProfileRoute());
}
},
),
_$goToInitialPageEvent.doOnData((_) {
if (isOnboarding) {
if (_isOnboarding) {
_routerBloc.events.go(const LoginRoute());
} else {
_routerBloc.events.go(const ProfileRoute());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Copyright (c) 2023, Prime Holding JSC
// https://www.primeholding.com
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
{{> licence.dart }}

import 'package:flutter/widgets.dart';
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Copyright (c) 2023, Prime Holding JSC
// https://www.primeholding.com
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
{{> licence.dart }}

import 'package:flutter/widgets.dart';
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ class ProfilePage extends StatelessWidget {
featureTitle: context.l10n.featureOnboarding.changeEmail,
featureSubtitle: context.l10n.featureOnboarding.manageEmail,
icon: context.designSystem.icons.accountIcon,
onTap: () {
showBlurredBottomSheet(
context: context,
configuration: ModalConfiguration(
safeAreaBottom: false,
haveOnlyOneSheet: false,
),
builder: (BuildContext context) =>
const EmailChangePageWithDependencies());
},
onTap: () => showBlurredBottomSheet(
context: context,
configuration: ModalConfiguration(
safeAreaBottom: false,
haveOnlyOneSheet: false,
),
builder: (BuildContext context) =>
const EmailChangePageWithDependencies(),
),
),
const AppDivider(), {{/enable_feature_onboarding}}
{{#enable_pin_code}}
Expand Down

0 comments on commit a774f84

Please sign in to comment.