Skip to content

Commit

Permalink
[Grid] Fix duplicated system collector name. (#442)
Browse files Browse the repository at this point in the history
* Fix duplicated system collector name.

* Fix duplicated system collector name.
  • Loading branch information
martineiber authored Sep 26, 2024
1 parent 6a1ceb9 commit b41c33a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/Grid/Column/Collector/Asset/SystemFieldCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(

public function getCollectorName(): string
{
return 'system';
return $this->getTypeName(). '.asset';
}

/**
Expand All @@ -56,7 +56,7 @@ public function getColumnConfigurations(array $availableColumnDefinitions): arra

$column = new ColumnConfiguration(
key: $columnKey,
group: $this->getCollectorName(),
group: $this->getTypeName(),
sortable: $availableColumnDefinitions[$type]->isSortable(),
editable: false,
localizable: false,
Expand Down Expand Up @@ -84,7 +84,12 @@ public function supportedElementTypes(): array

private function concatType(string $type): string
{
return $this->getCollectorName() . '.' . $type;
return $this->getTypeName() . '.' . $type;
}

private function getTypeName(): string
{
return 'system';
}

private function getCustomFrontendAdapter(string $columnKey, string $defaultAdapter): string
Expand Down
11 changes: 8 additions & 3 deletions src/Grid/Column/Collector/DataObject/SystemFieldCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(

public function getCollectorName(): string
{
return 'system';
return $this->getTypeName() . '.dataobject';
}

/**
Expand All @@ -55,7 +55,7 @@ public function getColumnConfigurations(array $availableColumnDefinitions): arra

$column = new ColumnConfiguration(
key: $columnKey,
group: $this->getCollectorName(),
group: $this->getTypeName(),
sortable: $availableColumnDefinitions[$type]->isSortable(),
editable: false,
localizable: false,
Expand All @@ -80,6 +80,11 @@ public function supportedElementTypes(): array

private function concatType(string $type): string
{
return $this->getCollectorName() . '.' . $type;
return $this->getTypeName() . '.' . $type;
}

private function getTypeName(): string
{
return 'system';
}
}

0 comments on commit b41c33a

Please sign in to comment.