-
Notifications
You must be signed in to change notification settings - Fork 3
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
UIORGS-336: Creating or changing a vendor code using number generator in Organizations App #536
base: master
Are you sure you want to change the base?
Conversation
Hooked up Number generator to Organizations
Added servint as an optionalOkapiInterface dependency, and protected code against being called when interface is not present
…eat/number_generator
Small tweaks, brought number generator code in line with users PR refs UIORGS-336, UIORGS-337
Update generator code to use the new codes defined in this PR: folio-org/mod-service-interaction#72
Added new permission and blocked access to number generator page based on that permission
Jest Unit Test Statistics 1 files ±0 84 suites ±0 3m 1s ⏱️ -48s For more details on these failures, see this check. Results for commit 5e4e4c2. ± Comparison against base commit fc155d5. ♻️ This comment has been updated with latest results. |
…eat/number_generator
…eat/number_generator
Update to use servint 3
…eat/number_generator
Use new service-interaction
…eat/number_generator
…eat/number_generator
Swapped implementation to full Modal implementation as per the other apps
…eat/number_generator
Changed Button from fullWidth to scale with text
…eat/number_generator
…eat/number_generator
…eat/number_generator
…eat/number_generator
…izations into feat/number_generator
Change back to do what is done on master
…eat/number_generator
Mocked useSettings to rectify failing test
let vendorCodeSetting = 'useTextField'; | ||
|
||
if (stripes.hasInterface('servint')) { | ||
vendorCodeSetting = settings?.find(sett => sett?.configName === CONFIG_NAME)?.parsedSettings?.vendorGeneratorSetting ?? 'useTextField'; |
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.
this and related code should be moved to hook
/> | ||
</Col> | ||
{( | ||
vendorCodeSetting === 'useGenerator' || |
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.
plz don't use magic words, additionally IMO you can return boolean values from hook (see previous comment)
generateButtonLabel={<FormattedMessage id="ui-organizations.numberGenerator.generateVendorCode" />} | ||
generator="organizations_vendorCode" | ||
modalProps={{ | ||
label: <FormattedMessage id="ui-organizations.numberGenerator.vendorCodeGenerator" /> |
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.
fix plinter please
<Col xs={12}> | ||
<NumberGeneratorModalButton | ||
buttonLabel={<FormattedMessage id="ui-organizations.numberGenerator.generateVendorCode" />} | ||
callback={(generated) => change('code', generated)} |
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.
it would be nice to not create functions and objects in return
section
})); | ||
|
||
jest.mock('@folio/service-interaction', () => ({ | ||
NumberGeneratorModalButton: () => <div>NumberGeneratorModalButton</div> |
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.
fix linter please
const NumberGeneratorOptions = (props) => { | ||
const ConnectedConfigManager = stripesConnect(ConfigManager); | ||
|
||
const defaultValues = { |
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.
move it outside of component as it's just constant
@@ -8,4 +8,6 @@ export const PRIVILEGED_CONTACTS_API = 'organizations-storage/privileged-contact | |||
export const SETTINGS_API = 'organizations-storage/settings'; | |||
export const TYPES_API = 'organizations-storage/organization-types'; | |||
|
|||
export const CONFIG_API = 'configurations/entries'; |
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.
configurations is deprecated and shouldn't be used for new functionality
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.
- low level of coverage
- mod-configration shouldn't be used for new functionality
- code should be refactored
Quality Gate failedFailed conditions |
Moved connected component outside of component render, removed default values
Added messageBanner to settings page explaining the number generator options
feat: number generator
Adds the number generator functionality to Vendor code.
Also setting page to enable/disable this function, protected by a permission: ui-organizations.settings.numberGenerator.manage
Reflects the PR here:
folio-org/ui-users#2231
and cannot be merged until
ui-service-interaction
is accepted for a flower releaserefs UXPROD-3891, UIORGS-336, UIORGS-337