diff --git a/packages/bruno-app/src/components/Sidebar/NewFolder/index.js b/packages/bruno-app/src/components/Sidebar/NewFolder/index.js index ab1ab7ba..3f1318d1 100644 --- a/packages/bruno-app/src/components/Sidebar/NewFolder/index.js +++ b/packages/bruno-app/src/components/Sidebar/NewFolder/index.js @@ -15,7 +15,19 @@ const NewFolder = ({ collection, item, onClose }) => { folderName: '' }, validationSchema: Yup.object({ - folderName: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('name is required') + folderName: Yup.string() + .min(1, 'must be atleast 1 characters') + .required('name is required') + .test({ + name: 'folderName', + message: 'The folder name "environments" at the root of the collection is reserved in bruno', + test:(value) => { + if(item && item.uid) { + return true; + } + return !(value.trim().toLowerCase().includes('environments')) + } + }) }), onSubmit: (values) => { dispatch(newFolder(values.folderName, collection.uid, item ? item.uid : null)) diff --git a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js index 987a5272..d1714764 100644 --- a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js +++ b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js @@ -24,7 +24,14 @@ const NewRequest = ({ collection, item, isEphermal, onClose }) => { requestMethod: 'GET' }, validationSchema: Yup.object({ - requestName: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('name is required') + requestName: Yup.string() + .min(1, 'must be atleast 1 characters') + .required('name is required') + .test({ + name: 'requestName', + message: 'The request name "index" is reserved in bruno', + test: value => !(value.trim().toLowerCase().includes('index')), + }) }), onSubmit: (values) => { if (isEphermal) {