Files
cachet-docker/resources/views/dashboard/components/groups/edit.blade.php
Marius Palade ad0954eb20 Add visibility to component groups (#2027)
Implement visibility for the components groups. Closes #1892

Add functional test that asserts a guest can only see public items.

* Fix tests not running due to hitting the Setup page.

The missing `boostrap/cachet/testing.php` file is now generated the first time tests are ran.

* Add a functional test that asserts logged in users can see all items.

Add constants for possible values for the visible column/field of the ComponentGroup model.
Code review changes.

* Add API tests for component group visibility feature.

* Implement the visibility hidden option for a component group. Fixes #1892.

Add migration for the created_by column, in component_groups table.
Add methods to the ComponentGroup and User models to be able to work with the created_by column.
Hidden component groups are no longer displayed on the index page for loggedin users.
Add functional test for the dashboard page.
Save owner on create/edit component group.
Update the API tests for Component group visibility feature.

* Replace auth() usage with app(Guard::class).

* Apply StyleCI fixes.

* Drop the hidden visibility feature and fix all tests.

Some code review fixes too.

* Rename public to visible since it's a reserved keyword. Apply StyleCI fixes and correct typo.

* Code review changes.

* Tidy up component and component groups gathering.

* Code review changes and StyleCI fixes.

* Code review changes.

* Remove extra whitespace

* Remove useless method.
2016-10-02 13:57:32 +01:00

50 lines
2.7 KiB
PHP

@extends('layout.dashboard')
@section('content')
<div class="header">
<div class="sidebar-toggler visible-xs">
<i class="ion ion-navicon"></i>
</div>
<span class="uppercase">
<i class="ion ion-ios-keypad"></i> {{ trans_choice('dashboard.components.groups.groups', 2) }}
</span>
&gt; <small>{{ trans('dashboard.components.groups.edit.title') }}</small>
</div>
<div class="content-wrapper">
<div class="row">
<div class="col-sm-12">
@include('dashboard.partials.errors')
<form name="EditComponentGroupForm" class="form-vertical" role="form" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset>
<div class="form-group">
<label>{{ trans('forms.components.groups.name') }}</label>
<input type="text" class="form-control" name="name" id="group-name" value="{{ $group->name }}" required>
</div>
<div class="form-group">
<label>{{ trans('forms.components.groups.collapsing') }}</label>
<select name="collapsed" class="form-control" required>
<option value="0" {{ $group->collapsed === 0 ? "selected" : null }}>{{ trans('forms.components.groups.visible') }}</option>
<option value="1" {{ $group->collapsed === 1 ? "selected" : null }}>{{ trans('forms.components.groups.collapsed') }}</option>
<option value="2" {{ $group->collapsed === 2 ? "selected" : null }}>{{ trans('forms.components.groups.collapsed_incident') }}</option>
</select>
</div>
<div class="form-group">
<label>{{ trans('forms.components.groups.visibility') }}</label>
<select name="visible" class="form-control" required>
<option value="0" {{ $group->visible === 0 ? "selected" : null }}>{{ trans('forms.components.groups.visibility_authenticated') }}</option>
<option value="1" {{ $group->visible === 1 ? "selected" : null }}>{{ trans('forms.components.groups.visibility_public') }}</option>
</select>
</div>
</fieldset>
<div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.components.groups') }}">{{ trans('forms.cancel') }}</a>
</div>
</form>
</div>
</div>
</div>
@stop