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

Freeze v4.4.0 #3873

Merged
merged 81 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4577bd6
feat: enable HDX for everyone
rowasc Sep 20, 2019
c22fdd5
fix(HDX): show message instead of full exception or the system will c…
rowasc Sep 23, 2019
935ee97
Fixed hdx issue 409 - todo: fix attributes being sent incomplete
rowasc Oct 11, 2019
93f7a92
Fix error message in src/App/ExternalServices/HDXInterface.php
rowasc Jan 9, 2020
d53fd28
Merge branch 'develop' of github.com:ushahidi/platform into fix-hdx
rowasc Jan 9, 2020
696aa32
fix(HDX): left join on the query that pulls the tags and attributes i…
rowasc Jan 9, 2020
691862b
fix(HDX): Remove unused vardump
rowasc Jan 9, 2020
d1b3cae
Merge branch 'develop' of github.com:ushahidi/platform into fix-hdx
rowasc Jan 14, 2020
9174640
fix(ExportJobRepository): when assigning setState for entities that w…
rowasc Jan 14, 2020
a50b67f
Merge branch 'develop' into fix-hdx
rowasc Jan 14, 2020
a6d8586
Merge branch 'fix-hdx' of github.com:ushahidi/platform into fix-hdx
rowasc Jan 14, 2020
9188f24
refactor(FormatUrl): this urlFormatter should be a trait, it is getti…
rowasc Jan 19, 2020
1980444
feat(LangHeaders): add language headers and another es file
rowasc Jan 22, 2020
c60410b
Merge branch 'develop' into add-lang-headers
rowasc Jan 22, 2020
72aa12b
feat(Lang): add keys for validation failures on old sprintf statements
rowasc Jan 22, 2020
750e184
Merge branch 'develop' of github.com:ushahidi/platform into add-lang-…
rowasc Jan 22, 2020
1d13c35
Merge branch 'add-lang-headers' of github.com:ushahidi/platform into …
rowasc Jan 22, 2020
76d0818
feat: Add wilduran/negotiation to validate language headers
rowasc Jan 28, 2020
ec062ae
feat: Add wilduran/negotiation to validate language headers
rowasc Jan 28, 2020
a306f12
Revert "feat: Add wilduran/negotiation to validate language headers"
rowasc Jan 28, 2020
6f4a801
feat: Add wilduran/negotiation to validate language headers - add abi…
rowasc Jan 28, 2020
c02f883
Change `file` to `array` as supported drivers for cache
rowasc Jan 29, 2020
fee6c5e
Change file to array in CACHE_DRIVER settings for testing
rowasc Jan 29, 2020
a2106f0
Changing CACHE_DRIVER test settings to array instead of file
rowasc Jan 29, 2020
efb4209
Change CACHE_DRIVER to explain available options
rowasc Jan 29, 2020
ae59d98
fix(TranslatorTrait): added and adjusted tests and code to use the tr…
rowasc Jan 30, 2020
b3869fc
Merge branch 'develop' into add-lang-headers
rowasc Jan 30, 2020
2511869
fix(TranslatorTrait): added and adjusted tests and code to use the tr…
rowasc Jan 30, 2020
a0e0232
Merge branch 'add-lang-headers' of github.com:ushahidi/platform into …
rowasc Jan 30, 2020
0160b21
Solved issue #3533 by editing the label "create a new Twitter applica…
Jenniline Feb 5, 2020
6fa4a70
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Feb 7, 2020
8308a54
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 7, 2020
8f9c957
Merge pull request #3842 from ushahidi/all-contributors/add-himil-vasava
Angamanga Feb 7, 2020
616c86f
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Feb 7, 2020
65c1148
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 7, 2020
2d91b61
Merge pull request #3843 from ushahidi/all-contributors/add-johnmurray4
Angamanga Feb 7, 2020
7b863fb
Commit to remove the extra " before Twitter
Jenniline Feb 7, 2020
c6e6401
changing the words "a few hours or a few days" and removing the <br />
Jenniline Feb 10, 2020
b0dc4ec
Merge branch 'develop' into patch-2
Angamanga Feb 12, 2020
aca0183
Merge pull request #3840 from Jenniline/patch-2
Angamanga Feb 12, 2020
e5f8938
Merge branch 'develop' into fix-hdx
rowasc Feb 19, 2020
65f67c3
Merge pull request #3831 from ushahidi/fix-hdx
rowasc Feb 19, 2020
d4f7d93
chore: drop support for php 7.1 , set php 7.2 as preferred version, u…
tuxpiper Feb 27, 2020
7f1ea38
Performing Obadha's suggestion on twitter.php
Jenniline Mar 2, 2020
06ed921
Twitter-datasource: moving text to description
Angamanga Mar 2, 2020
9578a79
removing unneccessary dot
Angamanga Mar 2, 2020
ab70889
Merge pull request #3859 from ushahidi/Twitter-text
Angamanga Mar 2, 2020
5607596
Merge pull request #3855 from ushahidi/php-7.2-update
tuxpiper Mar 4, 2020
13480e6
Merge branch 'develop' into add-lang-headers
tuxpiper Mar 4, 2020
64f37e1
Merge pull request #3834 from ushahidi/add-lang-headers
tuxpiper Mar 4, 2020
d33741d
chore(translations): add transifex CLI tool config and contributed tr…
tuxpiper Mar 4, 2020
7bf769a
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Mar 5, 2020
1689b62
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Mar 5, 2020
90e634b
fix: travis
individual-it Mar 6, 2020
b332e8d
fix: lint
individual-it Mar 6, 2020
ad10bc8
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Mar 7, 2020
422fe7a
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Mar 7, 2020
acf5573
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Mar 7, 2020
b85336c
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Mar 7, 2020
8df4679
Merge pull request #3865 from ushahidi/all-contributors/add-himil-vasava
tuxpiper Mar 7, 2020
12a38a4
Merge pull request #3862 from ushahidi/all-contributors/add-rohit645
tuxpiper Mar 7, 2020
1887737
Merge branch 'develop' into all-contributors/add-Jenniline
tuxpiper Mar 7, 2020
758db2c
Merge pull request #3866 from ushahidi/all-contributors/add-Jenniline
tuxpiper Mar 7, 2020
bed4daf
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Mar 7, 2020
bebf0ec
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Mar 7, 2020
a36fd0e
Merge pull request #3868 from ushahidi/all-contributors/add-ljvargh
tuxpiper Mar 7, 2020
6171c1a
Merge pull request #3860 from ushahidi/transifex-update-20200304
tuxpiper Mar 9, 2020
22ab236
Merge branch 'develop' into fixTravis
tuxpiper Mar 9, 2020
8ce8a46
docs: update docs/contributors-to-ushahidi.md [skip ci]
allcontributors[bot] Mar 9, 2020
dfe4026
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Mar 9, 2020
bd6beb7
Merge pull request #3864 from individual-it/fixTravis
tuxpiper Mar 9, 2020
16d5b85
Merge pull request #3869 from ushahidi/all-contributors/add-individua…
tuxpiper Mar 9, 2020
faa6c33
feature flag: Disable HDX until we fix the bugs found in QA
rowasc Mar 9, 2020
d0d3325
Merge pull request #3870 from ushahidi/rowasc-hdx-off
tuxpiper Mar 9, 2020
4714fb2
Merge branch 'master' into develop-from-master-20200309
tuxpiper Mar 9, 2020
88da578
Merge pull request #3871 from ushahidi/develop-from-master-20200309
tuxpiper Mar 9, 2020
833c0da
GitBook: [develop] 66 pages modified
tuxpiper Mar 9, 2020
a354f0f
GitBook: [develop] 2 pages modified
tuxpiper Mar 9, 2020
b6abc9a
Merge branch 'master' into develop
tuxpiper Mar 9, 2020
1feca66
chore(translations): update locales
tuxpiper Mar 9, 2020
8e4d6f8
Merge pull request #3874 from ushahidi/update-locales-20200309
tuxpiper Mar 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,61 @@
"contributions": [
"code"
]
},
{
"login": "himil-vasava",
"name": "Himil Vasava",
"avatar_url": "https://avatars3.githubusercontent.com/u/55590415?v=4",
"profile": "https://github.com/himil-vasava",
"contributions": [
"code"
]
},
{
"login": "johnmurray4",
"name": "johnmurray4",
"avatar_url": "https://avatars1.githubusercontent.com/u/54542562?v=4",
"profile": "https://github.com/johnmurray4",
"contributions": [
"doc"
]
},
{
"login": "Jenniline",
"name": "Jenniline ",
"avatar_url": "https://avatars0.githubusercontent.com/u/39647995?v=4",
"profile": "https://github.com/Jenniline",
"contributions": [
"code"
]
},
{
"login": "rohit645",
"name": "Rohit Kumar",
"avatar_url": "https://avatars2.githubusercontent.com/u/33249010?v=4",
"profile": "http://rohit645.github.io",
"contributions": [
"bug",
"code"
]
},
{
"login": "ljvargh",
"name": "ljvargh",
"avatar_url": "https://avatars3.githubusercontent.com/u/47359729?v=4",
"profile": "https://github.com/ljvargh",
"contributions": [
"doc"
]
},
{
"login": "individual-it",
"name": "Artur Neumann",
"avatar_url": "https://avatars1.githubusercontent.com/u/2425577?v=4",
"profile": "https://www.jankaritech.com",
"contributions": [
"infra"
]
}
],
"projectName": "platform",
Expand Down
2 changes: 1 addition & 1 deletion .env.travis
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DB_HOST_REPLICA=127.0.0.1
DB_PORT=3306
DB_DATABASE=ushahidi
DB_USERNAME=travis
DB_PASSWORD=
DB_PASSWORD=password

