diff --git a/packages/bruno-app/src/components/CollectionSettings/Presets/index.js b/packages/bruno-app/src/components/CollectionSettings/Presets/index.js index 30fd44081..ca467b547 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Presets/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Presets/index.js @@ -4,10 +4,12 @@ import StyledWrapper from './StyledWrapper'; import { updateCollectionPresets } from 'providers/ReduxStore/slices/collections'; import { saveCollectionSettings } from 'providers/ReduxStore/slices/collections/actions'; import { get } from 'lodash'; +import DeprecationWarning from 'components/DeprecationWarning'; const PresetsSettings = ({ collection }) => { const dispatch = useDispatch(); const initialPresets = { requestType: 'http', requestUrl: '' }; + const deprecationWarningMessage = 'Presets is deprecated and will be removed in v3.0.0'; // Get presets from draft.brunoConfig if it exists, otherwise from brunoConfig const currentPresets = collection.draft?.brunoConfig @@ -35,7 +37,8 @@ const PresetsSettings = ({ collection }) => { return ( -
+ +
These presets will be used as the default values for new requests in this collection.
diff --git a/packages/bruno-app/src/components/CollectionSettings/Vars/index.js b/packages/bruno-app/src/components/CollectionSettings/Vars/index.js index 02375f19a..7e0142520 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Vars/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Vars/index.js @@ -4,12 +4,15 @@ import VarsTable from './VarsTable'; import StyledWrapper from './StyledWrapper'; import { saveCollectionSettings } from 'providers/ReduxStore/slices/collections/actions'; import { useDispatch } from 'react-redux'; +import DeprecationWarning from 'components/DeprecationWarning'; const Vars = ({ collection }) => { const dispatch = useDispatch(); const requestVars = collection.draft?.root ? get(collection, 'draft.root.request.vars.req', []) : get(collection, 'root.request.vars.req', []); const responseVars = collection.draft?.root ? get(collection, 'draft.root.request.vars.res', []) : get(collection, 'root.request.vars.res', []); const handleSave = () => dispatch(saveCollectionSettings(collection.uid)); + const deprecationWarningMessage = 'Post response vars is deprecated and will be removed in v3.0.0'; + return (
@@ -18,6 +21,7 @@ const Vars = ({ collection }) => {
Post Response
+
diff --git a/packages/bruno-app/src/components/DeprecationWarning/StyledWrapper.js b/packages/bruno-app/src/components/DeprecationWarning/StyledWrapper.js new file mode 100644 index 000000000..71e681879 --- /dev/null +++ b/packages/bruno-app/src/components/DeprecationWarning/StyledWrapper.js @@ -0,0 +1,33 @@ +import styled from 'styled-components'; + +const StyledWrapper = styled.div` + .deprecation-warning { + box-sizing: border-box; + display: flex; + flex-direction: row; + align-items: center; + padding: 8px; + gap: 4px; + margin-bottom: 8px; + background: ${(props) => props.theme.deprecationWarning.bg}; + border: 1px solid ${(props) => props.theme.deprecationWarning.border}; + border-radius: 6px; + + .warning-icon { + color: ${(props) => props.theme.deprecationWarning.icon}; + flex-shrink: 0; + width: 16px; + height: 16px; + } + + .warning-text { + font-family: 'Inter', sans-serif; + font-style: normal; + font-size: 14px; + line-height: 17px; + color: ${(props) => props.theme.deprecationWarning.text}; + } + } +`; + +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/DeprecationWarning/index.js b/packages/bruno-app/src/components/DeprecationWarning/index.js new file mode 100644 index 000000000..387475814 --- /dev/null +++ b/packages/bruno-app/src/components/DeprecationWarning/index.js @@ -0,0 +1,16 @@ +import React from 'react'; +import IconAlertTriangleFilled from '../Icons/IconAlertTriangleFilled'; +import StyledWrapper from './StyledWrapper'; + +const DeprecationWarning = ({ message }) => { + return ( + +
+ + {message} +
+
+ ); +}; + +export default DeprecationWarning; diff --git a/packages/bruno-app/src/components/FolderSettings/Vars/index.js b/packages/bruno-app/src/components/FolderSettings/Vars/index.js index 69f901fab..34c72cd25 100644 --- a/packages/bruno-app/src/components/FolderSettings/Vars/index.js +++ b/packages/bruno-app/src/components/FolderSettings/Vars/index.js @@ -4,12 +4,15 @@ import VarsTable from './VarsTable'; import StyledWrapper from './StyledWrapper'; import { saveFolderRoot } from 'providers/ReduxStore/slices/collections/actions'; import { useDispatch } from 'react-redux'; +import DeprecationWarning from 'components/DeprecationWarning'; const Vars = ({ collection, folder }) => { const dispatch = useDispatch(); const requestVars = folder.draft ? get(folder, 'draft.request.vars.req', []) : get(folder, 'root.request.vars.req', []); const responseVars = folder.draft ? get(folder, 'draft.request.vars.res', []) : get(folder, 'root.request.vars.res', []); const handleSave = () => dispatch(saveFolderRoot(collection.uid, folder.uid)); + const deprecationWarningMessage = 'Post response vars is deprecated and will be removed in v3.0.0'; + return (
@@ -18,6 +21,7 @@ const Vars = ({ collection, folder }) => {
Post Response
+
diff --git a/packages/bruno-app/src/components/Icons/IconAlertTriangleFilled/index.js b/packages/bruno-app/src/components/Icons/IconAlertTriangleFilled/index.js new file mode 100644 index 000000000..508a608b1 --- /dev/null +++ b/packages/bruno-app/src/components/Icons/IconAlertTriangleFilled/index.js @@ -0,0 +1,14 @@ +import React from 'react'; + +const IconAlertTriangleFilled = ({ size = 16, ...props }) => { + return ( + + + + ); +}; + +export default IconAlertTriangleFilled; diff --git a/packages/bruno-app/src/components/RequestPane/Vars/index.js b/packages/bruno-app/src/components/RequestPane/Vars/index.js index eb292e9c2..662d328fe 100644 --- a/packages/bruno-app/src/components/RequestPane/Vars/index.js +++ b/packages/bruno-app/src/components/RequestPane/Vars/index.js @@ -2,10 +2,12 @@ import React from 'react'; import get from 'lodash/get'; import VarsTable from './VarsTable'; import StyledWrapper from './StyledWrapper'; +import DeprecationWarning from 'components/DeprecationWarning'; const Vars = ({ item, collection }) => { const requestVars = item.draft ? get(item, 'draft.request.vars.req') : get(item, 'request.vars.req'); const responseVars = item.draft ? get(item, 'draft.request.vars.res') : get(item, 'request.vars.res'); + const deprecationWarningMessage = 'Post response vars is deprecated and will be removed in v3.0.0'; return ( @@ -15,6 +17,7 @@ const Vars = ({ item, collection }) => {
Post Response
+
diff --git a/packages/bruno-app/src/themes/dark.js b/packages/bruno-app/src/themes/dark.js index 4eb4fd721..0461ec8cc 100644 --- a/packages/bruno-app/src/themes/dark.js +++ b/packages/bruno-app/src/themes/dark.js @@ -473,6 +473,13 @@ const darkTheme = { } } }, + deprecationWarning: { + bg: 'rgba(250, 83, 67, 0.1)', + border: 'rgba(250, 83, 67, 0.1)', + icon: '#FA5343', + text: '#B8B8B8' + }, + examples: { buttonBg: '#F59E0B1A', buttonColor: '#F59E0B', diff --git a/packages/bruno-app/src/themes/light.js b/packages/bruno-app/src/themes/light.js index ec1c64f30..fcb1af8da 100644 --- a/packages/bruno-app/src/themes/light.js +++ b/packages/bruno-app/src/themes/light.js @@ -480,6 +480,13 @@ const lightTheme = { } } }, + deprecationWarning: { + bg: 'rgba(217, 31, 17, 0.1)', + border: 'rgba(217, 31, 17, 0.1)', + icon: '#D91F11', + text: '#343434' + }, + examples: { buttonBg: '#D977061A', buttonColor: '#D97706',