-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of services for all block fixtures #1265
Conversation
2665d45
to
dc5d9ad
Compare
dc5d9ad
to
75dbf72
Compare
ece5320
to
b670776
Compare
55ee7a3
to
b40738e
Compare
b40738e
to
abca001
Compare
demo/api/src/db/fixtures/generators/blocks/dam-image.fixture.ts
Outdated
Show resolved
Hide resolved
demo/api/src/db/fixtures/generators/blocks/dam-image.fixture.ts
Outdated
Show resolved
Hide resolved
demo/api/src/db/fixtures/generators/blocks/page-content.fixture.ts
Outdated
Show resolved
Hide resolved
demo/api/src/db/fixtures/generators/blocks/pixel-image.fixture.ts
Outdated
Show resolved
Hide resolved
Should we use generator, or fixture service? |
@nsams what's your opinion on this? Having a service for each block results in a lot of services, but using DI is definitely better than passing repositories/services around in generator functions |
For the page and link fixtures the name "generator" was to generic, and I agree: So I would call them here fixture service as well. |
04dad1a
to
cc2b12e
Compare
…ts and use apropriate name for services
…xelImageBlockFixtureService
…ending on which type it is (pixelImgae or svgImage
5457800
to
7a1c2c8
Compare
Two thoughts:
|
yes, I'll update it
Every block that exists in the library should also have a fixture generator in the library (+ some configuration options will be required I think, for example the videos for the youtube video block should probably be defined in the project and not in the library) For new blocks in the project, a new fixture file has to be created manually in the project. (Although I would also like this to be automated, perhaps an extension of the api generator?) |
demo/api/src/db/fixtures/generators/blocks/media-block-fixture.service.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
fixtures for all blocks in the page-content.block.ts + typing in page-content.generator.ts to enforce creating a fixture when adding a block to the page-content.block.ts
Screen.Recording.2023-09-15.at.12.21.44.mov