Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
af4bfec
updated search urls to search/group
mabuturabcloudelligent Mar 19, 2021
1323d2c
validation check for Language accept header
mabuturabcloudelligent Mar 19, 2021
3a93121
fix Logging of accept header
mabuturabcloudelligent Mar 19, 2021
32e4556
init CI/CD with github actions
yahyagulshan Mar 22, 2021
f23b0e9
init CI/CD with github actions 02
yahyagulshan Mar 22, 2021
7a30fc2
init CI/CD with github actions 03
yahyagulshan Mar 22, 2021
ecd2bde
init CI/CD with github actions 04
yahyagulshan Mar 22, 2021
eebe1b6
init CI/CD with github actions 05
yahyagulshan Mar 22, 2021
6bc1c49
init CI/CD with github actions 06
yahyagulshan Mar 22, 2021
2b68a91
init CI/CD with github actions 07
yahyagulshan Mar 22, 2021
0102be5
init CI/CD with github actions 08
yahyagulshan Mar 23, 2021
a7d46a2
init CI/CD with github actions 09
yahyagulshan Mar 23, 2021
d8fbdaf
init CI/CD with github actions 10
yahyagulshan Mar 23, 2021
91a3249
init CI/CD with github actions 11
yahyagulshan Mar 23, 2021
eada2d6
init CI/CD with github actions 12
yahyagulshan Mar 23, 2021
e1a68e9
init CI/CD with github actions 13
yahyagulshan Mar 23, 2021
0908d74
init CI/CD with github actions 14
yahyagulshan Mar 23, 2021
ace7391
init CI/CD with github actions 15
yahyagulshan Mar 23, 2021
72516ab
init CI/CD with github actions 16
yahyagulshan Mar 23, 2021
45c75c9
init CI/CD with github actions 17
yahyagulshan Mar 23, 2021
0828984
init CI/CD with github actions 18
yahyagulshan Mar 23, 2021
e1c7479
init CI/CD with github actions 19
yahyagulshan Mar 23, 2021
5a88b94
redirect search to search/group
mabuturabcloudelligent Mar 23, 2021
8f37396
Performance issue debugging [WIP]
mabuturabcloudelligent Mar 26, 2021
751ccf4
removed debugging logs
mabuturabcloudelligent Apr 6, 2021
7937a68
updated search urls to search/group
mabuturabcloudelligent Mar 19, 2021
8531c80
validation check for Language accept header
mabuturabcloudelligent Mar 19, 2021
89d8694
fix Logging of accept header
mabuturabcloudelligent Mar 19, 2021
5080388
init CI/CD with github actions
yahyagulshan Mar 22, 2021
cab0476
init CI/CD with github actions 02
yahyagulshan Mar 22, 2021
ab3ec88
init CI/CD with github actions 03
yahyagulshan Mar 22, 2021
c270e44
init CI/CD with github actions 04
yahyagulshan Mar 22, 2021
096b87d
init CI/CD with github actions 05
yahyagulshan Mar 22, 2021
18f4ba6
init CI/CD with github actions 06
yahyagulshan Mar 22, 2021
5c5ad20
init CI/CD with github actions 07
yahyagulshan Mar 22, 2021
4ed66b5
init CI/CD with github actions 08
yahyagulshan Mar 23, 2021
415953e
init CI/CD with github actions 09
yahyagulshan Mar 23, 2021
dbb6e79
init CI/CD with github actions 10
yahyagulshan Mar 23, 2021
edb6466
init CI/CD with github actions 11
yahyagulshan Mar 23, 2021
56219a9
init CI/CD with github actions 12
yahyagulshan Mar 23, 2021
5167db5
init CI/CD with github actions 13
yahyagulshan Mar 23, 2021
5bee40c
init CI/CD with github actions 14
yahyagulshan Mar 23, 2021
2840e2d
init CI/CD with github actions 15
yahyagulshan Mar 23, 2021
73da6d3
init CI/CD with github actions 16
yahyagulshan Mar 23, 2021
919e96f
init CI/CD with github actions 17
yahyagulshan Mar 23, 2021
090e1b4
init CI/CD with github actions 18
yahyagulshan Mar 23, 2021
19fc2ef
init CI/CD with github actions 19
yahyagulshan Mar 23, 2021
031e675
redirect search to search/group
mabuturabcloudelligent Mar 23, 2021
a242c43
Performance issue debugging [WIP]
mabuturabcloudelligent Mar 26, 2021
bad6ea0
removed debugging logs
mabuturabcloudelligent Apr 6, 2021
5800423
Merge branch 'feature/enhancements-deploy' of https://github.com/youn…
mabuturabcloudelligent Apr 16, 2021
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
57 changes: 57 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Docker Image CI

