Skip to content

Commit

Permalink
Address comments that don't break behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Jul 5, 2024
1 parent 2bfd484 commit 9434771
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions packages/api-server/api_server/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ def convert_alert(alert: RmfAlert):
)

def handle_alert(alert: AlertRequest):
logging.info("Received alert:")
logging.info(alert)
logging.info(f"Received alert: {alert}")
alert_events.alert_requests.on_next(alert)

alert_sub = ros_node().create_subscription(
Expand All @@ -314,8 +313,7 @@ def convert_alert_response(alert_response: RmfAlertResponse):
)

def handle_alert_response(alert_response: AlertResponse):
logging.info("Received alert response:")
logging.info(alert_response)
logging.info(f"Received alert response: {alert_response}")
alert_events.alert_responses.on_next(alert_response)

alert_response_sub = ros_node().create_subscription(
Expand Down
4 changes: 3 additions & 1 deletion packages/api-server/api_server/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
from .rmf_api.task_log_response import TaskLogResponse
from .rmf_api.task_log_update import TaskEventLogUpdate
from .rmf_api.task_request import TaskRequest
from .rmf_api.task_state import Status, Status1, TaskState
from .rmf_api.task_state import Status
from .rmf_api.task_state import Status1 as DispatchStatus
from .rmf_api.task_state import TaskState
from .rmf_api.task_state_update import TaskStateUpdate
from .rmf_api.undo_skip_phase_request import UndoPhaseSkipRequest
from .rmf_api.undo_skip_phase_response import UndoPhaseSkipResponse
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/api_server/routes/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def process_msg(
errorMessage = ""
if (
task_state.dispatch is not None
and task_state.dispatch.status == mdl.Status1.failed_to_assign
and task_state.dispatch.status == mdl.DispatchStatus.failed_to_assign
):
errorMessage += "Failed to assign\n"
if task_state.dispatch.errors is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const AlertDialog = React.memo((props: AlertDialogProps) => {
);
});

export const AlertStore = React.memo(() => {
export const AlertManager = React.memo(() => {
const rmf = React.useContext(RmfAppContext);
const [openAlerts, setOpenAlerts] = React.useState<Record<string, AlertRequest>>({});

Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard/src/components/app-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { rmfDark, rmfDarkLeaflet, rmfLight } from 'react-components';
import { loadSettings, saveSettings, Settings, ThemeMode } from '../settings';
import { AppController, AppControllerContext, SettingsContext } from './app-contexts';
import AppBar from './appbar';
import { AlertStore } from './alert-store';
import { AlertManager } from './alert-manager';
import { AppEvents } from './app-events';
import { DeliveryAlertStore } from './delivery-alert-store';

Expand Down Expand Up @@ -95,7 +95,7 @@ export function AppBase({ children }: React.PropsWithChildren<{}>): JSX.Element
)}
<SettingsContext.Provider value={settings}>
<AppControllerContext.Provider value={appController}>
<AlertStore />
<AlertManager />
<DeliveryAlertStore />
<Grid
container
Expand Down

0 comments on commit 9434771

Please sign in to comment.