Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into akhil/1396/multi_…
Browse files Browse the repository at this point in the history
…user_level_authentication_poc_master
  • Loading branch information
akhil-deriv committed Sep 25, 2024
2 parents ae4f17d + 673b90a commit 8aede4c
Show file tree
Hide file tree
Showing 47 changed files with 885 additions and 383 deletions.
82 changes: 82 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,88 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-09-25

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_auth` - `v6.7.51`](#deriv_auth---v6751)
- [`deriv_passkeys` - `v0.0.4+6`](#deriv_passkeys---v0046)
- [`deriv_rudderstack` - `v1.1.1`](#deriv_rudderstack---v111)
- [`deriv_theme` - `v2.7.1`](#deriv_theme---v271)
- [`update_checker` - `v1.5.2`](#update_checker---v152)
- [`deriv_ui` - `v0.1.0+3`](#deriv_ui---v0103)
- [`deriv_mobile_chart_wrapper` - `v0.1.3+1`](#deriv_mobile_chart_wrapper---v0131)
- [`deriv_widgetbook` - `v0.0.2+30`](#deriv_widgetbook---v00230)
- [`deriv_expandable_bottom_sheet` - `v0.0.1+10`](#deriv_expandable_bottom_sheet---v00110)
- [`deriv_date_range_picker` - `v0.0.1+10`](#deriv_date_range_picker---v00110)
- [`deriv_numpad` - `v1.1.9`](#deriv_numpad---v119)
- [`deriv_language_selector` - `v0.0.3+10`](#deriv_language_selector---v00310)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `deriv_ui` - `v0.1.0+3`
- `deriv_mobile_chart_wrapper` - `v0.1.3+1`
- `deriv_widgetbook` - `v0.0.2+30`
- `deriv_expandable_bottom_sheet` - `v0.0.1+10`
- `deriv_date_range_picker` - `v0.0.1+10`
- `deriv_numpad` - `v1.1.9`
- `deriv_language_selector` - `v0.0.3+10`

---

#### `deriv_auth` - `v6.7.51`

- **FIX**: [86c0e0nez] add disability check while filtering accounts ([#837](https://github.com/regentmarkets/flutter-deriv-packages/issues/837)). ([e64dfa54](https://github.com/regentmarkets/flutter-deriv-packages/commit/e64dfa54d774e79c3c88f63f3112c7eb0c0cb6b8))
- **FIX**: [86c0e0nez] filter supported accounts while logging in ([#833](https://github.com/regentmarkets/flutter-deriv-packages/issues/833)). ([534e982c](https://github.com/regentmarkets/flutter-deriv-packages/commit/534e982c809b5e0e9380366a3f32a05f1ef2cf10))

#### `deriv_passkeys` - `v0.0.4+6`

- **REFACTOR**(deriv_passkeys): Add call back to call after pass key flow finished ([#831](https://github.com/regentmarkets/flutter-deriv-packages/issues/831)). ([444e963e](https://github.com/regentmarkets/flutter-deriv-packages/commit/444e963e949334ae81b170c73c1a35afad7a1e0e))

#### `deriv_rudderstack` - `v1.1.1`

- **REFACTOR**(deriv_passkeys): Add call back to call after pass key flow finished ([#831](https://github.com/regentmarkets/flutter-deriv-packages/issues/831)). ([444e963e](https://github.com/regentmarkets/flutter-deriv-packages/commit/444e963e949334ae81b170c73c1a35afad7a1e0e))

#### `deriv_theme` - `v2.7.1`

- **REFACTOR**(deriv_passkeys): Add call back to call after pass key flow finished ([#831](https://github.com/regentmarkets/flutter-deriv-packages/issues/831)). ([444e963e](https://github.com/regentmarkets/flutter-deriv-packages/commit/444e963e949334ae81b170c73c1a35afad7a1e0e))

#### `update_checker` - `v1.5.2`

- **REFACTOR**(deriv_passkeys): Add call back to call after pass key flow finished ([#831](https://github.com/regentmarkets/flutter-deriv-packages/issues/831)). ([444e963e](https://github.com/regentmarkets/flutter-deriv-packages/commit/444e963e949334ae81b170c73c1a35afad7a1e0e))


## 2024-09-24

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_mobile_chart_wrapper` - `v0.1.3`](#deriv_mobile_chart_wrapper---v013)

---

#### `deriv_mobile_chart_wrapper` - `v0.1.3`

- **FEAT**(deriv_mobile_chart_wrapper): [DRGO-73] Added line drawing guide banner ([#826](https://github.com/regentmarkets/flutter-deriv-packages/issues/826)). ([b2b018ec](https://github.com/regentmarkets/flutter-deriv-packages/commit/b2b018ec78d9f2de0dcc71b2a76f1343581f4f03))


## 2024-09-20

### Changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ deriv_ui:
| [form_builder](./packages/form_builder) | A simpler and cleaner way to create, validate and submit forms. | [v1.0.0+1](./packages/form_builder/CHANGELOG.md) |
| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.5.1](./packages/update_checker/CHANGELOG.md) |
| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) |
| [deriv_mobile_chart_wrapper](./packages/deriv_mobile_chart_wrapper) | A wrapper package around package _**deriv_chart**_ to implement any functionality specific to mobile and can be wrapped around the main chart package. | [v0.1.2](./packages/deriv_mobile_chart_wrapper/CHANGELOG.md) |
| [deriv_mobile_chart_wrapper](./packages/deriv_mobile_chart_wrapper) | A wrapper package around package _**deriv_chart**_ to implement any functionality specific to mobile and can be wrapped around the main chart package. | [v0.1.3](./packages/deriv_mobile_chart_wrapper/CHANGELOG.md) |
## Environment Setup
Expand Down
5 changes: 5 additions & 0 deletions packages/deriv_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 6.7.51

- **FIX**: [86c0e0nez] add disability check while filtering accounts ([#837](https://github.com/regentmarkets/flutter-deriv-packages/issues/837)). ([e64dfa54](https://github.com/regentmarkets/flutter-deriv-packages/commit/e64dfa54d774e79c3c88f63f3112c7eb0c0cb6b8))
- **FIX**: [86c0e0nez] filter supported accounts while logging in ([#833](https://github.com/regentmarkets/flutter-deriv-packages/issues/833)). ([534e982c](https://github.com/regentmarkets/flutter-deriv-packages/commit/534e982c809b5e0e9380366a3f32a05f1ef2cf10))

## 6.7.50

- Update a dependency to the latest release.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:deriv_auth/core/models/account_model.dart';
import 'package:deriv_auth/deriv_auth.dart';

/// Extensions on [AccountModel].
extension AccountModelExtension on AccountModel {
Expand All @@ -9,3 +9,17 @@ extension AccountModelExtension on AccountModel {
accountId.toUpperCase().contains('VRTC') ||
accountId.toUpperCase().contains('VRW');
}

/// Extensions on [AccountModel].
extension AccountListItemExtension on AccountListItem {
/// Check if [AccountModel] is supported or not.
bool get isSupported =>

// CR will also cover CRW. and loginid should always be present.
loginid!.toUpperCase().contains('CR') ||
loginid!.toUpperCase().contains('VRTC') ||
loginid!.toUpperCase().contains('VRW');

/// checks if [AccountListItem] is disabled or not.
bool get isNotDisabled => !isDisabled!;
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ class DerivAuthService extends BaseAuthService {

_checkAuthorizeValidity(responseAuthorizeEntity);

final List<AccountListItem> _filteredAccounts =
_filterSupportedAccountsFromAuthorizeResponse(
responseAuthorizeEntity?.accountList ?? <AccountListItem>[]);

final AuthorizeEntity _enhancedAuthorizeEntity =
responseAuthorizeEntity!.copyWith(
signupProvider: signupProvider,
refreshToken: refreshToken,
accountList: _getAccountListWithToken(
responseAuthorizeEntity.accountList,
_filteredAccounts,
accounts,
),
);
Expand Down Expand Up @@ -186,6 +190,23 @@ class DerivAuthService extends BaseAuthService {
return supportedAccounts;
}

List<AccountListItem> _filterSupportedAccountsFromAuthorizeResponse(
List<AccountListItem> accounts) {
final List<AccountListItem> supportedAccounts = accounts
.where((AccountListItem account) =>
account.isSupported && account.isNotDisabled)
.toList();

if (supportedAccounts.isEmpty) {
throw DerivAuthException(
message: notAvailableCountryMessage,
type: AuthErrorType.unsupportedCountry,
);
}

return supportedAccounts;
}

DerivAuthException _mapHttpErrorToDerivAuthError(
HTTPClientException exception,
) {
Expand Down
12 changes: 6 additions & 6 deletions packages/deriv_auth/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deriv_auth
description: Provides deriv authentication functionalities for dart/flutter apps.
version: 6.7.50
version: 6.7.51

environment:
sdk: ">=3.0.0 <4.0.0"
Expand All @@ -22,13 +22,13 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_theme
ref: deriv_theme-v2.7.0
ref: deriv_theme-v2.7.1

deriv_ui:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_ui
ref: deriv_ui-v0.1.0+2
ref: deriv_ui-v0.1.0+3

deriv_http_client:
git:
Expand Down Expand Up @@ -57,13 +57,13 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_passkeys
ref: deriv_passkeys-v0.0.4+5
ref: deriv_passkeys-v0.0.4+6

deriv_language_selector:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_language_selector
ref: deriv_language_selector-v0.0.3+9
ref: deriv_language_selector-v0.0.3+10

flutter_bloc: ^8.1.3
flutter_svg: ^2.0.7
Expand All @@ -79,7 +79,7 @@ dependency_overrides:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_ui
ref: deriv_ui-v0.1.0+2
ref: deriv_ui-v0.1.0+3

dev_dependencies:
mocktail: ^1.0.3
Expand Down
4 changes: 4 additions & 0 deletions packages/deriv_date_range_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1+10

- Update a dependency to the latest release.

## 0.0.1+9

- Update a dependency to the latest release.
Expand Down
4 changes: 2 additions & 2 deletions packages/deriv_date_range_picker/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deriv_date_range_picker
description: A new Flutter package project.
version: 0.0.1+9
version: 0.0.1+10
publish_to: "none" # Remove this line if you wish to publish to pub.dev

environment:
Expand All @@ -17,7 +17,7 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_theme
ref: deriv_theme-v2.7.0
ref: deriv_theme-v2.7.1

intl: ^0.18.0

Expand Down
4 changes: 4 additions & 0 deletions packages/deriv_expandable_bottom_sheet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1+10

- Update a dependency to the latest release.

## 0.0.1+9

- Update a dependency to the latest release.
Expand Down
4 changes: 2 additions & 2 deletions packages/deriv_expandable_bottom_sheet/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deriv_expandable_bottom_sheet
description: A new Flutter package project.
version: 0.0.1+9
version: 0.0.1+10
publish_to: none

environment:
Expand All @@ -15,7 +15,7 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_theme
ref: deriv_theme-v2.7.0
ref: deriv_theme-v2.7.1

dev_dependencies:
flutter_test:
Expand Down
4 changes: 4 additions & 0 deletions packages/deriv_language_selector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.3+10

- Update a dependency to the latest release.

## 0.0.3+9

- Update a dependency to the latest release.
Expand Down
4 changes: 2 additions & 2 deletions packages/deriv_language_selector/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deriv_language_selector
description: A package to select language for the app. It provides both UI and logic for language selection.
version: 0.0.3+9
version: 0.0.3+10
publish_to: "none"

environment:
Expand All @@ -14,7 +14,7 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_ui
ref: deriv_ui-v0.1.0+2
ref: deriv_ui-v0.1.0+3
shared_preferences: ^2.2.2
flutter_bloc: ^8.1.4
equatable: ^2.0.5
Expand Down
8 changes: 8 additions & 0 deletions packages/deriv_mobile_chart_wrapper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.1.3+1

- Update a dependency to the latest release.

## 0.1.3

- **FEAT**(deriv_mobile_chart_wrapper): [DRGO-73] Added line drawing guide banner ([#826](https://github.com/regentmarkets/flutter-deriv-packages/issues/826)). ([b2b018ec](https://github.com/regentmarkets/flutter-deriv-packages/commit/b2b018ec78d9f2de0dcc71b2a76f1343581f4f03))

## 0.1.2

- **FEAT**(deriv_mobile_chart_wrapper): [DRGO-81] Functionality to add dots for drawing tool. ([#810](https://github.com/regentmarkets/flutter-deriv-packages/issues/810)). ([05d5c85f](https://github.com/regentmarkets/flutter-deriv-packages/commit/05d5c85f9b5c204ec54eb3828b262fe7c0293ac0))
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/deriv_mobile_chart_wrapper/lib/src/assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ const String lineIcon = '${iconAssetsFolder}ic_line.svg';
const String emptyStateDrawingToolsIcon =
'${iconAssetsFolder}ic_drawing_tools_empty_state.svg';
const String drawingToolIcon = '${iconAssetsFolder}ic_drawing_tool.svg';
const String closeFilledIcon = '${iconAssetsFolder}ic_close_filled.svg';
7 changes: 7 additions & 0 deletions packages/deriv_mobile_chart_wrapper/lib/src/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:deriv_chart/deriv_chart.dart';

// A set of drawing tool types that has to show drawing tool info bar.
const Set<Type> drawingToolTypesToShowInfoBar = {
LineDrawingToolConfig,
RayDrawingToolConfig,
};
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,11 @@ class MobileChartWrapperState extends State<MobileChartWrapper> {
}
};

_indicatorsRepo?.addListener(() {
_updateConfigs();
});

_drawingToolsRepo?.addListener(() {
_updateConfigs();
});

_updateConfigs();
_updateDrawingTools();

_indicatorsRepo?.addListener(_updateConfigs);
_drawingToolsRepo?.addListener(_updateConfigs);
}

void _initRepos() async {
Expand Down Expand Up @@ -299,6 +295,7 @@ class MobileChartWrapperState extends State<MobileChartWrapper> {
child: DrawingToolsSelector(
onDrawingToolSelected: (DrawingToolConfig selectedDrawingTool) {
_drawingTools.onDrawingToolSelection(selectedDrawingTool);
_updateDrawingTools();
Navigator.of(context).pop();
},
),
Expand Down Expand Up @@ -339,10 +336,23 @@ class MobileChartWrapperState extends State<MobileChartWrapper> {
activeSymbol: widget.toolsStoreKey,
);

@override
void dispose() {
_indicatorsRepo?.removeListener(_updateConfigs);
_drawingToolsRepo?.removeListener(_updateConfigs);
super.dispose();
}

/// Update the configs in the tools controller.
void _updateConfigs() {
widget.toolsController?.updateConfigs(ConfigItemModel(
indicatorConfigs: _indicatorsRepo?.items ?? [],
drawingToolConfigs: _drawingToolsRepo?.items ?? [],
));
}

/// Update the drawing tools data in the tool controller.
void _updateDrawingTools() {
widget.toolsController?.updateDrawingToolsData(_drawingTools);
}
}
Loading

0 comments on commit 8aede4c

Please sign in to comment.