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 Jul 3, 2024
2 parents 5038110 + b29d222 commit 3c5a022
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ This repository contains private packages & plugins that are used by the company

### <span style="color:green">GIT HOOK</span>

<span style="color:orange">Please run the below command to have the git hook installed.</span></br>
<span style="color:orange">This Hook will check for Semantic versioning commit convention</span></br>
1- Please download commit-msg file from githooks/commit-msg.</br>
2- Run the command below.</br>

```BASH
curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/regentmarkets/flutter-deriv-packages/master/githooks/commit-msg \
cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \
&& chmod +x $HOME/.git/hooks/commit-msg
```

## Using the packages

Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.9)`. To use the package, add the following to your pubspec.yaml file:


```yaml
deriv_ui:
git:
Expand All @@ -41,8 +41,8 @@ deriv_ui:
| [deriv_http_client](./packages/deriv_http_client) | A package that provides a wrapper for http package. | [v2.0.0](./packages/deriv_http_client/CHANGELOG.md) |
| [deriv_lint](./packages/deriv_lint) | A Dart package that provides lint rules for Dart and Flutter. | [v1.0.0](./packages/deriv_lint/CHANGELOG.md) |
| [deriv_live_chat](./packages/deriv_live_chat) | A plugin for live chat SDK support to dart. | [v0.0.1+2](./packages/deriv_live_chat/CHANGELOG.md) |
| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./packages/deriv_language_selector/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) | | [v1.5.1](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./packages/deriv_language_selector/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./packages/deriv_numpad/CHANGELOG.md) |
| [deriv_rudderstack](./packages/deriv_rudderstack) | A plugin that add RudderStack SDK support to Flutter. | [v1.1.0](./packages/deriv_rudderstack/CHANGELOG.md) |
| [deriv_store_launcher](./packages/deriv_store_launcher) | A plugin to launch app stores base on platform and manufacturer. | [v0.0.1+1](./packages/deriv_store_launcher/CHANGELOG.md) |
Expand All @@ -51,38 +51,38 @@ deriv_ui:
| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+9](./packages/deriv_ui/CHANGELOG.md) |
| [deriv_utilities](./packages/deriv_utilities) | A package that contains the utilities including helper functions, mixins, and extensions. | [v1.0.0](./packages/deriv_utilities/CHANGELOG.md) |
| [deriv_websocket](./packages/deriv_web_socket_client) | A package that provides a easy to use websocket client. | [v1.0.1](./packages/deriv_web_socket_client/CHANGELOG.md) |
| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) |
| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) |
| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) |
| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) |
| [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.4.0](./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_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) |
## Environment Setup
We use [Melos](https://pub.dev/packages/melos) to manage the multiple packages in this repository. To get started, install Melos globally:
```bash
$ dart pub global activate melos
dart pub global activate melos
```

Running `pub get` on all packages, run:

```bash
$ melos bootstrap
melos bootstrap
```

`Analyze` and `Test` has already been configured in `melos.yaml` so you can do the following:

<b>Running `flutter analyze` on all packages:</b>

```bash
$ melos run analyze
melos run analyze
```

<b>Running `flutter test` on all packages: </b>

```bash
$ melos run test --no-select
melos run test --no-select
```

If you'd like to run any other command on all packages, you can configure it in `melos.yaml` or run it directly with melos:
Expand Down
3 changes: 2 additions & 1 deletion packages/deriv_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ DerivAuthCubit(

Some usage examples:


- First, start by getting the `DerivAuthCubit` instance.

```dart
Expand Down Expand Up @@ -341,4 +342,4 @@ Some usage examples:
```dart
/// Call the [getSocialAuthProviders] method.
_cubit.getSocialAuthProviders();
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:deriv_auth/core/analytics/enums.dart';
Map<String, dynamic> getUserTrackingData(
LoginAction action,
String appId, {
LoginProvider? provider,
required LoginProvider provider,
String? errorMessage,
}) =>
switch (action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackUserOpenedLoginForm() {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.openLoginForm,
_appId,
provider: _loginProvider!,
);

_derivRudderstack.track(
eventName: data['event'] as String,
properties: data['properties'] as Map<String, dynamic>,
Expand All @@ -51,10 +55,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackError(String errorMessage) {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.loginError,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
errorMessage: errorMessage,
);

Expand Down Expand Up @@ -107,7 +115,7 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {
final Map<String, dynamic> data = getUserTrackingData(
LoginAction.startLogin,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
);

_derivRudderstack.track(
Expand All @@ -118,10 +126,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackLoginFinished() {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.finishLogin,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
);

_derivRudderstack.track(
Expand Down

0 comments on commit 3c5a022

Please sign in to comment.