- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This not being done yet is continuing to cause communication confusion โ see #3541034-3: Render component instance form for template โ .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
@neerajsingh โ do you think you could address this feedback? ๐๐ I'd love to merge this MR!
Automatically closed - issue fixed for 2 weeks with no activity.
Automatically closed - issue fixed for 2 weeks with no activity.
Automatically closed - issue fixed for 2 weeks with no activity.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This is going to block ๐ฑ [META] Content templates Active , and ๐ Move `PropSourceEndpointTest` into new `XbConfigEntityHttpApiTest::testComponent()` Active made it very apparent ๐
Quoting
\Drupal\Tests\experience_builder\Functional\ApiUiContentTemplateControllersTest::testSuggestionsClientErrors()
:* ["node/article/js.xb_test_code_components_with_link_prop", 400, "Code components are not supported yet."] * ["node/article/js.xb_test_code_components_with_no_props", 400, "Code components are not supported yet."]
So, starting point:
diff --git a/src/Controller/ApiUiContentTemplateControllers.php b/src/Controller/ApiUiContentTemplateControllers.php index 85bcf22f9..3f3909582 100644 --- a/src/Controller/ApiUiContentTemplateControllers.php +++ b/src/Controller/ApiUiContentTemplateControllers.php @@ -112,11 +112,6 @@ final class ApiUiContentTemplateControllers extends ApiControllerBase { throw new BadRequestHttpException('Only components that define their inputs using JSON Schema and use fields to populate their inputs are currently supported.'); } - // @todo Add support for suggestions for code components in https://www.drupal.org/i/3503038 - if (!$source instanceof SingleDirectoryComponent) { - throw new BadRequestHttpException('Code components are not supported yet.'); - } - if ($this->entityTypeManager->getDefinition($content_entity_type_id, FALSE) === NULL) { throw new NotFoundHttpException(sprintf("The `%s` content entity type does not exist.", $content_entity_type_id)); }
-
wim leers โ
committed ccecb33b on 1.x authored by
isholgueras โ
Issue #3510896 by wim leers, isholgueras, acbramley, tedbow, larowlan,...
-
wim leers โ
committed ccecb33b on 1.x authored by
isholgueras โ
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
The very last obstacle is supremely silly:
FILE: tests/src/Functional/ApiUiContentTemplateControllersTest.php ------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------ 20 | ERROR | [x] Doc comment star missing (Drupal.Commenting.DocCommentStar.StarMissing)
โฆ but that all is there and it DOES comply! ๐
Just removing the comment, don't want this to be held up by that โ created supported request upstream: ๐ฌ False `Drupal.Commenting.DocCommentStar.StarMissing` report? Active .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Thanks to @hooroomoo's test of this together with their PoC, I can now land this with confidence ๐ฅณ
Out of scope:
- making these API responses cacheable โ if the need ever arises, we'll do that then
- code component support is out of scope โ we have had ๐ [PP-1] Refactor GeneratedFieldExplicitInputUxComponentSourceBase and FieldForComponentSuggester to need only SDC's ComponentMetadata, not SDC plugin instances Postponed for >6 months now to do exactly that
- fixing a shape matching bug that the test coverage I added unearthed: ๐ Shape matching of an optional SDC image prop fails to find optional field instances Active .
- while updating the OpenAPI spec, I noticed that for all 4xx responses, the generated docs say
{ "errors": [ {} ] }
is an example value. Which makes no sense, because it should be something like
{ "errors": [ "The 'bla bla' permission is required." ] }
But โฆ this is using the
ClientErrorResponse
already in HEAD, which clearly is wrong for many (not all, but many) routes ๐ It's somewhat right for validation errors for data sent in various API request bodies, but it's wrong for (most?) other cases.Created ๐ OpenAPI spec's `ClientErrorResponse` etc are incorrect for most API routes Active for this.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
NW per MR review. Tests failures are legit + eslint.
- ๐ฎ๐ณIndia neerajsingh IN ๐ฎ๐ณ
Renamed the form 'ComponentInputsForm' to 'ComponentInstanceForm'. Marking this issue as NR.
- @neerajsingh opened merge request.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I wonโt have time to finish this MR today โ thereโs still a bunch of loose ends to clean up, but it works.
@hooroomoo, please test, and confirm that this is what you want/need! ๐ ๐
You'll get something like:
- First commit to issue fork.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Perfect, I have everything I need now to finish this up :)