CACHE_DRIVER=array
QUEUE_DRIVER=sync
Expand Down
16 changes: 3 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
sudo: false
dist: precise
#notifications:
# slack:
# secure: NxhzhKGYnZYZiWVZM4w1PlZpTy9bbmNlvbqjL+9d4PvK4hFzPwQU12CchhBPeXNGLWBHg/ti6Scn/t5XIS3YJrkk4ydWmJBht5UId8uFZ1A7GCUnNNPTt2RG55lbJJdZSj01rOGZjEQbE5RyckEjgRzhZjdZ+HsjoPaRzWIBrvE=
language: php
php:
- '7.0'
- '7.1'
- '7.2'
- 'nightly'
- '7.3'
env:
- coverage="--coverage"
- coverage=""
matrix:
exclude:
- php: '7.1'
- php: '7.3'
env: coverage="--coverage"
- php: '7.2'
env: coverage="--coverage"
- php: 'nightly'
env: coverage="--coverage"
allow_failures:
- env: coverage="--coverage"
- php: 'nightly'
fast_finish: true
cache:
directories:
Expand All @@ -31,6 +20,7 @@ services:
- mysql
before_install:
- mysql -e 'CREATE DATABASE ushahidi;'
- mysql -e "SET PASSWORD FOR travis@localhost = PASSWORD('password')";
- mysql -e "select version();"
- mysql -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"
- cp .env.travis .env
Expand Down
103 changes: 103 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
; recommended pull command
;
; tx pull -a --minimum-perc 1 --mode onlytranslated
;

