Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #62 from K-Phoen/add-repo
Browse files Browse the repository at this point in the history
Improve the 'add repository' page
  • Loading branch information
K-Phoen committed Dec 4, 2017
2 parents 29bf9b0 + 704360e commit be6ee9d
Show file tree
Hide file tree
Showing 55 changed files with 79 additions and 62 deletions.
2 changes: 1 addition & 1 deletion app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function registerBundles()
new Regis\AnalysisContext\Infrastructure\Symfony\Bundle\AnalysisBundle\RegisAnalysisBundle(),
new Regis\GithubContext\Infrastructure\Symfony\Bundle\GithubBundle\RegisGithubBundle(),
new Regis\BitbucketContext\Infrastructure\Symfony\Bundle\BitbucketBundle\RegisBitbucketBundle(),
new Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\RegisAppBundle(),
new Regis\AppContext\Infrastructure\Bundle\AppBundle\RegisAppBundle(),
];

if ($this->getEnvironment() === 'prod') {
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link rel="stylesheet" href="{{ asset('bundles/regisapp/css/dashboard.css') }}">
<link rel="stylesheet" href="{{ asset('bundles/regisapp/css/diff.css') }}">
</head>
<body>
<body id="{% block page_id%}{% endblock %}">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Command;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Regis\GithubContext\Application\Command;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Controller;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Regis\AppContext\Application\Spec;
use Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Form;
use Regis\AppContext\Infrastructure\Bundle\AppBundle\Form;
use Regis\AppContext\Application\Command;

class TeamsController extends Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\DependencyInjection;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Form;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
services:
regis.security.context:
class: Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\Context
class: Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\Context
arguments: [ '@security.token_storage' ]

regis.security.listener.access_denied:
class: Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\AccessDeniedListener
class: Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\AccessDeniedListener
tags:
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException, priority: 200 }

regis.security.voter.command:
class: Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\CommandVoter
class: Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\CommandVoter
arguments: [ '@rulerz' ]
public: false
tags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
services:
regis.app.user_account_provider:
class: Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\UserProvider
class: Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\UserProvider
arguments: ["@regis.app.repository.users"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
regis.twig_extension.date:
class: Regis\AppContext\Infrastructure\Twig\DurationExtension
public: false
tags:
- { name: twig.extension }
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,39 @@ body {
* New repository page
*/

ul#repositories-list {
list-style-type: none;
padding: 0;
#new-repository .repository {
display: flex;
align-items: center;
height: 70px;
border-bottom: 1px solid #e1e1e1;
font-size: 1.8rem;
}

ul#repositories-list li {
display: table-row;
line-height: 2.5rem;
padding: 5px;
#new-repository .repository:hover {
background-color: #f9f9f9;
}

ul#repositories-list .name, ul#repositories-list li:hover > .add-repository {
display: table-cell;
#new-repository .repository .name {
flex: 5;
}

ul#repositories-list .add-repository {
#new-repository .repository .actions {
flex: 2;
text-align: right;
}

#new-repository .repository .actions .btn {
padding-left: 25px;
padding-right: 25px;
font-size: 1.8rem;
}

#repositories-list .actions {
display: none;
margin-left: 1rem;
}

ul#repositories-list li:hover {
background-color: #f5f5f5;
#repositories-list .repository:hover > .actions {
display: inline;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

$(repositories).each(function(i, repository) {
list.append(
'<li>' +
'<a class="name" href="'+ repository.publicUrl +'">' + repository.name + '</a>'+
'<button type="button" data-type="'+repository.type+'" data-name="'+repository.name+'" data-identifier="'+repository.identifier+'" class="add-repository btn btn-primary btn-xs">Add</button>' +
'</li>'
'<div class="repository">' +
'<div class="name">' +
repository.name +
'</div>'+
'<div class="actions">' +
'<a data-type="'+repository.type+'" data-name="'+repository.name+'" data-identifier="'+repository.identifier+'" class="add-repository btn btn-success">Add</a>' +
'</div>' +
'</div>'
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{% extends '::layout.html.twig' %}

{% block page_id %}new-repository{% endblock %}

{% block content %}
<h1 class="page-header">New repository</h1>
<h1 class="page-header">Select a repository</h1>

<form class="form-inline">
<form>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-search"></span></div>
<input type="text" class="form-control" id="repository-search" placeholder="Search…">
<input type="text" class="input-lg form-control" id="repository-search" placeholder="Search…">
</div>
</div>
</form>

<ul id="repositories-list">
<li>Loading...</li>
</ul>
<div id="repositories-list">
<span>Loading...</span>
</div>

<form style="display: none" id="repository-create" action="{{ path('repositories_create') }}" method="POST">
<input type="hidden" name="type" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException as SymfonyAccessDenied;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use RulerZ\RulerZ;
use RulerZ\Spec\Specification;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Regis\Kernel\Security\Context as SecurityContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use Regis\AppContext\Domain\Entity\User;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function find(string $id, $mode = self::MODE_FETCH_NOTHING): Entity\Repos
->addSelect(['i', 'report'])
->leftJoin('r.inspections', 'i')
->leftJoin('i.report', 'report')
->orderBy('i.createdAt', 'DESC');
->orderBy('i.number', 'DESC');
}

$repository = $qb->getQuery()->getOneOrNullResult();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace Regis\AppContext\Infrastructure\Symfony\Twig;
namespace Regis\AppContext\Infrastructure\Twig;

use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

declare(strict_types=1);

namespace Tests\Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Tests\Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException as SymfonyAccessDenied;
use Regis\Kernel\Security\Exception\AccessDenied;
use Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\AccessDeniedListener;
use Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\AccessDeniedListener;

class AccessDeniedListenerTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

declare(strict_types=1);

namespace Tests\Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Tests\Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use PHPUnit\Framework\TestCase;
use RulerZ\RulerZ;
use RulerZ\Spec\Specification;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Regis\AppContext\Domain\Entity;
use Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\CommandVoter;
use Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\CommandVoter;

class CommandVoterTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

declare(strict_types=1);

namespace Tests\Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security;
namespace Tests\Regis\AppContext\Infrastructure\Bundle\AppBundle\Security;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Regis\AppContext\Domain\Entity\User;
use Regis\AppContext\Infrastructure\Symfony\Bundle\AppBundle\Security\Context;
use Regis\AppContext\Infrastructure\Bundle\AppBundle\Security\Context;

class ContextTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

declare(strict_types=1);

namespace Tests\Regis\AppContext\Infrastructure\Symfony\Twig;
namespace Tests\Regis\AppContext\Infrastructure\Twig;

use PHPUnit\Framework\TestCase;
use Regis\AppContext\Infrastructure\Symfony\Twig\DurationExtension;
use Regis\AppContext\Infrastructure\Twig\DurationExtension;

class DurationExtensionTest extends TestCase
{
Expand Down

0 comments on commit be6ee9d

Please sign in to comment.