Skip to content

Commit

Permalink
Merge pull request #8 from silvermine/draw-root-dep
Browse files Browse the repository at this point in the history
fix: draw line to root deps when all explicit deps are root deps
  • Loading branch information
onebytegone authored Jan 30, 2024
2 parents f2d7189 + 57d1598 commit 69ce9aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion service-web-core/src/addons/MermaidServiceDeploymentGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default class MermaidServiceDeploymentGraph {
const rootSubGraph: string[] = [];

const addService = (isSkipped: boolean, svc: Service, dependents: readonly Service[]): void => {
if (isEmpty(svc.config.dependsOn) && !svc.config.isRootDependency) {
const onlyDependsOnRootDeps = isEmpty(svc.config.dependsOn) || svc.config.dependsOn?.every((dep) => {
return this._web.getServiceByName(dep)?.config.isRootDependency;
});

if (onlyDependsOnRootDeps && !svc.config.isRootDependency) {
this._addLine(`${this._getLabel(svc)}${isSkipped ? ':::skipped' : ''} --> rootDeps`);
}

Expand Down

0 comments on commit 69ce9aa

Please sign in to comment.