Skip to content

Commit

Permalink
associate environment to a color
Browse files Browse the repository at this point in the history
Signed-off-by: mathieu <mathieu.dreano@gmail.com>

# Conflicts:
#	packages/bruno-app/src/components/Environments/EnvironmentSelector/index.js
#	packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js
#	packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
#	packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js
  • Loading branch information
MathieuDreano committed Jul 24, 2024
1 parent 3f290e4 commit 77c6714
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 21 deletions.
74 changes: 55 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const EnvironmentList = ({ collection, isModified, setIsModified }) => {
useEffect(() => {
if (selectedEnvironment) {
setOriginalEnvironmentVariables(selectedEnvironment.variables);
setSelectedEnvironment(findEnvironmentInCollection(collection, selectedEnvironment.uid));
return;
}

Expand All @@ -37,6 +36,12 @@ const EnvironmentList = ({ collection, isModified, setIsModified }) => {
}
}, [collection, selectedEnvironment]);

useEffect(() => {
if (selectedEnvironment) {
setSelectedEnvironment(findEnvironmentInCollection(collection, selectedEnvironment.uid));
}
}, [environments]);

useEffect(() => {
// check env add
if (prevEnvUids?.length && envUids.length > prevEnvUids.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ const DefaultTab = ({ setTab }) => {
};

const EnvironmentSettings = ({ collection, onClose }) => {
const { environments } = collection;
const [isModified, setIsModified] = useState(false);
const [tab, setTab] = useState('default');
const [openCreateModal, setOpenCreateModal] = useState(false);
const [openImportModal, setOpenImportModal] = useState(false);
if (!collection.environments?.length) {
if (!environments?.length) {
return (
<StyledWrapper>
<Modal size="md" title="Environments" handleCancel={onClose} hideCancel={true} hideFooter={true}>
Expand Down

0 comments on commit 77c6714

Please sign in to comment.