Skip to content

Add/edit tags to track decomissioned components and add protection type subcomponents to Access Control components#1588

Merged
mddilley merged 6 commits into
mainfrom
mike/22248_comp_tags_and_subcomponents
May 8, 2025
Merged

Add/edit tags to track decomissioned components and add protection type subcomponents to Access Control components#1588
mddilley merged 6 commits into
mainfrom
mike/22248_comp_tags_and_subcomponents

Conversation

@mddilley
Copy link
Copy Markdown
Collaborator

@mddilley mddilley commented Apr 29, 2025

Associated issues

Closes cityofaustin/atd-data-tech#22248, Closes cityofaustin/atd-data-tech#22232

This PR makes changes to component tags to make it easier to mark and filter out decommissioned components and also to be able to add protection type subcomponents like flex posts to some of the Access Control component types.

Testing

URL to test:

Local 🙏

Steps to test:

  1. Start up you local stack and then go to the data dictionary https://localhost:3000/moped/dev/lookups
  2. Load the staging data dictionary to compare https://moped.austinmobility.io/moped/dev/lookups
  3. Navigate to the component tags section and notice that the tag with type "Bikeways - Performance Measure" and name "Upgrades Existing" now only has name "Upgrades Existing Component"
  4. Note that there is also a new component tag with type "Decommissioned / Upgraded Component"
  5. Now, go to the components section of the dictionary and notice that these four components now list all protection type subcomponents as available:
    • Access Control - Median
    • Access Control - Driveway Closure
    • Access Control - Driveway Modification
    • Access Control - Hardened Centerline
  6. Try adding these component tags and creating an Access Control component listed above with a protection type subcomponents

Ship list

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2025

Deploy Preview for atd-moped-main ready!

Name Link
🔨 Latest commit 097ed76
🔍 Latest deploy log https://app.netlify.com/sites/atd-moped-main/deploys/681bec01f3333b00089fd4fa
😎 Deploy Preview https://deploy-preview-1588--atd-moped-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

INSERT INTO moped_component_tags (name, type, slug) VALUES
('', 'Decommissioned / Upgraded Component', 'decommissioned_upgraded_component');

-- Update existing component tag name to include 'component' in name
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment misplaced?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe? it isn't a great comment so I updated. thanks! Also, I noticed that my editor didn't use SQLFluff on this file successfully so that is fixed now too.

Copy link
Copy Markdown
Member

@chiaberry chiaberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test steps check out, and I was able to add components to the map with the new tags and subcomponents

Copy link
Copy Markdown
Contributor

@tillyw tillyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and was able to add the new component and subcomponent tags/types!

Copy link
Copy Markdown
Member

@johnclary johnclary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test steps check out ✅

inserts_todo.component_id,
inserts_todo.subcomponent_id
FROM
inserts_todo;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I noticed we don't have a unique constraint on (component_id, subcomponent_id) on this table—what do you think about adding one?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch - thanks John! I will add in this PR. 🙏

@@ -0,0 +1,44 @@
-- Insert new tag to mark decommissioned components
INSERT INTO moped_component_tags (name, type, slug) VALUES
('', 'Decommissioned / Upgraded Component', 'decommissioned_upgraded_component');
Copy link
Copy Markdown
Member

@johnclary johnclary May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is an existing pattern for this table, but inserting an empty string feels very icky. If null values are acceptable, can we relax the not null constraint?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does indeed feel blah - thanks for spotting this! I will update this and some of the existing tags with empty strings while I'm at it (and makes sure they render as expected). 🧹✨🙏

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into a snag here so I created cityofaustin/atd-data-tech#22462 to address and fix a bug in the AGOL view where null names cause the tags to not list at all and empty strings are causing unwanted dashes. We'll get there!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complications! Thanks for following-up on that 👍

@mddilley mddilley merged commit 878db12 into main May 8, 2025
5 checks passed
@mddilley mddilley deleted the mike/22248_comp_tags_and_subcomponents branch May 8, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ability to make maps and reports of component counts of a type over time Add all protection type subcomponents to Access Control components

4 participants