[1.0.0-beta1] IconDefinition methods interface

Created on 12 August 2024, 5 months ago
Updated 18 September 2024, 4 months ago

The method IconDefinition::getContent() promote "content" as a generic, but it is specific to some extractors (only SVG for now).

And add IconDefinition::getPath() (which is a generic one)?

📌 Task
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pdureau
  • Status changed to Postponed 5 months ago
  • 🇫🇷France mogtofu33

    I think we already replaced getPath() with getSource() to be more generic.

    Still 'content' is part of the renderable, so even if for now only svg extractor use it, the fact that we pass the optional content around make it generic enough I think, to discuss.

  • 🇫🇷France pdureau Paris

    I think we already replaced getPath() with getSource() to be more generic.

    Indeed, getSource() instead of getPath() because sources can be URL.

  • Status changed to Active 5 months ago
  • 🇫🇷France pdureau Paris

    IconDefinition:getRenderable() must not hardcode content which is a data specific to SvgExtractor:

    ( 'content' => new FormattableMarkup($this->getContent(), []),)
    

    Do we need to add an attribute in IconExtractor where the extractor can tell which specific data it is collecting:

    #[IconExtractor(
      id: 'svg',
      label: new TranslatableMarkup('SVG'),
      description: new TranslatableMarkup('All files from one or many paths. Works for any file type.'),
      collected_data: [
        'content' => "string"
      ],
      forms: [
        'settings' => IconPackExtractorForm::class,
      ]
    )]

    And then use this information in IconDefinition or elsewhere.

  • Status changed to Postponed 5 months ago
  • Assigned to mogtofu33
  • Status changed to Active 4 months ago
  • Issue was unassigned.
  • Status changed to Closed: duplicate 4 months ago
Production build 0.71.5 2024