Expose CpsCronValidationService publicly via an InjectionToken#604
Open
Expose CpsCronValidationService publicly via an InjectionToken#604
Conversation
Coverage report for library
Test suite run success457 tests passing in 22 suites. Report generated by 🧪jest coverage report action from 5849008 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the cron validation logic in cps-ui-kit publicly consumable and overrideable by exposing CpsCronValidationService via a root-provided InjectionToken, and updates the composition app to document the service (including tokens) in the scheduler docs.
Changes:
- Renamed/moved the cron validation service to
CpsCronValidationServiceand exported it fromcps-ui-kit’s public API. - Introduced
CPS_CRON_VALIDATION_SERVICEtoken and updatedCpsSchedulerComponentto inject the token instead of the concrete service. - Extended the docs generation + composition docs viewer to display service “Tokens” alongside service methods.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/cps-ui-kit/src/public-api.ts | Exports the cron validation service (and its token) publicly. |
| projects/cps-ui-kit/src/lib/services/cps-cron-validation/cps-cron-validation.service.ts | Renames service and adds CPS_CRON_VALIDATION_SERVICE injection token. |
| projects/cps-ui-kit/src/lib/services/cps-cron-validation/cps-cron-validation.service.spec.ts | Updates tests for renamed service and adds token behavior coverage. |
| projects/cps-ui-kit/src/lib/components/cps-scheduler/cps-scheduler.component.ts | Switches scheduler to inject the cron validation token. |
| projects/composition/src/app/pages/scheduler-page/scheduler-page.component.ts | Adds service API JSON data for scheduler page docs. |
| projects/composition/src/app/pages/scheduler-page/scheduler-page.component.html | Passes services into the docs viewer. |
| projects/composition/src/app/models/service-api.model.ts | Extends docs model to support service tokens. |
| projects/composition/src/app/components/component-docs-viewer/component-docs-viewer.component.ts | Adds services input and tooltip directive import for service docs rendering. |
| projects/composition/src/app/components/component-docs-viewer/component-docs-viewer.component.html | Renders service methods and tokens tables in the API tab. |
| projects/composition/src/app/api-data/cps-notification.json | Updates generated method description wording. |
| projects/composition/src/app/api-data/cps-dialog.json | Updates generated method description wording. |
| projects/composition/src/app/api-data/cps-cron-validation.json | Updates service name and documents the new injection token. |
| api-generator/api-generator.js | Adds generation support for “Tokens” group + tweaks method description wording. |
Comments suppressed due to low confidence (1)
projects/cps-ui-kit/src/lib/services/cps-cron-validation/cps-cron-validation.service.ts:501
CPS_CRON_VALIDATION_SERVICEis typed asInjectionToken<CpsCronValidationService>, which forces consumers to treat the injected value as the concrete class even though the intent is to allow replacement/disablement. Consider exporting a minimal public interface (e.g. withisValidCron) and typing the token asInjectionToken<ThatInterface>, withCpsCronValidationServiceimplementing it, so overrides are type-safe and don’t imply class inheritance.
Playwright test resultsDetails
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
CronValidationServicetoCpsCronValidationServicecps-ui-kit/src/lib/services/cron-validation.service.tstocps-ui-kit/src/lib/services/cps-cron-validation/cps-cron-validation.service.tsCPS_CRON_VALIDATION_SERVICEinjection token, so it can be reimplemented/disabled by consumer appsCpsSchedulerComponentpublic-api.tsRelease notes: