-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add mutualized api functions #455
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part2
Have you look to a more update version of utilities function for rest base from gridadmin ?
src/services/apps-metadata.ts
Outdated
|
||
export type Url = string | URL; | ||
|
||
export function fetchEnv() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is, it can't resolve ../../public/env.json
during compilation in commons-ui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was to not have to manage manually the type definition manually.
You just remove the link to the file in the definition and it's good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part3
src/services/explore.ts
Outdated
const idsParams = getRequestParamFromList( | ||
ids.filter((id) => id), // filter falsy elements | ||
'ids' | ||
); | ||
|
||
const equipmentTypesParams = getRequestParamFromList( | ||
equipmentTypes, | ||
'equipmentTypes' | ||
); | ||
|
||
const elementTypesParams = getRequestParamFromList( | ||
elementTypes, | ||
'elementTypes' | ||
); | ||
|
||
const urlSearchParams = new URLSearchParams([ | ||
...idsParams, | ||
...equipmentTypesParams, | ||
...elementTypesParams, | ||
]).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem here because getRequestParamFromList()
return an URLSearchParams
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://stackoverflow.com/questions/45126076/how-can-i-combine-two-urlsearchparams
It seems to be possible to combine them this way : new URLSearchParams({ ...Object.fromEntries(params1), ...Object.fromEntries(params2) });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, it broke the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer instantiating only one URLSearchParams or a better system to merge multiple URLSearchParams into one ?
.catch((error) => { | ||
console.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only a console log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so ? Since it's in a catch bock I'd reckon a warn is warranted
EDIT : Ah I misunderstood, yea this far the error is only logged and not displayed in a snackbar
src/utils/ElementAttributes.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only to define a type, maybe not in src/utils/
but in src/types/
for example.
Also is it meant to be use multiple time or only once (actual case)? If the later I would move it where it's used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code: ok
tests: to be continued
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now assigned to me
* `VITE_*` variables are kept in finale build * URLs used by fetchers are based on app base to be permissive to a base not at root
Found a way to resolve import namespace not extendable while keeping ftechers grouped by service/server, and also managing user token_id problem.
15fd221
to
571416f
Compare
5c232c8
to
b4015aa
Compare
b4015aa
to
3d0d71f
Compare
All changes requested were resolved
Removes the FilterContext, replaced by the following functions for API calls related to fetching directory data :
The following method used to retrieve the application metadata :
Also:
Also adds common functions needed for data fetching mechanisms