Skip to content

Commit

Permalink
Merge pull request #222 from OpenConext/feature/remove-institution-sw…
Browse files Browse the repository at this point in the history
…itcher

Remove the SRAA institution switcher
  • Loading branch information
pablothedude authored May 14, 2019
2 parents ab85cd2 + 49e9d57 commit 98f8ec9
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 518 deletions.
111 changes: 48 additions & 63 deletions app/Resources/translations/messages.en_GB.xliff

Large diffs are not rendered by default.

111 changes: 48 additions & 63 deletions app/Resources/translations/messages.nl_NL.xliff

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions app/Resources/translations/validators.en_GB.xliff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2019-02-28T09:38:57Z" source-language="en" target-language="en_GB" datatype="plaintext" original="not.available">
<file date="2019-05-09T15:44:19Z" source-language="en" target-language="en_GB" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down Expand Up @@ -386,14 +386,6 @@
<source>ra.search_ra_candidates.actor_id.type</source>
<target state="new">ra.search_ra_candidates.actor_id.type</target>
</trans-unit>
<trans-unit id="bd92d6d889a754ad24c160b115228db3c7a0802b" resname="ra.search_ra_candidates.actor_institution.blank">
<source>ra.search_ra_candidates.actor_institution.blank</source>
<target state="new">ra.search_ra_candidates.actor_institution.blank</target>
</trans-unit>
<trans-unit id="21931fdf964650189b5c9da690b931a566c1a275" resname="ra.search_ra_candidates.actor_institution.type">
<source>ra.search_ra_candidates.actor_institution.type</source>
<target state="new">ra.search_ra_candidates.actor_institution.type</target>
</trans-unit>
<trans-unit id="f5896924bf34d44a4af698498d21d8732258b418" resname="ra.search_ra_candidates.order_by.invalid_choice">
<source>ra.search_ra_candidates.order_by.invalid_choice</source>
<target>Invalid choice for ordering column</target>
Expand Down
10 changes: 1 addition & 9 deletions app/Resources/translations/validators.nl_NL.xliff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2019-02-28T09:38:43Z" source-language="en" target-language="nl_NL" datatype="plaintext" original="not.available">
<file date="2019-05-09T15:44:18Z" source-language="en" target-language="nl_NL" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
Expand Down Expand Up @@ -387,14 +387,6 @@
<source>ra.search_ra_candidates.actor_id.type</source>
<target state="new">ra.search_ra_candidates.actor_id.type</target>
</trans-unit>
<trans-unit id="bd92d6d889a754ad24c160b115228db3c7a0802b" resname="ra.search_ra_candidates.actor_institution.blank">
<source>ra.search_ra_candidates.actor_institution.blank</source>
<target state="new">ra.search_ra_candidates.actor_institution.blank</target>
</trans-unit>
<trans-unit id="21931fdf964650189b5c9da690b931a566c1a275" resname="ra.search_ra_candidates.actor_institution.type">
<source>ra.search_ra_candidates.actor_institution.type</source>
<target state="new">ra.search_ra_candidates.actor_institution.type</target>
</trans-unit>
<trans-unit id="f5896924bf34d44a4af698498d21d8732258b418" resname="ra.search_ra_candidates.order_by.invalid_choice">
<source>ra.search_ra_candidates.order_by.invalid_choice</source>
<target>Ongeldige keuze voor de sorteringskolom</target>
Expand Down
9 changes: 0 additions & 9 deletions app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@
{{ form_widget(locale_switcher.locale) }}
{{ form_widget(locale_switcher.switch) }}
{{ form_end(locale_switcher) }}
{% if is_granted('ROLE_SRAA') %}
<ul class="nav nav-pills pull-right">
<li role="presentation"{% if app.request.attributes.get('_route') == 'sraa_select_institution' %} class="active"{% endif %}>
<a href="{{ path('sraa_select_institution') }}">
{{ app.user.institution }} <i class="fa fa-exchange"></i> {{ 'ra.menu.sraa_change_institution'|trans }}
</a>
</li>
</ul>
{% endif %}
</div>
</div>
<div class="clearfix"></div>
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ class SearchRaCandidatesCommand
*/
public $actorId;

/**
* @Assert\NotBlank(message="ra.search_ra_candidates.actor_institution.blank")
* @Assert\Type("string", message="ra.search_ra_candidates.actor_institution.type")
*
* @var string
*/
public $actorInstitution;

/**
* @var string
*/
Expand All @@ -53,6 +45,11 @@ class SearchRaCandidatesCommand
*/
public $email;

/**
* @var string
*/
public $raInstitution;

/**
* @Assert\Choice(
* {"name", "email"},
Expand Down Expand Up @@ -82,4 +79,9 @@ class SearchRaCandidatesCommand
* @var array
*/
public $institutionFilterOptions;

/**
* @var array
*/
public $raInstitutionFilterOptions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ class SearchRaListingCommand
*/
public $actorId;

/**
* @Assert\NotBlank(message="ra.search_ra_candidates.actor_institution.blank")
* @Assert\Type("string", message="ra.search_ra_candidates.actor_institution.type")
*
* @var string
*/
public $actorInstitution;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ final class SearchRaSecondFactorsCommand
const STATUS_VETTED = 'vetted';
const STATUS_REVOKED = 'revoked';

/**
* @Assert\NotBlank(message="ra.search_ra_second_factors.institution.blank")
* @Assert\Type("string", message="ra.search_ra_second_factors.institution.type")
*
* @var string
*/
public $actorInstitution;

/**
* @Assert\NotBlank(message="ra.search_ra_second_factors.actor.blank")
* @Assert\Type("string", message="ra.search_ra_second_factors.actor.type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function manageAction(Request $request)
$service = $this->getRaListingService();

$command = new SearchRaListingCommand();
$command->actorInstitution = $identity->institution;
$command->actorId = $identity->id;
$command->pageNumber = (int) $request->get('p', 1);
$command->orderBy = $request->get('orderBy');
Expand Down Expand Up @@ -116,8 +115,9 @@ public function raCandidateSearchAction(Request $request)
$service = $this->getRaCandidateService();

$command = new SearchRaCandidatesCommand();
$command->actorId = $this->getUser()->id;
$command->actorId = $identity->id;
$command->actorInstitution = $institution;
$command->raInstitution = null;
$command->pageNumber = (int) $request->get('p', 1);
$command->orderBy = $request->get('orderBy');
$command->orderDirection = $request->get('orderDirection');
Expand All @@ -126,6 +126,7 @@ public function raCandidateSearchAction(Request $request)

// The options that will populate the institution filter choice list.
$command->institutionFilterOptions = $raCandidateList->getFilterOption('institution');
$command->raInstitutionFilterOptions = $raCandidateList->getFilterOption('raInstitution');

$form = $this->createForm(SearchRaCandidatesType::class, $command, ['method' => 'get']);
$form->handleRequest($request);
Expand Down Expand Up @@ -167,7 +168,7 @@ public function createRaAction(Request $request)
$logger->notice('Page for Accreditation of Identity to Ra or Raa requested');
$identityId = $request->get('identityId');

$raCandidate = $this->getRaCandidateService()->getRaCandidate($identityId, $this->getUser()->institution, $this->getUser()->id);
$raCandidate = $this->getRaCandidateService()->getRaCandidate($identityId, $this->getUser()->id);

if (!$raCandidate->raCandidate) {
$logger->warning(sprintf('RaCandidate based on identity "%s" not found', $identityId));
Expand Down Expand Up @@ -225,7 +226,7 @@ public function amendRaInformationAction(Request $request, $identityId, $raInsti
$logger = $this->get('logger');
$logger->notice(sprintf("Loading information amendment form for RA(A) '%s'", $identityId));

$raListing = $this->getRaListingService()->get($identityId, $raInstitution, $this->getUser()->institution, $this->getUser()->id);
$raListing = $this->getRaListingService()->get($identityId, $raInstitution, $this->getUser()->id);

if (!$raListing) {
$logger->warning(sprintf("RA listing for identity ID '%s' not found", $identityId));
Expand Down Expand Up @@ -272,7 +273,7 @@ public function retractRegistrationAuthorityAction(Request $request, $identityId

$logger->notice(sprintf("Loading retract registration authority form for RA(A) '%s'", $identityId));

$raListing = $this->getRaListingService()->get($identityId, $raInstitution, $this->getUser()->institution, $this->getUser()->id);
$raListing = $this->getRaListingService()->get($identityId, $raInstitution, $this->getUser()->id);
if (!$raListing) {
$logger->warning(sprintf("RA listing for identity ID '%s@%s' not found", $identityId, $this->getUser()->institution));
throw new NotFoundHttpException(sprintf("RA listing for identity ID '%s' not found", $identityId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
use Surfnet\StepupRa\RaBundle\Command\SearchSecondFactorAuditLogCommand;
use Surfnet\StepupRa\RaBundle\Form\Type\RevokeSecondFactorType;
use Surfnet\StepupRa\RaBundle\Form\Type\SearchRaSecondFactorsType;
use Surfnet\StepupRa\RaBundle\Security\Authorization\Context\InstitutionContext;
use Surfnet\StepupRa\RaBundle\Security\Authorization\Voter\AllowedInOtherInstitutionVoter;
use Surfnet\StepupRa\RaBundle\Service\InstitutionConfigurationOptionsService;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -53,7 +50,6 @@ public function searchAction(Request $request)
$this->get('logger')->notice('Starting search for second factors');

$command = new SearchRaSecondFactorsCommand();
$command->actorInstitution = $identity->institution;
$command->actorId = $identity->id;
$command->pageNumber = (int) $request->get('p', 1);
$command->orderBy = $request->get('orderBy');
Expand Down
72 changes: 0 additions & 72 deletions src/Surfnet/StepupRa/RaBundle/Controller/SraaController.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function startProcedureAction(Request $request)
}

$secondFactor = $this->getSecondFactorService()
->findVerifiedSecondFactorByRegistrationCode($command->registrationCode, $identity->institution, $identity->id);
->findVerifiedSecondFactorByRegistrationCode($command->registrationCode, $identity->id);

if ($secondFactor === null) {
$this->addFlash('error', 'ra.form.start_vetting_procedure.unknown_registration_code');
Expand Down

This file was deleted.

Loading

0 comments on commit 98f8ec9

Please sign in to comment.