Skip to content

Commit

Permalink
fix(utils): added support for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
andreszorro committed Jul 24, 2024
1 parent 7013697 commit 1ea6990
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/generators/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const generator: GeneratorDefinition<ComponentAnswers> = {
const containers = getAllWorkspaceElements(workspaceInfo, {
includeContainers: true,
includeComponents: true,
}).filter((elm) => elm.tags.includes("Container"));
}).filter((elm) => elm.tags?.includes("Container"));

if (!containers.length) {
console.log(
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/questions/relationships.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,17 @@ export async function addRelationshipsToElement(
});

const softwareSystems = elements.filter((elm) =>
elm.tags.includes("System"),
elm.tags?.includes("System"),
);
const people = elements.filter((elm) => elm.tags.includes("Person"));
const people = elements.filter((elm) => elm.tags?.includes("Person"));
const containers = elements.filter(
(elm) =>
elm.tags.includes("Container") &&
elm.tags?.includes("Container") &&
elm.systemName === includeContainers,
);
const components = elements.filter(
(elm) =>
elm.tags.includes("Component") &&
elm.tags?.includes("Component") &&
elm.containerName === includeComponents,
);

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/questions/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function getAllWorkspaceElements(
.flat()
.filter((elm) =>
!includeDeploymentNodes
? !elm.tags.split(",").includes("Deployment Node")
? !elm.tags?.split(",").includes("Deployment Node")
: true,
)
.flatMap((elm) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/questions/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const validateDuplicatedComponentName =
includeContainers: true,
includeComponents: true,
})
.filter((elm) => elm.tags.includes("Component"))
.filter((elm) => elm.tags?.includes("Component"))
.map(
(elm) =>
`${pascalCase(removeSpaces(elm.containerName))}_${pascalCase(removeSpaces(elm.name))}`,
Expand Down

0 comments on commit 1ea6990

Please sign in to comment.