Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the way we get case base name #579

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

basseche
Copy link
Contributor

@basseche basseche commented Dec 13, 2024

to work this evolution must take use powsybl-case-server version : //TODO put version

@basseche basseche self-assigned this Dec 13, 2024
Copy link

sonarcloud bot commented Dec 13, 2024

@@ -788,3 +788,11 @@ export function searchElementsInfos(searchTerm: string, currentDirectoryUuid: UU
}
);
}

export const getBaseName = (caseName: string) => {
const caseNameUrl = `${PREFIX_CASE_QUERIES}/v1/cases/caseBaseName?caseName=${caseName}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

encodeURIComponent(caseName)

@@ -788,3 +788,11 @@ export function searchElementsInfos(searchTerm: string, currentDirectoryUuid: UU
}
);
}

export const getBaseName = (caseName: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

add console.info('Get base name for case', caseName);
or something else

setValue(name, caseName?.substring(0, caseName.indexOf('.')), {
shouldDirty: true,
});
if (caseName.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you have to check the caseName trimming maybe
if (caseName.trim().length > 0) {

setValue(name, response, {
shouldDirty: true,
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Add error handling
.catch((error) => { console.error('Error fetching base name:', error); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants