< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_Admin_Views_Roles_Index
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Admin/Views/Roles/Index.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 61
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ExecuteAsync()0%7280%
<ExecuteAsync()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Admin/Views/Roles/Index.cshtml

#LineLine coverage
 1@model IEnumerable<RoleListItemVm>
 2@{
 03    var json = new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web);
 4}
 5
 6<section class="admin-hero">
 7    <h1>Роли</h1>
 8    <p class="subtitle">Ролевой доступ к страницам, полям и наборам данных.</p>
 9    <p class="subtitle-help">Используйте карточку роли для настройки матриц прав и ограничений.</p>
 10</section>
 11
 12<nav class="admin-quick-links">
 13    <a asp-area="Admin" asp-controller="Users" asp-action="Index"><i class="bi bi-people"></i>Пользователи</a>
 14    <a asp-area="Admin" asp-controller="Pages" asp-action="Index"><i class="bi bi-window-stack"></i>Страницы</a>
 15    <a asp-area="Admin" asp-controller="Fields" asp-action="Index"><i class="bi bi-input-cursor-text"></i>Поля</a>
 16</nav>
 17
 18<section class="admin-intro">
 19    <i class="bi bi-info-circle"></i>
 20    <div>Системные роли нельзя удалять. Для каждой роли доступна отдельная матрица прав. Двойной клик по строке — карточ
 21</section>
 22
 23<div class="admin-toolbar admin-surface">
 024    <div class="bsx-dir-stats"><span class="bsx-dir-stat">Всего ролей <b>@Model.Count()</b></span></div>
 25    <a asp-action="Create" class="btn btn-primary btn-sm"><i class="bi bi-plus-lg"></i> Новая роль</a>
 26</div>
 27
 028@await Html.PartialAsync("~/Areas/Studio2/Views/Shared/_BsxDirectoryGrid.cshtml", new BsxDirectoryGridViewModel("admRole
 029<script type="application/json" id="admRolesData">@Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model, json))</scr
 30
 31@section Scripts {
 32    <script>
 33        (function () {
 34            const A = window.AdminGrid, D = window.BsxDirectory;
 035            const url = (action, id) => '@Url.Action("Index")'.replace(/\/Index$/, '') + '/' + action + '/' + id;
 36            A.grid({
 37                key: 'admRoles', prefix: 'admRoles', rows: A.data('admRolesData'),
 38                rowUrl: r => url('Edit', r.id),
 39                columnDefs: [
 40                    A.code({ colId: 'name', field: 'name', headerName: 'Имя' }),
 41                    { colId: 'displayName', field: 'displayName', headerName: 'Отображаемое имя', minWidth: 180, flex: 1
 42                    { colId: 'description', field: 'description', headerName: 'Описание', minWidth: 220, flex: 2, toolti
 43                    A.check({ colId: 'isSystem', field: 'isSystem', headerName: 'Системная' }),
 44                    A.check({ colId: 'isActive', field: 'isActive', headerName: 'Активна' }),
 45                    D.numCol({ colId: 'userCount', field: 'userCount', headerName: 'Пользователей', width: 140 }),
 46                    D.numCol({ colId: 'pagePermissionCount', field: 'pagePermissionCount', headerName: 'Прав на страницы
 47                    D.actionsCol(r => [
 48                        { icon: 'fa-pen', title: 'Изменить роль', kind: 'edit', href: url('Edit', r.id) },
 49                        { icon: 'fa-window-restore', title: 'Матрица страниц', label: 'Страницы', kind: 'view', href: ur
 50                        { icon: 'fa-table-columns', title: 'Матрица полей', label: 'Поля', kind: 'view', href: url('Fiel
 51                        { icon: 'fa-filter', title: 'Наборы данных роли', label: 'Данные', kind: 'view', href: url('Data
 52                        r.isSystem ? null : {
 53                            icon: 'fa-trash', title: 'Удалить роль', kind: 'danger',
 54                            onClick: row => A.confirmPost(url('Delete', row.id), {}, { title: 'Удалить роль', message: '
 55                        }
 56                    ], { width: 330 })
 57                ]
 58            });
 59        })();
 60    </script>
 61}

Methods/Properties

ExecuteAsync()
<ExecuteAsync()