[main]
host = https://www.transifex.com

[ushahidi-v3-api.configphp]
file_filter = resources/lang/<lang>/config.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.contactsphp]
file_filter = resources/lang/<lang>/contacts.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.csvphp]
file_filter = resources/lang/<lang>/csv.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.exportphp]
file_filter = resources/lang/<lang>/export.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.form_attributephp]
file_filter = resources/lang/<lang>/form_attribute.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.form_contactphp]
file_filter = resources/lang/<lang>/form_contact.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.formphp]
file_filter = resources/lang/<lang>/form.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.form_rolephp]
file_filter = resources/lang/<lang>/form_role.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.hxl_metadataphp]
file_filter = resources/lang/<lang>/hxl_metadata.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.layersphp]
file_filter = resources/lang/<lang>/layers.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.mediaphp]
file_filter = resources/lang/<lang>/media.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.messagephp]
file_filter = resources/lang/<lang>/message.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.notificationsphp]
file_filter = resources/lang/<lang>/notifications.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.postphp]
file_filter = resources/lang/<lang>/post.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.rolephp]
file_filter = resources/lang/<lang>/role.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.tagphp]
file_filter = resources/lang/<lang>/tag.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.userphp]
file_filter = resources/lang/<lang>/user.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.user_settingphp]
file_filter = resources/lang/<lang>/user_setting.php
source_lang = en
type = PHP_ARRAY

[ushahidi-v3-api.validationphp]
file_filter = resources/lang/<lang>/validation.php
source_lang = en
type = PHP_ARRAY

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ushahidi/php-fpm-nginx:php-7.1
FROM ushahidi/php-fpm-nginx:php-7.2

WORKDIR /var/www
COPY composer.json ./
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/RESTController.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ protected function prepResponse(array $responsePayload = null, Request $request)
if (! in_array($request->method(), $this->cacheableMethods)) {
$response->headers->set('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate');
}

$response->headers->set('Content-language', app('translator')->getLocale());
return $response;
}
}
61 changes: 61 additions & 0 deletions app/Http/Middleware/SetLocale.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
namespace Ushahidi\App\Http\Middleware;

use Closure;
use \Negotiation\LanguageNegotiator;

