Skip to content

Conversation

dcaccamo3ainformatica
Copy link
Collaborator

@dcaccamo3ainformatica dcaccamo3ainformatica commented Sep 28, 2025

Resolves IOPAE-2071

Copy link

changeset-bot bot commented Sep 28, 2025

🦋 Changeset detected

Latest commit: 94e83a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
io-services-cms-backoffice Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for App Backend (./apps/app-backend)

Status Category Percentage Covered / Total
🔵 Lines 81.74% 694 / 849
🔵 Statements 81.74% 694 / 849
🔵 Functions 75% 33 / 44
🔵 Branches 94.11% 128 / 136
File CoverageNo changed files found.
Generated in workflow #3741

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for Backoffice Frontend (./apps/backoffice)

Status Category Percentage Covered / Total
🔵 Lines 14.76% 1663 / 11262
🔵 Statements 14.76% 1663 / 11262
🔵 Functions 27.75% 83 / 299
🔵 Branches 64.45% 185 / 287
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
apps/backoffice/src/components/buttons/button-add-remove.tsx 0% 0% 0% 0% 1-2, 13-26, 28-29, 31-35, 37-38, 40, 43
apps/backoffice/src/components/cta-manager/constants.ts 48% 100% 0% 48% 19-31
apps/backoffice/src/components/cta-manager/service-cta-manager.tsx 0% 0% 0% 0% 1-3, 8-10, 12, 14-15, 17-19, 21-23, 25, 27-28, 30-40, 42, 44-52, 55-61, 63-69, 71-84, 86-87, 89, 91-101, 103-104, 106-111, 113-121, 123, 125
apps/backoffice/src/components/forms/controllers/url-field-controller.tsx 12.06% 100% 0% 12.06% 15-21, 23-33, 35-61, 63-65, 67, 69, 71
apps/backoffice/src/components/services/adapters.ts 11.32% 100% 0% 11.32% 25-39, 42-57, 60-72, 75-86, 94, 96-102, 110-136, 140-151, 154-159, 162-170, 172-182, 184-185, 187, 189-192, 195-202, 205-212, 215-219, 222-224, 227, 230-231, 233-237, 240-242, 244, 246, 248-253, 262-269, 273
apps/backoffice/src/components/services/service-create-update/service-builder-step-3.tsx 0% 100% 100% 0% 2-4, 8, 11-12, 15-18, 20-21, 23, 25-26, 28-34, 36-50, 52, 54-67, 69, 71-77, 79-88, 97-106, 108-110, 112-113, 115-116, 118, 120-125, 127-147, 149-150, 152
apps/backoffice/src/components/services/service-create-update/service-create-update.tsx 0% 0% 0% 0% 1, 6-12, 14, 19-21, 23, 27, 31, 36, 55-64, 66-68, 70-76, 78-105, 107-108, 110-120, 122-142, 144-148, 150-160, 162, 164-176, 178
apps/backoffice/src/components/services/service-create-update/service-extra-configurator.tsx 0% 0% 0% 0% 1-4, 16-18, 20, 25-29, 31-36, 38-53, 55, 63-66, 68-80, 82-85, 88-106, 125-126, 128-129, 131-135, 137-147, 149
Generated in workflow #3741

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for Backoffice Backend (./apps/backoffice)

Status Category Percentage Covered / Total
🔵 Lines 66.92% 3588 / 5361
🔵 Statements 66.92% 3588 / 5361
🔵 Functions 66.52% 153 / 230
🔵 Branches 83.01% 645 / 777
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
apps/backoffice/src/components/cta-manager/constants.ts 48% 100% 0% 48% 19-31
apps/backoffice/src/components/services/adapters.ts 69.33% 45.09% 76.47% 69.33% 25-39, 42-57, 60-72, 75-86, 114, 117, 190, 199, 211, 223-224, 252-253
Generated in workflow #3741

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for Webapp (./apps/io-services-cms-webapp)

Status Category Percentage Covered / Total
🔵 Lines 87.19% 6110 / 7007
🔵 Statements 87.19% 6110 / 7007
🔵 Functions 90.18% 285 / 316
🔵 Branches 91.68% 948 / 1034
File CoverageNo changed files found.
Generated in workflow #3741

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for External Clients (./packages/external-clients)

Status Category Percentage Covered / Total
🔵 Lines 84.38% 643 / 762
🔵 Statements 84.38% 643 / 762
🔵 Functions 79.16% 38 / 48
🔵 Branches 95.14% 98 / 103
File CoverageNo changed files found.
Generated in workflow #3741

Copy link
Contributor

github-actions bot commented Sep 28, 2025

Coverage Report for Models (./packages/io-services-cms-models)

Status Category Percentage Covered / Total
🔵 Lines 81.17% 1337 / 1647
🔵 Statements 81.17% 1337 / 1647
🔵 Functions 66.31% 63 / 95
🔵 Branches 97.25% 177 / 182
File CoverageNo changed files found.
Generated in workflow #3741

@dcaccamo3ainformatica dcaccamo3ainformatica marked this pull request as draft September 29, 2025 14:19
@dcaccamo3ainformatica dcaccamo3ainformatica changed the title Feats/manage multiple cta in service create update Manage multiple cta in service create update Sep 30, 2025
@dcaccamo3ainformatica dcaccamo3ainformatica marked this pull request as ready for review September 30, 2025 14:29
@giuseppedipinto
Copy link
Contributor

Like this #1352, avoid inserting video in PR body, use a dedicated single comment to insert sample video, and provide a PR description if you find it useful.

@dcaccamo3ainformatica
Copy link
Collaborator Author

dcaccamo3ainformatica commented Sep 30, 2025

double_cta_complete.mp4

urlPrefix: "",
} as const;

export const SELECT_ITEMS = (t: TFunction) => [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SELECT_ITEMS, of what? Maybe CTA_KIND_SELECT_ITEMS is more self-explanatory

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { t } = useTranslation();
const { setValue, watch } = useFormContext();

const hasCta2UrlPrefix = watch("metadata.cta.cta_2.urlPrefix");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'has' assumes a boolean but in this case it returns a string value...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const kind = watch(`metadata.cta.${slot}.urlPrefix`);
const showAddRemove = !(isRemoveActionVisible && slot === "cta_1");

const helperCtaInternal =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the need to do a kind check in the const declaration rather than in the component logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/>
) : undefined;

const labelCtaInternal =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as helperCtaInternal

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Grid item md={6} xs={12}>
<UrlFieldController
hideCheckUrl={
kind === CTA_PREFIX_URL_SCHEMES.EXTERNAL ? false : true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

briefly: kind !== CTA_PREFIX_URL_SCHEMES.EXTERNAL

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, this is enough: kind !== CTA_PREFIX_URL_SCHEMES.EXTERNAL (this is yet a boolean response)
There's no need to use the ternary operator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

);
};

const configureSecondaryCta = (isActionAddEnable: boolean) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a little "tricky" to understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { setValue, watch } = useFormContext();

const cta2UrlPrefixValue = watch("metadata.cta.cta_2.urlPrefix");
const isRemoveActionVisible = cta2UrlPrefixValue !== "" ? true : false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here: cta2UrlPrefixValue !== "" it's enought, is yet a boolean result.
There's no need to use the ternary operator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants