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

Original #321

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ GitScrum collaborates to overcome the objectives with implementation of manageme

## Overview

Laravel GitScrum is a **free application** developed specifically for agile teams to be more agile!. The aim is help the developer teams to use **Git** and **Scrum** on task management of the day-to-day.
Laravel GitScrum is a **free application** developed on Laravel. The aim is help the developer teams to use **Git** and **Scrum** on task management of the day-to-day.

Available in English, Chinese, Russian, German, Arabic, Spanish, Portuguese, Italian, French, Indonesian, Serbian, Hungarian and Vietnamese.

Expand Down
16 changes: 8 additions & 8 deletions app/Classes/Gitlab.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function tplUser($obj)
public function tplRepository($repo, $slug = false)
{
$organization = $this->organization($repo);

if (!$organization) {
return;
}
Expand Down Expand Up @@ -114,9 +113,10 @@ public function tplOrganization($obj)

public function readRepositories($page = 1, &$repos = null)
{
$repos = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/projects?access_token='.Auth::user()->token));
$repos = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v4/projects?access_token='.Auth::user()->token));

$response = $repos->map(function ($repo) {

return $this->tplRepository($repo);
});

Expand All @@ -136,7 +136,7 @@ public function organization($obj)
if (!isset($obj->owner) && isset($obj->namespace)) {
// To avoid to make unnecessary calls to the api to get the groups info saving the fetched groups into a private variable
if (!isset($this->gitlabGroups[$obj->namespace->id])) {
$group = current(collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/groups/'.$obj->namespace->id.'?access_token='.Auth::user()->token)));
$group = current(collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v4/groups/'.$obj->namespace->id.'?access_token='.Auth::user()->token)));

$this->gitlabGroups[$obj->namespace->id] = $group;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ public function organization($obj)
*/
private function getGroupsMembers($group)
{
$members = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/groups/'.$group.'/members?access_token='.Auth::user()->token));
$members = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/V4/groups/'.$group.'/members?access_token='.Auth::user()->token));

return $members;
}
Expand All @@ -187,7 +187,7 @@ private function getGroupsMembers($group)
*/
private function getProjectMembers($projectId)
{
$members = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/projects/'.$projectId.'/members?access_token='.Auth::user()->token));
$members = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/V4/projects/'.$projectId.'/members?access_token='.Auth::user()->token));

return $members;
}
Expand All @@ -202,7 +202,7 @@ private function getProjectMembers($projectId)
*/
private function getProjectSharedGroupsMembers($projectId)
{
$project = Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/projects/'.$projectId.'?access_token='.Auth::user()->token);
$project = Helper::request(env('GITLAB_INSTANCE_URI').'api/V4/projects/'.$projectId.'?access_token='.Auth::user()->token);

$members = new \Illuminate\Support\Collection();

Expand Down Expand Up @@ -279,7 +279,7 @@ public function readCollaborators($owner, $repo, $providerId = null)

public function createBranches($owner, $product_backlog_id, $repo, $providerId = null)
{
$branches = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/projects/'.$providerId.'/repository/branches?access_token='.Auth::user()->token));
$branches = collect(Helper::request(env('GITLAB_INSTANCE_URI').'api/V4/projects/'.$providerId.'/repository/branches?access_token='.Auth::user()->token));

$branchesData = [];
foreach ($branches as $branch) {
Expand All @@ -302,7 +302,7 @@ public function readIssues()
$repos = ProductBacklog::all();

foreach ($repos as $repo) {
$issues = Helper::request(env('GITLAB_INSTANCE_URI').'api/v3/projects/'.$repo->provider_id.
$issues = Helper::request(env('GITLAB_INSTANCE_URI').'api/V4/projects/'.$repo->provider_id.
'/issues?access_token='.Auth::user()->token);

$issues = is_array($issues) ? $issues : [$issues];
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Web/ProductBacklogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class ProductBacklogController extends Controller
*/
public function index(Request $request, $mode = 'default')
{
$backlogs = ProductBacklog::paginate(env('APP_PAGINATE'));

$backlogs = ProductBacklog::where('user_id',Auth::user()->id)->paginate(env('APP_PAGINATE'));
return view('product_backlogs.index-'.$mode)
->with('backlogs', $backlogs);
}
Expand Down
Loading