mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
fix(helper-plugin): BigInt mistake
This commit is contained in:
parent
98fdd17fcd
commit
688baffb9c
@ -56,7 +56,7 @@ const GenericInput = ({
|
||||
description,
|
||||
minimum,
|
||||
maximum,
|
||||
units: getFieldUnits({ type, name, minimum, maximum }),
|
||||
units: getFieldUnits({ type, minimum, maximum }),
|
||||
});
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
/**
|
||||
* @param {String} type
|
||||
* @param {String} name
|
||||
* @param {Number} minimum
|
||||
* @param {Number} maximum
|
||||
* @returns {'' | 'characters' | 'character'}
|
||||
*/
|
||||
const getFieldUnits = ({ type, name, minimum, maximum }) => {
|
||||
if (type === 'number' || name === 'BIGINT') {
|
||||
const getFieldUnits = ({ type, minimum, maximum }) => {
|
||||
if (type === 'number') {
|
||||
return '';
|
||||
}
|
||||
const plural = Math.max(minimum || 0, maximum || 0) > 1;
|
||||
|
@ -6,10 +6,6 @@ describe('Content Manager | Inputs | Utils', () => {
|
||||
expect(getFieldUnits({ type: 'number' })).toEqual('');
|
||||
});
|
||||
|
||||
it('returns <empty string> for BIGINT types', () => {
|
||||
expect(getFieldUnits({ name: 'BIGINT' })).toEqual('');
|
||||
});
|
||||
|
||||
it('returns "character" when neither minimum or maximum is greater than 1', () => {
|
||||
expect(getFieldUnits({ type: 'text', minimum: 1, maximum: 1 })).toEqual('character');
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user