Code Monkey home page Code Monkey logo

patterns's Introduction

City of Boston

This is the pattern library for the City of Boston. It's currently a work in progress, but we're adding to it every day.

This project contains the marks and trade dress of the City of Boston's digital properties and should not be reused without the express permission of the City of Boston.

Build Status BrowserStack Status

Installing

npm install

Development

The pattern library is built using Stylus. We’re using PostCSS, Autoprefixer, and Rucksack as well. When JavaScript is required for the CSS components, we’re using plain JavaScript. All components should work without JavaScript as a default.

Web components are developed in TypeScript using the Stencil tool for compilation, bundling, and polyfills.

To develop against the pattern library, you can run:

npm run dev

This will build the components and watch for changes, and start up a Fractal server on https://localhost:3030/ to show the library.

Node 8 is required for development

Fractal uses a self-signed SSL certificate that is not trusted by browsers. If you’re using Chrome, you can allow invalid local signatures from this config setting: chrome://flags/#allow-insecure-localhost

All new features and changes need to work with our supported browsers.

Testing

Fleet has 2 types of tests:

During development, you can run npm run jest.dev to have Jest watch files and re-run.

To run the browser tests, start up your Fractal server with npm run dev and then run npm run testcafe.dev to start up a remote TestCafe server. It will print a URL that you can open in a web browser, and stay open to re-run tests when they change. You can even open this URL in a VM or on another computer to do testing in different browsers.

A prepush hook will run npm run test, which runs the Jest tests and also the TestCafe tests using a headless Chrome browser.

Check-in / Deployment

PRs should be made against the develop branch.

We have a Heroku pipeline that will automatically deploy per-PR instances of the patterns library. Look in the PR messages for a link.

Percy will also run for all of the Fractal component pages, so you can see if there are any breaking changes in the deploy.

In general, you should push to production immediately after merging the PR. To do a production push, open a new PR from develop -> production and merge it. If the change has significant visual changes, do visual browser testing before merging.

The Travis job will automatically push to S3 and invalidate the CloudFront cache.

Nov 2020: Migrated CI to travis-ci.com. Build history can be found at: https://travis-ci.org/github/CityOfBoston/patterns/branches

Reporting bugs

If you need to submit a bug report for the pattern library, please follow these guidelines. Following these guidelines helps us and the community better understand your report, reproduce the bug, and find related issues.

Prior to submitting a bug

  • Verify that you are able to reproduce it repeatedly. Try multiple browsers, devices, etc. Also, try clearing your cache.
  • Perform a quick search of our existing issues to see if it has been logged previously.

Submitting a bug

  • Use a clear and descriptive title when creating your issue.

  • Include a bulleted list of steps to reproduce your issue.

  • Include the URL of the page that you're seeing the issue on.

  • Include screenshots if possible. Bonus points if you include an animated GIF of the issue.

  • Include details about your browser (which one, what version, using ad blockers?).

  • When filing your issue, assume that the recipient knows nothing about what you're talking about. There is no such thing as too many details when filing your issue.

Bug report template

## Basic details

URL: [URL]

## Steps to reproduce

1. [FIRST]
2. [SECOND]
3. [THIRD]

## What I think should happen

[Describe your expected behavior here]

## What did happen

[Describe the actual behavior here]

## Browser details

Browser: [Enter browser]
Version: [Enter version]
Ad blocker: [Ad blocker?]

[SCREENSHOT]

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Changes/Updates

  • 2021.07 - Development and testing should be done on Node 10 (10.24.0)

DEPLOYS

  • [2020.06.08 - Staging] - Permit Finder - VPAT

patterns's People

Contributors

carolyn-wang avatar cob-deployer avatar davidrkupton avatar dependabot[bot] avatar fionawhim avatar greenkeeper[bot] avatar jessicamarcus avatar jimafisk avatar kdonaldson avatar matthewcrist avatar mmcgowanbos avatar paylakatel avatar phillipbentonkelly avatar stephaniemar avatar subaha-cob avatar zweishar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

patterns's Issues

Hide / Show layer UI

Need to optionally be able to toggle layers on and off the map. Per-layer config to be always on, default on, default off.

Refactor photo component

Refactor photo component

  • Move to pattern library

  • Create themeable

  • Review backlog for bugs to resolve

Death certs punch list

  • Space between checkboxes and radio buttons and their labels
  • Missing descenders in form elements
  • .br-b*** classes
  • .sel--thin support
  • Missing descender in search element (FF)
  • Telephone form field needs the "text" treatment
  • sel-c needs 100% width

Pop-up on maps spacing overlapping

The title and the field content are overlapping each other in map pop-ups:
image

Could be user error - here is the html used for the pop-up:

"<div style=\"min-width: 280px\">\n <h3 class=\"h3 m-v300\"><a href=\"{{name}}\">{{name}}</a></h3>\n <div class=\"m-v300\">\n <ul class=\"dl dl--sm\">\n <li class=\"dl-i\"><span class=\"dl-t\">Address:</span> <span class=\"dl-d\">{{address}}</span></li>\n <li class=\"dl-i\"><span class=\"dl-t\">Schedule:</span> <span class=\"dl-d\">{{schedule}}</span></li>\n <li class=\"dl-i\"><span class=\"dl-t\">Hours:</span> <span class=\"dl-d\">{{hours}}</span></li></ul>\n </div>"

Higher zoom level for address search

After a users searches for their address, have the map center on the found address(es) at a higher zoom level than it currently does (more zoomed out - 14 or 15 might work?). So that they can see more information around the address they searched.

Users testing the snow emergency map have been getting confused when they search for their address and then have to zoom back out to see the nearest parking garage.

