Skip to content

Commit

Permalink
Merge pull request #1348 from cityofaustin/15279_missing_fields_changes
Browse files Browse the repository at this point in the history
Add new near trauma center fields to crashes table
  • Loading branch information
roseeichelmann authored Jan 25, 2024
2 parents 8e9eb0d + 8a53c17 commit 68764c2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ select_permissions:
- milepoint_2
- mpo_id
- nbr_of_lane
- near_trauma_center_distance
- near_trauma_center_id
- non_injry_cnt
- nonincap_injry_cnt
- obj_struck_id
Expand Down Expand Up @@ -701,6 +703,8 @@ select_permissions:
- milepoint_2
- mpo_id
- nbr_of_lane
- near_trauma_center_distance
- near_trauma_center_id
- non_injry_cnt
- nonincap_injry_cnt
- obj_struck_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE public.atd_txdot_crashes DROP COLUMN near_trauma_center_id;
ALTER TABLE public.atd_txdot_crashes DROP COLUMN near_trauma_center_distance;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Add new trauma center fields from CRIS to the crashes table
alter table "public"."atd_txdot_crashes" add column "near_trauma_center_id" integer
null;
alter table "public"."atd_txdot_crashes" add column "near_trauma_center_distance" float8
null;
15 changes: 3 additions & 12 deletions atd-vze/src/_nav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAdmin, isItSupervisor, isEditor } from "./auth/authContext";
import { isAdmin, isItSupervisor } from "./auth/authContext";

// Accept roles arg to restrict nav links by role
export const navigation = roles => {
Expand Down Expand Up @@ -36,17 +36,13 @@ export const navigation = roles => {
],
};

// Editor nav itmes
const editorNavItems = [
// Admin nav items
const adminNavItems = [
{
name: "Changes",
url: "/changes",
icon: "icon-layers",
},
];

// Admin nav items
const adminNavItems = [
{
title: true,
name: "Admin",
Expand Down Expand Up @@ -92,12 +88,7 @@ export const navigation = roles => {
},
];

if (isEditor(roles)) {
editorNavItems.forEach(item => nav.items.splice(-1, 0, item));
}

if (isAdmin(roles) || isItSupervisor(roles)) {
editorNavItems.forEach(item => nav.items.splice(-1, 0, item));
adminNavItems.forEach(item => nav.items.splice(-1, 0, item));
}

Expand Down
6 changes: 3 additions & 3 deletions atd-vze/src/routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { isAdmin, isItSupervisor, isEditor } from "./auth/authContext";
import { isAdmin, isItSupervisor } from "./auth/authContext";

const Breadcrumbs = React.lazy(() => import("./views/Base/Breadcrumbs"));
const Cards = React.lazy(() => import("./views/Base/Cards"));
Expand Down Expand Up @@ -179,13 +179,13 @@ const routes = roles => [
name: "Demo UI Components",
component: Dev,
},
(isEditor(roles) || isAdmin(roles) || isItSupervisor(roles)) && {
(isAdmin(roles) || isItSupervisor(roles)) && {
path: "/changes",
exact: true,
name: "Crash Changes",
component: CrashesChanges,
},
(isEditor(roles) || isAdmin(roles) || isItSupervisor(roles)) && {
(isAdmin(roles) || isItSupervisor(roles)) && {
path: "/changes/:id",
exact: true,
name: "Crash Change",
Expand Down

0 comments on commit 68764c2

Please sign in to comment.