< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_Studio2_Views_Products_Index
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/Products/Index.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 70
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 14
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%156120%
<ExecuteAsync()0%620%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/Products/Index.cshtml

#LineLine coverage
 1@using OzonOrdersWeb.Areas.Studio2.ViewModels.Grid
 2@{
 03    var total = (int)(ViewBag.TotalCount ?? 0);
 04    ViewData["Title"] = $"Товары ({total} шт.)";
 05    Layout = "~/Views/Shared/_Layout.cshtml";
 6}
 7
 08@await Html.PartialAsync("_BsxGridShell")
 9
 10<div class="container-fluid py-3 bsx-surface">
 11    <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap
 12        <div>
 13            <h1><i class="fas fa-box me-2 text-primary"></i>Товары и цены</h1>
 14            <div class="subtitle">Карточки товаров Ozon: SKU FBO/FBS, категория, объём, вес и текущая цена</div>
 15            <div class="app-section-hero__quick-links">
 16                <a asp-area="Studio2" asp-controller="PriceHistory" asp-action="Index"><i class="fas fa-chart-line"></i>
 17                <a asp-area="Studio2" asp-controller="Manufacturers" asp-action="Index"><i class="fas fa-tag"></i>Произв
 18            </div>
 19        </div>
 20        <div class="d-flex flex-wrap gap-2 align-items-center">
 021            <div class="bsx-dir-stats"><span class="bsx-dir-stat">Всего <b>@total.ToString("N0")</b></span></div>
 22            <a asp-action="Create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>Добавить</a>
 23        </div>
 24    </div>
 25
 026    @await Html.PartialAsync("_BsxDirectoryGrid", new BsxDirectoryGridViewModel("product", "Товары", "fa-box", "Поиск по
 027        "Фильтры и сортировка — по всем товарам на сервере. Двойной клик — карточка товара."))
 28</div>
 29
 30@section Scripts {
 31<script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script>
 32<script>
 33    (function () {
 34        const D = window.BsxDirectory;
 035        const url = (action, id) => '@Url.Action("Index", "Products", new { area = "Studio2" })/' + action + '/' + id;
 36        const txt = { filter: 'agTextColumnFilter' };
 37        const num = { filter: 'agNumberColumnFilter', type: 'rightAligned' };
 38        const text = p => p.value || '—';
 39        const dec = digits => p => p.value == null ? '—' : Number(p.value).toLocaleString('ru-RU', { maximumFractionDigi
 40
 41        D.serverGrid({
 42            key: 'dirProduct',
 43            prefix: 'product',
 44            url: '/Studio2/Products/grid',
 45            facetsUrl: '/Studio2/Products/grid/facets',
 46            rowUrl: r => url('Details', r.id),
 47            columnDefs: [
 48                Object.assign({ field: 'article', headerName: 'Артикул', width: 200, pinned: 'left', cellClass: 'fw-semi
 49                Object.assign({ field: 'ozonProductId', headerName: 'Ozon Product ID', width: 150, valueFormatter: text 
 50                Object.assign({ field: 'fboOzonSkuId', headerName: 'SKU FBO', width: 140, valueFormatter: text }, txt),
 51                Object.assign({ field: 'fbsOzonSkuId', headerName: 'SKU FBS', width: 140, valueFormatter: text }, txt),
 52                D.setCol({ field: 'commercialCategory', headerName: 'Коммерческая категория', flex: 1, minWidth: 220,
 53                  filterParams: { facets: true, labels: { '': '(не задана)' } }, valueFormatter: text }),
 54                Object.assign({ field: 'barcode', headerName: 'Штрихкод', width: 150, hide: true, valueFormatter: text }
 55                Object.assign({ field: 'volume', headerName: 'Объём, л', width: 110, valueFormatter: dec(3) }, num),
 56                Object.assign({ field: 'volumetricWeight', headerName: 'Объёмный вес, кг', width: 140, valueFormatter: d
 57                Object.assign({ field: 'weight', headerName: 'Вес, кг', width: 110, hide: true, valueFormatter: dec(3) }
 58                Object.assign({ field: 'currentPriceWithDiscount', headerName: 'Цена со скидкой, ₽', width: 150, valueFo
 59                Object.assign({ field: 'replacementArticle', headerName: 'Замена', headerTooltip: 'Артикул товара-замены
 60                Object.assign({ field: 'id', headerName: 'ID', width: 100, hide: true }, num),
 61                D.actionsCol(r => [
 62                    { icon: 'fa-pencil-alt', title: 'Изменить', href: url('Edit', r.id) },
 63                    { icon: 'fa-eye', title: 'Карточка', kind: 'view', href: url('Details', r.id) },
 64                    { icon: 'fa-trash', title: 'Удалить', kind: 'danger', href: url('Delete', r.id) }
 65                ], { width: 130 })
 66            ]
 67        });
 68    })();
 69</script>
 70}

Methods/Properties

ExecuteAsync()
<ExecuteAsync()