Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set currency and timezone for new users #1657

Merged
merged 33 commits into from Oct 25, 2018
Merged

Conversation

asbiin
Copy link
Member

@asbiin asbiin commented Aug 4, 2018

Set currency and timezone for a new User, depending of its current connected country timezone, or locale.

@asbiin asbiin changed the title feat: Set default currency and timezone feat: Set default currency and timezone [wip] Aug 6, 2018
@djaiss
Copy link
Member

djaiss commented Aug 17, 2018

What's the goal of this PR?

@asbiin
Copy link
Member Author

asbiin commented Aug 20, 2018

Default currency is USD, and default timezone is UTC for everyone. We can set these settings by detecting the current location of the user.

Copy link
Member

@djaiss djaiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will it work in a local instance, as we don't have access to CloudFlare locally?

@@ -59,4 +64,118 @@ private static function getCommonNameLocale($country)
array_get($country, 'name.common', '')
);
}

private static function getCountry($iso)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a description of what the method does?

return $country;
}

public static function getDefaultCountryFromLang($locale)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description (BlockDoc)?
Should it be named FromLocale instead?

app/Helpers/CountriesHelper.php Show resolved Hide resolved
app/Helpers/CountriesHelper.php Show resolved Hide resolved
if (is_null($country)) {
$user->timezone = config('app.timezone');
} else {
foreach ($country->currencies as $currencie) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$currencie --> $currency

Copy link

@sonarcloud sonarcloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube analysis found issues:
Bug Bugs: 0
Vulnerability Vulnerabilities: 0
Code Smell Code Smells: 1

See all issues in SonarCloud

Copy link

@sonarcloud sonarcloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube analysis found issues:
Bug Bugs: 0
Vulnerability Vulnerabilities: 0
Code Smell Code Smells: 1

See all issues in SonarCloud

Copy link

@sonarcloud sonarcloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube analysis found issues:
Bug Bugs: 0
Vulnerability Vulnerabilities: 0
Code Smell Code Smells: 1

See all issues in SonarCloud

Copy link

@sonarcloud sonarcloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube analysis found issues:
Bug Bugs: 0
Vulnerability Vulnerabilities: 0
Code Smell Code Smells: 1

See all issues in SonarCloud

@asbiin asbiin temporarily deployed to monica-team-pr-1657 October 19, 2018 15:55 Inactive
@asbiin asbiin changed the title feat: Set default currency and timezone [wip] feat: Set default currency and timezone Oct 19, 2018
@asbiin asbiin temporarily deployed to monica-team-pr-1657 October 19, 2018 17:11 Inactive
@asbiin asbiin changed the title feat: Set default currency and timezone feat: Set currency and timezone for new users Oct 19, 2018
@asbiin asbiin changed the title feat: Set currency and timezone for new users feat: set currency and timezone for new users Oct 19, 2018
@asbiin asbiin temporarily deployed to monica-team-pr-1657 October 19, 2018 17:36 Inactive
@asbiin asbiin temporarily deployed to monica-team-pr-1657 October 19, 2018 20:57 Inactive
@github-actions
Copy link

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants