mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 10:18:56 +02:00
Removed now useless visibility options from PartsDataTable
The visibility is now configured by the env variable, so this is useless.
This commit is contained in:
parent
79262972aa
commit
185c88fa3e
1 changed files with 2 additions and 15 deletions
|
@ -117,11 +117,9 @@ final class PartsDataTable implements DataTableTypeInterface
|
||||||
])
|
])
|
||||||
->add('id', TextColumn::class, [
|
->add('id', TextColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.id'),
|
'label' => $this->translator->trans('part.table.id'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('ipn', TextColumn::class, [
|
->add('ipn', TextColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.ipn'),
|
'label' => $this->translator->trans('part.table.ipn'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('description', MarkdownColumn::class, [
|
->add('description', MarkdownColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.description'),
|
'label' => $this->translator->trans('part.table.description'),
|
||||||
|
@ -213,7 +211,6 @@ final class PartsDataTable implements DataTableTypeInterface
|
||||||
])
|
])
|
||||||
->add('minamount', TextColumn::class, [
|
->add('minamount', TextColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.minamount'),
|
'label' => $this->translator->trans('part.table.minamount'),
|
||||||
'visible' => false,
|
|
||||||
'render' => fn($value, Part $context): string => htmlspecialchars($this->amountFormatter->format($value,
|
'render' => fn($value, Part $context): string => htmlspecialchars($this->amountFormatter->format($value,
|
||||||
$context->getPartUnit())),
|
$context->getPartUnit())),
|
||||||
]);
|
]);
|
||||||
|
@ -222,29 +219,23 @@ final class PartsDataTable implements DataTableTypeInterface
|
||||||
$this->csh->add('partUnit', TextColumn::class, [
|
$this->csh->add('partUnit', TextColumn::class, [
|
||||||
'field' => 'partUnit.name',
|
'field' => 'partUnit.name',
|
||||||
'label' => $this->translator->trans('part.table.partUnit'),
|
'label' => $this->translator->trans('part.table.partUnit'),
|
||||||
'visible' => false,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->csh->add('addedDate', LocaleDateTimeColumn::class, [
|
$this->csh->add('addedDate', LocaleDateTimeColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.addedDate'),
|
'label' => $this->translator->trans('part.table.addedDate'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('lastModified', LocaleDateTimeColumn::class, [
|
->add('lastModified', LocaleDateTimeColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.lastModified'),
|
'label' => $this->translator->trans('part.table.lastModified'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('needs_review', PrettyBoolColumn::class, [
|
->add('needs_review', PrettyBoolColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.needsReview'),
|
'label' => $this->translator->trans('part.table.needsReview'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('favorite', PrettyBoolColumn::class, [
|
->add('favorite', PrettyBoolColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.favorite'),
|
'label' => $this->translator->trans('part.table.favorite'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('manufacturing_status', EnumColumn::class, [
|
->add('manufacturing_status', EnumColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.manufacturingStatus'),
|
'label' => $this->translator->trans('part.table.manufacturingStatus'),
|
||||||
'visible' => false,
|
|
||||||
'class' => ManufacturingStatus::class,
|
'class' => ManufacturingStatus::class,
|
||||||
'render' => function (?ManufacturingStatus $status, Part $context): string {
|
'render' => function (?ManufacturingStatus $status, Part $context): string {
|
||||||
if (!$status) {
|
if (!$status) {
|
||||||
|
@ -256,31 +247,27 @@ final class PartsDataTable implements DataTableTypeInterface
|
||||||
])
|
])
|
||||||
->add('manufacturer_product_number', TextColumn::class, [
|
->add('manufacturer_product_number', TextColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.mpn'),
|
'label' => $this->translator->trans('part.table.mpn'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('mass', SIUnitNumberColumn::class, [
|
->add('mass', SIUnitNumberColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.mass'),
|
'label' => $this->translator->trans('part.table.mass'),
|
||||||
'visible' => false,
|
|
||||||
'unit' => 'g'
|
'unit' => 'g'
|
||||||
])
|
])
|
||||||
->add('tags', TagsColumn::class, [
|
->add('tags', TagsColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.tags'),
|
'label' => $this->translator->trans('part.table.tags'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('attachments', PartAttachmentsColumn::class, [
|
->add('attachments', PartAttachmentsColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.attachments'),
|
'label' => $this->translator->trans('part.table.attachments'),
|
||||||
'visible' => false,
|
|
||||||
])
|
])
|
||||||
->add('edit', IconLinkColumn::class, [
|
->add('edit', IconLinkColumn::class, [
|
||||||
'label' => $this->translator->trans('part.table.edit'),
|
'label' => $this->translator->trans('part.table.edit'),
|
||||||
'visible' => false,
|
|
||||||
'href' => fn($value, Part $context) => $this->urlGenerator->editURL($context),
|
'href' => fn($value, Part $context) => $this->urlGenerator->editURL($context),
|
||||||
'disabled' => fn($value, Part $context) => !$this->security->isGranted('edit', $context),
|
'disabled' => fn($value, Part $context) => !$this->security->isGranted('edit', $context),
|
||||||
'title' => $this->translator->trans('part.table.edit.title'),
|
'title' => $this->translator->trans('part.table.edit.title'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//Apply the user configured order and visibility and add the columns to the table
|
//Apply the user configured order and visibility and add the columns to the table
|
||||||
$this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->visible_columns, "TABLE_PARTS_DEFAULT_COLUMNS");
|
$this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->visible_columns,
|
||||||
|
"TABLE_PARTS_DEFAULT_COLUMNS");
|
||||||
|
|
||||||
$dataTable->addOrderBy('name')
|
$dataTable->addOrderBy('name')
|
||||||
->createAdapter(TwoStepORMAdapater::class, [
|
->createAdapter(TwoStepORMAdapater::class, [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue