Skip to content

feature: modify step two e-service create (PIN-9117)#1664

Open
antofo wants to merge 8 commits intofeature/PIN-8882_soglie_differenziatefrom
feature/PIN-9117_eservice-creation-step-two
Open

feature: modify step two e-service create (PIN-9117)#1664
antofo wants to merge 8 commits intofeature/PIN-8882_soglie_differenziatefrom
feature/PIN-9117_eservice-creation-step-two

Conversation

@antofo
Copy link
Collaborator

@antofo antofo commented Feb 10, 2026

Jira Issue

PIN-9117

Context/Why

  • Change step two for provider e-service creation
  • Add threshold customization to attribute selection

Services Impacted

  • Provider E-service creation

Key Changes

  • Move to step two Total/Per consumer threshold selection
  • Move to step two attibute selection
  • Add customize threshold drawer for attributes
  • Add test for the all section

Traceability Checklist

  • Branch name contain the Jira key
  • PR title is compliant with the standard (type(scope): descrizione (KEY))
  • Service labels applied
  • Fix Version set in Jira (if required)
  • API and integration tests updated (if required)
  • OpenAPI spec updated (if required)
  • Bruno endpoint definition updated

@antofo antofo changed the title PIN-9117 Eservice creation step two feature: modify step two e-service create (PIN-9117) Feb 11, 2026
<>
<FormProvider {...formMethods}>
<Box component={'form'} noValidate onSubmit={formMethods.handleSubmit(onSubmit)}>
<SectionContainer title={t('step2.thresholdSection.title')} sx={{ mt: 3 }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

could we move section about dailyCalls (i mean 'classic' dailyCalls) on a separated component? I'd like to call it Three thresholdFieldSection

if (!attribute || !attributeKey || attributeGroupIndex === undefined) return

const attributes = formMethods.getValues('attributes')
const groups = attributes[attributeKey as keyof typeof attributes]
Copy link
Contributor

Choose a reason for hiding this comment

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

threshold will be configurable only for attributKey === 'certified'. should put attributeKey = 'certified' ?

const groups = attributes[attributeKey as keyof typeof attributes]
const group = groups[attributeGroupIndex]

groups[attributeGroupIndex] = group.map((att) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
groups[attributeGroupIndex] = group.map((att) => {
groups[attributeGroupIndex] = group.map((att) =>
att.id === attribute.id
? { ...att, dailyCallsPerConsumer: threshold }
: att
)

</Stack>
</SectionContainer>

<SectionContainer
Copy link
Contributor

Choose a reason for hiding this comment

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

could we move this section into a separeted component?

attributeKey: AttributeKey
readOnly: boolean
openCreateAttributeDrawer?: VoidFunction
openCustomizeThresholdDrawer?: (
Copy link
Contributor

Choose a reason for hiding this comment

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

about this: I see 'props drilling' about this. Could we found a solution for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I adopted the same approach used for the "CreateAttributeDrawer", you mean to change its behaviour too?

@antofo antofo marked this pull request as ready for review February 13, 2026 10:46
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
21.4% Coverage on New Code (required ≥ 80%)
3.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

import { useTranslation } from 'react-i18next'

type AttributesSectionProps = {
version?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

here or we use descriptorVersion (in order to be more clear about that) or instead of link version and title (at row 28) should be better pass "title" prop from outside

mockUseJwt()

describe('Provider E-service create page', () => {
it('Should be visible section', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test should be for Step1 (if you want to test it). ProviderEserviceCreatePage is a container our several step

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the checks are referred to the step 1 because in order to be properly rendered the ProviderEServiceCreatePage should contain the elements of the step 1. I am not trying to test single steps, the aim is to test the entire process

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