Skip to content

Commit

Permalink
fix federation edit.blade.php now operators cant edit xml_id
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 25, 2024
1 parent 360b59f commit 86d9d90
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
64 changes: 35 additions & 29 deletions resources/views/federations/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,48 @@

</x-forms.section.form-body-section>

<x-forms.section.form-body-section
name="federations.xml_id"
label="xml_id"
>
<x-forms.element.input err="xml_id">
type="text" name="xml_id" id="xml_id" maxlength="32"
placeholder="{{ __('federations.name_placeholder') }}"
value="{{ $federation->xml_id }}" required
</x-forms.element.input>

</x-forms.section.form-body-section>
@can('do-everything')
<x-forms.section.form-body-section
name="federations.xml_id"
label="xml_id"
>
<x-forms.element.input err="xml_id">
type="text" name="xml_id" id="xml_id" maxlength="32"
placeholder="{{ __('federations.name_placeholder') }}"
value="{{ $federation->xml_id }}" required
</x-forms.element.input>

<x-forms.section.form-body-section
name="federations.xml_name"
label="xml_name"
>
<x-forms.element.input err="xml_name">
type="text" name="xml_name" id="xml_name" maxlength="255"
placeholder="{{ __('federations.description_placeholder') }}"
value="{{ $federation->xml_name }}" required
</x-forms.element.input>
</x-forms.section.form-body-section>

</x-forms.section.form-body-section>
<x-forms.section.form-body-section
name="federations.xml_name"
label="xml_name"
>
<x-forms.element.input err="xml_name">
type="text" name="xml_name" id="xml_name" maxlength="255"
placeholder="{{ __('federations.description_placeholder') }}"
value="{{ $federation->xml_name }}" required
</x-forms.element.input>

<x-forms.section.form-body-section
name="common.add_sp_idp"
label="add_sp_and_idp_section"
>
<label for="use_sp">
</x-forms.section.form-body-section>

<x-forms.section.form-body-section
name="common.add_sp_idp"
label="add_sp_and_idp_section"
>
<label for="use_sp">

<input type="checkbox" name="sp_and_ip_feed" id="sp_and_ip_feed" value="1" {{ $federation->additional_filters == 1 ? 'checked' : '' }}>
<span class="{{ $federation->additional_filters == 1 ? 'checked-label' : 'unchecked-label' }}">
<input type="checkbox" name="sp_and_ip_feed" id="sp_and_ip_feed" value="1" {{ $federation->additional_filters == 1 ? 'checked' : '' }}>
<span class="{{ $federation->additional_filters == 1 ? 'checked-label' : 'unchecked-label' }}">
{{ __('federations.add_sp_and_idp') }}
</span>

</label>
</x-forms.section.form-body-section>
</label>
</x-forms.section.form-body-section>

@endcan



@endsection
4 changes: 1 addition & 3 deletions tests/Feature/Http/Controllers/FederationControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@ public function a_user_with_operator_permission_can_see_federations_edit_page()
->get(route('federations.edit', $federation))
->assertSeeText(__('federations.edit', ['name' => $federation->name]))
->assertSee($federation->name)
->assertSee($federation->description)
->assertSee($federation->xml_id)
->assertSee($federation->xml_name);
->assertSee($federation->description);

$this->assertEquals(1, Federation::count());
$this->assertEquals(route('federations.edit', $federation), url()->current());
Expand Down

0 comments on commit 86d9d90

Please sign in to comment.