on:
push:
branches: [ feature/enhancements ]
jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Docker login Docker Build Docker Push
id: create-docker-image
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_REGISTRY: ${{secrets.DOCKER_REGISTRY}}
DOCKER_REPOSITORY: ${{secrets.DOCKER_REPOSITORY}}
ECS_TASK_DEFINITION: ${{secrets.ECS_TASK_DEFINITION}}
GIT_HASH: ${{ github.sha }}
run: |
# Build a docker container and
# push it to Docker Hub so that it can
# be deployed to ECS.
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker pull $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/} || echo 'Cache not available'
docker build --cache-from $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/} -t $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}.$GIT_HASH .
docker tag $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}.$GIT_HASH $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}
docker push $DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}.$GIT_HASH
echo "::set-output name=image::$DOCKER_REGISTRY/$DOCKER_REPOSITORY:${GITHUB_REF##*/}.$GIT_HASH"
echo $ECS_TASK_DEFINITION > task-definition.json

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Fill in the nginx image ID in the Amazon ECS task definition
id: fill-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: ${{ secrets.CONTAINER_NAME }}
image: ${{ steps.create-docker-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.fill-task-def.outputs.task-definition }}
service: ${{ secrets.ECS_SERVICE }}
cluster: ${{ secrets.ECS_CLUSTER }}
wait-for-service-stability: true
2 changes: 1 addition & 1 deletion app/Http/Controllers/FilterController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace App\Http\Controllers;

use Carbon\Carbon;
use App\Http\Services\APIService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
Expand Down Expand Up @@ -83,7 +84,6 @@ public function gIndex(Request $request)
'description' => sprintf($descp, $title),
];
$showCountry = true;

