Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Oct 3, 2024
1 parent e66672e commit 587d170
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 1 addition & 3 deletions web/src/views/envConfig/envConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export function EnvConfig(props) {

const validationCallback = (errors) => {
if (errors) {
errors.forEach(e => toast.warn(e.message), { autoClose: 7000, className: 'font-xs font-mono' })
setErrors(errors);
} else {
setErrors(undefined);
Expand All @@ -205,8 +204,7 @@ export function EnvConfig(props) {
const save = () => {
if (errors) {
errors.forEach(e => toast.warn(e.message), {
className: "bg-gray-50 shadow-lg p-2",
autoClose: 7000,
autoClose: 5000,
})
return
}
Expand Down
9 changes: 4 additions & 5 deletions web/src/views/environment/environment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ export default function EnvironmentView(props) {
const saveComponents = () => {
for (const variable of Object.keys(errors)) {
if (errors[variable] !== null) {
toast({
render: <Error header="Error" message={<ul>
{errors[variable].map(error => (<li>{`${error.message}`}</li>))}
</ul>} />,
toast(<Error header="Error" message={<ul>
{errors[variable].map(error => (<li>{`${error.message}`}</li>))}
</ul>} />, {
className: "bg-red-50 shadow-lg p-2",
bodyClassName: "p-2",
progressClassName: "!bg-red-200",
Expand All @@ -114,7 +113,7 @@ export default function EnvironmentView(props) {
gimletClient.saveInfrastructureComponents(environment.name, stackConfig)
.then((data) => {
toast.update(progressToastId.current, {
render: <Success header="Success" message="A Pull Request was created" link={data.link}/>,
render: <Success header="Success" message={<div className='pb-4'>A Pull Request was created</div>} link={data.createdPr.link}/>,
className: "bg-green-50 shadow-lg p-2",
bodyClassName: "p-2",
});
Expand Down
5 changes: 4 additions & 1 deletion web/src/views/environments/environments.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { useState, useEffect } from 'react';
import { useState, useEffect, useRef } from 'react';
import {
ACTION_TYPE_ENVS,
} from "../../redux/redux";
import EnvironmentCard from '../../components/environmentCard/environmentCard';
import { SkeletonLoader } from '../../../src/views/repositories/repositories';
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify';
import { InProgress, Success, Error } from '../../popUpWindow';

export default function Environments(props) {
const { store, gimletClient } = props
const navigate = useNavigate()
const progressToastId = useRef(null);

const reduxState = store.getState();
const [connectedAgents, setConnectedAgents] = useState(reduxState.connectedAgents)
Expand Down

0 comments on commit 587d170

Please sign in to comment.