Skip to content

Commit

Permalink
fix(Icons): fix broken Android icons (#2391)
Browse files Browse the repository at this point in the history
  • Loading branch information
joakbjerk authored Jun 7, 2023
1 parent 88c41e9 commit ea12f23
Show file tree
Hide file tree
Showing 34 changed files with 130 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Icons are getting added (more or less) automatically by extracting them from [Fi

To fetch new icons from the [Figma Icons Library](https://www.figma.com/file/2aNwT4Lbyt9hFmDv8k34yN/Eufemia---Icons?node-id=1%3A9) file, you have to:

1. Re-branch `main`, and name it `icons/{your-branch-name}` (it needs to include icons in the name):
1. Re-branch `main`, and name it `icons/{your-branch-name}` (it needs to include `icons/` in the name):

```bash
git pull origin main
Expand All @@ -30,12 +30,9 @@ To fetch new icons from the [Figma Icons Library](https://www.figma.com/file/2aN
```

1. After the CI/CD process has finished it should have made a commit back to the branch including the new optimized icons.
1. With that commit, make a PR back to `main`, review, and (squash) merge it.

**Notes:**

- The PR or commit needs a [appropriate title](/contribute/style-guides/git) e.g. `feat(Icons): add [icon names]` or `fix(Icon): fix cropped [icon name]`. You can either give the commit a good title during the squash merge of the PR or you may pull and rebase interactive `git pull && git rebase -i` or amend.
- Depending on the situation, you may have to pull the changes down locally, and run all tests, to eventually [update broken visual snapshots](/contribute/getting-started#running-tests-locally). But ideally, all of that should be handled during the CI/CD process.
1. Pull the changes down locally, and run visual tests to [update the snapshots](/contribute/getting-started#running-tests-locally). Ideally, all of that should be handled during the CI/CD process.
1. Make a PR back to `main`, review, and (squash) merge it.
- The PR or commit needs a [appropriate title](/contribute/style-guides/git) e.g. `feat(Icons): add [icon names]` or `fix(Icon): fix cropped [icon name]`. You can either give the commit a good title during the squash merge of the PR or you may pull and rebase interactive `git pull && git rebase -i` or amend.

## How to fix icons?

Expand All @@ -47,7 +44,7 @@ If you need to re-fetch one or several icons that got updated or changed in the

## How to convert icons only?

During development of the conversion script `convertSvgToJsx` you may consider to run `yarn workspace @dnb/eufemia dev:icons`. Its the same process, when calling `yarn build`. It will convert SVGs to JSXs and create all the needed index files in watch mode.
During development of the conversion script `convertSvgToJsx` you may consider to run `yarn workspace @dnb/eufemia icons:dev`. Its the same process, when calling `yarn build`. It will convert SVGs to JSXs and create all the needed index files in watch mode.

## Icons CI/CD process description

Expand All @@ -60,11 +57,10 @@ Icons are getting added (more or less) automatically by extracting them from Fig
1. Download the Figma file (JSON) by a stream basis, and cache that.
1. Store the new version, in a version file.
1. Parse the JSON Figma file for valid icon IDs.
1. For PDF only: unpack the existing zip file with icons.
1. Checks if an icon file (SVG or PDF) exists in the repo.
1. Checks if an icon file (SVG) exists in the repo.
1. If no, download it.
1. Details about the icon file are getting stored in a "lock" file, so we can compare it next time against.
1. For PDF only: pack the icon files to a zip (tar) and delete the files.
1. For XML only: Use Java and vd-tool to convert and pack the XML files to a zip (tgz) and delete the XML files.
1. For SVG only: store a meta data file, so the portal can display more relevant data about the icons.
1. For SVG only: optimize the SVG file for a lower size.
1. For SVG only: Create a JSX component.
Expand Down
3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document_add.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document_add_medium.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document_contract.svg

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions packages/dnb-eufemia/assets/icons/dnb/document_csv.svg

This file was deleted.

6 changes: 0 additions & 6 deletions packages/dnb-eufemia/assets/icons/dnb/document_csv_medium.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document_loupe.svg

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dnb-eufemia/assets/icons/dnb/document_medium.svg

This file was deleted.

6 changes: 0 additions & 6 deletions packages/dnb-eufemia/assets/icons/dnb/document_pdf.svg

This file was deleted.

Loading

1 comment on commit ea12f23

@vercel
Copy link

@vercel vercel bot commented on ea12f23 Jun 7, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.