Skip to content

Commit

Permalink
Legacy CSS Removal: Icons import Script - setup default/onerror place…
Browse files Browse the repository at this point in the history
…holder image
  • Loading branch information
phillipbentonkelly committed Oct 27, 2021
1 parent d072773 commit 49a3c6e
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 8 deletions.
1 change: 1 addition & 0 deletions components/icons/accessboston/accessboston.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "accessboston"
handle: "accessboston"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "2_tickets.svg"
- file: "Phire.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/accessboston/accessboston.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/accessboston" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/accessboston" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
1 change: 1 addition & 0 deletions components/icons/circle_icons/circle_icons.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "circle icons"
handle: "circle_icons"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "2_tickets.svg"
- file: "accessibility.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/circle_icons/circle_icons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/circle_icons" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/circle_icons" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
1 change: 1 addition & 0 deletions components/icons/dept_icons/dept_icons.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "dept icons"
handle: "dept_icons"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "age_strong.svg"
- file: "age_strong_black.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/dept_icons/dept_icons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/dept_icons" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/dept_icons" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
1 change: 1 addition & 0 deletions components/icons/drupal/drupal.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "drupal"
handle: "drupal"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "archive.svg"
- file: "delete.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/drupal/drupal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/drupal" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/drupal" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
1 change: 1 addition & 0 deletions components/icons/drupal_icons/drupal_icons.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "drupal icons"
handle: "drupal_icons"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "archive.svg"
- file: "delete.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/drupal_icons/drupal_icons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/drupal_icons" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/drupal_icons" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "experiential icons"
handle: "experiential_icons"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "1095_c_form.svg"
- file: "1095_c_form_computer.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/experiential_icons/experiential_icons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/experiential_icons" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/experiential_icons" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
1 change: 1 addition & 0 deletions components/icons/metrolist/metrolist.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: "metrolist"
handle: "metrolist"
status: "ready"
context:
defaultIcon: "https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg"
icons:
- file: "deposit_check.png"
- file: "deposit_check.svg"
Expand Down
7 changes: 6 additions & 1 deletion components/icons/metrolist/metrolist.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/metrolist" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/metrolist" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
2 changes: 2 additions & 0 deletions dev-scripts/icons_manifest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const constructManifestYamlReadyObj = async icons => {
handle: obj.category.replace(/ /g, '_'),
status: 'ready',
context: {
defaultIcon:
'https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg',
icons: [],
},
};
Expand Down
7 changes: 6 additions & 1 deletion dev-scripts/icons_manifest/manifest.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ex ex-i">
<img src="{{imgUrl "https://assets.boston.gov/icons/directory_name" icon.file}}" />
<img
alt="{{filename_to_string icon.file}}"
title="{{filename_to_string icon.file}}"
src="{{imgUrl "https://assets.boston.gov/icons/directory_name" icon.file}}"
onerror={{imgOnError}}
/>
</div>

<div class="p-a300 t--sans">
Expand Down
5 changes: 5 additions & 0 deletions fractal.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ const hbs = require('@frctl/handlebars')({
imgUrl: async function(pre, post) {
return `${pre}/${post}`;
},
imgOnError: function() {
const url =
'https://www.boston.gov/modules/custom/bos_content/modules/node_post/default_news.svg';
return `this.onerror=null;this.src='${url}';`;
},
// Stencil helps us maintain docs in the source directories for the
// components. This helper is here so that the Fractal component "Notes" can
// import those README files so that they appear in the Fractal UI.
Expand Down

0 comments on commit 49a3c6e

Please sign in to comment.