Simplify <cob-map> implementation

Remove the HTML configuration functionality from and focus just on the JSON configuration.

Simplifies things since we don’t need to handle changes or updating properties.

Accessibility: Change code for B logo in menu to accommodate Screen Readers

The Problem:

Siteimprove flags the B in the Menu as problematic for assistive technology because a title tag is present without an accompanying alt tag. A screen reader knows how to handle both an empty alt attribute and one with a text. If there is no attribute some screen readers will compensate and read the path to the image instead.

site improve ticket screen shot

b logo site improve alt text screen shot

View Issue and Suggested Solutions in SiteImprove

URL: https://my2.siteimprove.com/Inspector/341026/Accessibility/Page?pageId=8050765329&impmd=68716A68AC2C7A88B4D3675E121C85F5#/Criterion/1.1.1/Check/1

Summary of suggested solutions:

  1. add alt text to B image in the Menu to resolve the issue for screen readers, or
  2. remove title attribute and set the alt text to null (alt=“”), if the preference is to have screen readers ignore the logo.

Fixing this addresses other Accessibility issues flagged in SiteImprove:

The image does not have the correct alternative:
URL: https://my2.siteimprove.com/Inspector/341026/Accessibility/Page?pageId=8050765329&impmd=68716A68AC2C7A88B4D3675E121C85F5#/Criterion/1.1.1/Check/46

Image link is missing alternative text
URL: https://my2.siteimprove.com/Accessibility/341026/Pages/Issue?CheckId=5&CriterionChapter=2.4.4

Map center should be offset by legend width

The map should ignore the width of the legend when setting its center point. This will let us set a center point to the middle of Boston, the browser‘s location, or a search result without worrying that it’s obscured or crowded out by the legend.

Centered without regard to legend:

screen shot 2018-02-08 at 1 53 19 pm

Centered outside of legend:

screen shot 2018-02-08 at 1 53 30 pm

Address Search/Legend div automatically close on maps

Expected Behavior:
When viewing a map on a mobile device, or on a screen small enough for the overlay div to be collapsed, the menu should automatically re-collapse once a user has searched for an address, so the user would see this directly after selecting an address:

screen shot 2018-03-12 at 1 26 15 pm

Actual behavior:
The div stays open after an address has been selected and the user sees this:

screen shot 2018-03-12 at 1 23 02 pm

Modal map design

Map triggered by a button that pops it up as a full-screen modal.

mobile: responsive table bug

Expected Behavior/Acceptance Criteria


Tables should be centered on the page, and responsive when viewed on mobile phones in portrait and landscape view.

URL: https://www.boston.gov/parks-and-playgrounds

On iPhone X:

desired outcome - screenshot_20180301-174727

Actual Behavior


on iPhone:
south end screenshot_20180301-173933

On Android:
android portrait

Browser


see below

Device


Samsung Galaxy S8
Release: 2017, April
OS: Android, v7
Browser: Chrome
Screen Size: 5.8 in - 2.5 x 5.2 in
Resolution: 1440 x 2960 px
Viewport: 360 x 740 dp
Aspect Ratio: 18.5 : 9

IPHONE X
Release: 2017, September
OS: OS, v11
Browser: Safari
Screen Size: 5.8 in - 2.79 x 5.65 in
Resolution: 1125 x 2436 px
Viewport: 375 x 812 dp
Aspect Ratio 19.5 : 9

Example URL


URL: https://www.boston.gov/metrolist/lottery-and-resale
URL: https://www.boston.gov/transportation/performance-parking-pilot
URL: https://www.boston.gov/parks-and-playgrounds

Relevant Screenshot(s) or Logs


Tables Discussed elsewhere: see comment from @jimafisk:
#730 Replace table formatting on websites

Steps to Reproduce the Behavior/How to Test


  1. On your mobile phone, go to a URL that has one of these tables.
  2. Expand a drawer to expose the table within.
  3. Verify that the table is centered and has a border.
  4. Rotate the phone and verify the table is responsive (i.e. nothing breaks, still aligned, centered, with border)
  5. Repeat steps 1-5 for each drawer.

Reminder: Add any relevant Labels, Projects, and/or Milestone(s). If fields don't apply, please right N/A.

Increase width and opacity when displaying line features

Users testing the snow emergency map have an interest in seeing the street names under the streets with restricted parking. If increase the line width (to 5 maybe?) and the opacity (to 0.6 maybe?) when displaying line features that should help.

For the future: I think moving to a vector basemap would address this issue because you can make labels always draw on top, but for now we should adjust our default line width/opacity to address

Add tables to pattern library

Add tables to pattern library, but use the tables that were used on budget.boston.gov

  • revisit spacing between the table title and table

  • when testing, account for our current variants of tables (with top row styling option)

Few tables to test with:

  1. performance parking
  2. past budgets

Browser tests for web components

Try out using a web testing framework to validate web components across a few different supported browsers.

  • Pick a testing framework
  • Implement / document a dev-side story
  • Add CI

Fix map vectors on IE11

The map vectors don't appear due to a CSS rule in the legacy boston.gov stylesheet that gives svg elements width: auto; height: auto;

We should remove that rule, but need to QA to make sure it’s ok.

Sub-layer display options

We need to be able to specify different icons and/or colors for features within a layer based on properties of the feature.

If used, the different icons should appear on the legend.

Stable display order for <cob-map> layers

Currently the order that layers appear is slightly non-deterministic because the config events are not firing always in source order.

The layers should appear in the order in which they're specified as <cob-map> children.

Move off of Esri Leaflet forks

Now that our PRs have been merged, we can use the official npm releases of the Esri leaflet (and virtual grid) packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.