class SetLocale
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param mixed ...$features
* @return mixed
*/
public function handle($request, Closure $next, ...$features)
{
$langHeader = $request->header('Accept-language');
if ($langHeader) {
$negotiator = new LanguageNegotiator();
$priorities = config('language.locales');

/**
* NOTE: the negotiation library does not support providing a list of ordered elements in its
* stable version so defaulting to english is the best we can do right now without a more complex
* custom class. I'd rather we support the willduran/negotiation library if we go down that path.
*/
$type = $fallback = $this->getPriorityFallback($langHeader, $priorities, 'en');
/**
* TODO:
* decide if we would like to work on extending willduran/negotiation and bring
* v3.0.3 to stable so that we have getOrderedElements available if it's still
* being maintained (or I guess fork if it is no longer mantained)
*/
$bestLanguage = $negotiator->getBest($langHeader, $priorities);
if ($bestLanguage) {
$type = $bestLanguage->getType();
}
app('translator')->setLocale($type);
app('translator')->setFallback($fallback);
}

return $next($request);
}
/**
* Find a secondary language as fallback within our list of available lang codes without region
* or use the default ('en' normally) if none is available.
* When we migrate to v3 of negotiation package we can just use the orderedElements function
* and take q=0.x into account easily.
*/
private function getPriorityFallback($languageCode, $locales, $default)
{
$decision = $default;
$splitLangCode = substr($languageCode, 0, 2);
if (array_search($splitLangCode, $locales) > -1) {
$decision = $splitLangCode;
}
return $decision;
}
}
5 changes: 3 additions & 2 deletions bootstrap/lumen.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// The exception handler class relies on this configuration to be loaded
// in order to provide CORS headers for requests that fail before the middleware stage
$app->configure('cors');

$app->configure('language');
/*
|--------------------------------------------------------------------------
| Register Container Bindings
Expand Down Expand Up @@ -61,7 +61,8 @@
$app->middleware([
Ushahidi\App\Multisite\DetectSiteMiddleware::class,
Barryvdh\Cors\HandleCors::class,
Ushahidi\App\Http\Middleware\MaintenanceMode::class
Ushahidi\App\Http\Middleware\MaintenanceMode::class,
Ushahidi\App\Http\Middleware\SetLocale::class
]);

$app->routeMiddleware([
Expand Down
2 changes: 1 addition & 1 deletion captainhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"action": "\\Tests\\CaptainHook\\PHPCS",
"options": [
"--ignore=vendor/*,application/*,modules/*,plugins/*,httpdocs/*,tests/spec/*,migrations/*,bin/*,database/*,resources/views/*",
"--ignore=vendor/*,application/*,modules/*,plugins/*,httpdocs/*,tests/spec/*,migrations/*,bin/*,database/*,resources/views/*,resources/lang/*",
"--standard=src/ruleset.xml",
"--tab-width=4"
]
Expand Down
15 changes: 0 additions & 15 deletions codeship-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ mysql/base: &_mysql_base
- MYSQL_USER=ushahidi
- MYSQL_PASSWORD=ushahidi
- MYSQL_ROOT_PASSWORD=root
mysql-7.1:
<<: *_mysql_base
mysql-7.2:
<<: *_mysql_base
mysql-7.3:
Expand All @@ -70,19 +68,6 @@ test/base: &_test_defaults
cached: true
default_cache_branch: develop

test/php-7.1:
<<: *_test_defaults
build:
<<: *_test_build_defaults
image: test-7.1
args:
PHP_MAJOR_VERSION: "7.1"
environment:
<<: *_test_env_defaults
DB_HOST: mysql-7.1
depends_on:
- mysql-7.1

test/php-7.2:
<<: *_test_defaults
build:
Expand Down
3 changes: 0 additions & 3 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
- name: "Test"
type: parallel
steps:
- name: "Test PHP 7.1"
service: test/php-7.1
command: test_reporter composer run test --timeout 0
- name: "Test PHP 7.2"
service: test/php-7.2
command: test_reporter composer run test --timeout 0
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": ">=7.0 <7.4",
"php": ">=7.2 <7.4",
"aura/di": "~3.4",
"league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-rackspace": "~1.0",
Expand Down Expand Up @@ -43,7 +43,8 @@
"germanazo/laravel-ckan-api": "^1.0",
"asm89/stack-cors": "1.2.0",
"predis/predis": "~1.1",
"illuminate/redis": "5.5.*"
"illuminate/redis": "5.5.*",
"willdurand/negotiation": "^2.3"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
Expand Down
Loading