return view(
'site.groupDemo',
compact(
Expand Down
4 changes: 0 additions & 4 deletions app/Http/Services/APIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ public function filterRecentSearch($filter)
{
extract($filter);
$per_page = !empty($per_page) ? $per_page : 25;

redirectIfOldAnnotationCategory($annotation_category);

$query = [
Expand All @@ -287,13 +286,11 @@ public function filterRecentSearch($filter)
'annotated' => $annotated,

];

if ($filter['download']) {
$this->downloadAPI('contracts/search', $query);
}

$contract = $this->apiCall('contracts/recent', $query);

if ($contract) {
return $contract;
}
Expand All @@ -312,7 +309,6 @@ public function filterGroupSearch($filter)
{
extract($filter);
$per_page = !empty($per_page) ? $per_page : 25;

redirectIfOldAnnotationCategory($annotation_category);

$query = [
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Services/LocalizationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use App\Http\Services\Admin\OptionService;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Translation\Translator;

/**
Expand Down Expand Up @@ -81,8 +82,13 @@ public function getLanguage($lang = null)

$browserLang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : '';

if (!isset($_COOKIE[$this->key]) && array_key_exists($browserLang, $availableLang)) {
if(is_int($browserLang)||is_string($browserLang)) {
if (!isset($_COOKIE[$this->key]) && array_key_exists($browserLang, $availableLang)) {
$lang = $browserLang;
}
} else {
Log::warning("INVALID HTTP_ACCEPT_LANGUAGE");
Log::warning(json_encode($browserLang));
}

if (is_null($lang)) {
Expand Down
6 changes: 3 additions & 3 deletions resources/views/contract/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<label for="">@lang('global.type_contract')</label>
<span class="contract-type-list">@if(isset($contract->metadata->contract_type) && !empty($contract->metadata->contract_type) && is_array($contract->metadata->contract_type))
@foreach($contract->metadata->contract_type as $contractype)
<a href="{{route("search",['contract_type'=>$contractype])}}">{{_l('codelist/contract_type',$contractype) }}</a>
<a href="{{route("search/group",['contract_type'=>$contractype])}}">{{_l('codelist/contract_type',$contractype) }}</a>
@endforeach
@endif
</span>
Expand Down Expand Up @@ -255,7 +255,7 @@ class="view-annotation disabled"><span>@if(site()->isRCCategorySite()) @lang('gl
<li class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<label for="">@lang('contract.company_name')</label>
<span>@if(isset($company->company->name) && !empty($company->company->name)) <a
href="{{route("search",['company_name'=>$company->company->name])}}">{{$company->company->name}} </a> @else
href="{{route("search/group",['company_name'=>$company->company->name])}}">{{$company->company->name}} </a> @else
- @endif</span>
</li>
<li class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
Expand Down Expand Up @@ -295,7 +295,7 @@ class="view-annotation disabled"><span>@if(site()->isRCCategorySite()) @lang('gl
<label for="">@lang('contract.corporate_grouping')</label>
<span>
@if(isset($company->company->corporate_grouping) && !empty($company->company->corporate_grouping))
<a href="{{route("search",
<a href="{{route("search/group",
['corporate_group'=>$company->company->corporate_grouping])}}">{{$company->company->corporate_grouping}} </a>
@else
-
Expand Down
4 changes: 2 additions & 2 deletions resources/views/country/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="filter-wrapper">
<div class="col-lg-12">
<div class="filter-country-wrap">
<form action="{{url('search')}}" method="GET" class="search-form filter-form">
<form action="{{url('search/group')}}" method="GET" class="search-form filter-form">
<div class="form-group">
<button type="submit" class="btn btn-filter-search pull-left"></button>
<input type="text" name="q" class="form-control pull-left"
Expand Down Expand Up @@ -72,7 +72,7 @@
<ul>
@foreach($resources as $resource)
<li>
<span><a href="{{route("search")}}?q=&country%5B%5D={{$country}}&resource%5B%5D={{urlencode($resource->resource)}}">{{_l("resources",$resource->resource)}}</a></span>
<span><a href="{{route("search/group")}}?q=&country%5B%5D={{$country}}&resource%5B%5D={{urlencode($resource->resource)}}">{{_l("resources",$resource->resource)}}</a></span>
<span class="count pull-right">{{$resource->contract}}</span>
</li>
@endforeach
Expand Down
4 changes: 2 additions & 2 deletions resources/views/resource/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="filter-wrapper">
<div class="col-lg-12">
<div class="filter-country-wrap">
<form action="{{url('search')}}" method="get" class="search-form filter-form">
<form action="{{url('search/group')}}" method="get" class="search-form filter-form">
<div class="form-group">
<button type="submit" class="btn btn-filter-search pull-left"></button>
<input type="text" name="q" class="form-control pull-left"
Expand Down Expand Up @@ -64,7 +64,7 @@
<ul>
@foreach($countries as $country)
<li>
<span><a href="{{route("search")}}?q=&resource%5B%5D={{urlencode($resource)}}&country%5B%5D={{urlencode($country->code)}}">{{trans('country')[strtoupper(ucfirst($country->code))]}}</a></span>
<span><a href="{{route("search/group")}}?q=&resource%5B%5D={{urlencode($resource)}}&country%5B%5D={{urlencode($country->code)}}">{{trans('country')[strtoupper(ucfirst($country->code))]}}</a></span>
<span class="count pull-right">{{$country->contract}}</span>
</li>
@endforeach
Expand Down
5 changes: 5 additions & 0 deletions resources/views/site/filter.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<?php
header("Status: 301 Moved Permanently");
header("Location:./search/group?". $_SERVER['QUERY_STRING']);
die();
?>
@extends('layout.app-full')

@section('content')
Expand Down
4 changes: 2 additions & 2 deletions resources/views/site/home-country.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class="pull-left trigger">
<div class="petroleum-mineral">
{!! site()->meta('tagline') !!}
<div class="clearfix">
<form action="{{route('search')}}" method="GET" class="search-form" role="search">
<form action="{{route('search/group')}}" method="GET" class="search-form" role="search">
<div class="form-group clearfix">
<input type="text" name="q" class="form-control"
placeholder="@lang('global.search') {{$contracts}} @lang('global.contracts') @lang('global.associated_documents')">
Expand All @@ -40,7 +40,7 @@ class="pull-left trigger">
</div>
</form>
<div class="advance-search">
<a href="{{url('search')}}">@lang('global.advanced_search')</a>
<a href="{{url('search/group')}}">@lang('global.advanced_search')</a>
</div>
</div>
</div>
Expand Down