diff --git a/CHANGELOG.md b/CHANGELOG.md index bde2078..4b0011a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft Generator +## 2.0.1 - 2024-03-08 +- Generated field types, utilities, and widget types now provide default icons. +- Fixed an error that occurred when generating a utility. ([#34](https://github.com/craftcms/generator/issues/34)) + ## 2.0.0 - 2024-03-06 - Craft Generator now requires Craft 5. - Renamed `craft\generator\Command\EVENT_REGISTER_GENERATOR_TYPES` to `EVENT_REGISTER_GENERATORS`. diff --git a/src/generators/FieldType.php b/src/generators/FieldType.php index e7bd557..a93c58e 100644 --- a/src/generators/FieldType.php +++ b/src/generators/FieldType.php @@ -153,6 +153,7 @@ private function methods(): array return [ 'displayName' => sprintf('return %s;', $this->messagePhp($this->displayName)), + 'icon' => 'return \'i-cursor\';', 'phpType' => "return 'mixed';", 'dbType' => << sprintf('return %s;', $this->messagePhp($this->displayName)), 'id' => "return '$this->utilityId';", - 'iconPath' => 'return null;', + 'icon' => 'return \'wrench\';', 'contentHtml' => << sprintf('return %s;', $this->messagePhp($this->displayName)), 'isSelectable' => 'return true;', - 'icon' => 'return null;', + 'icon' => 'return \'chart-line\';', 'getBodyHtml' => <<