Migrate styleguide icons
Created by: Tirokk
Authored by alina-beck Merged
🍰 Pullrequest
Replaces <ds-icon>
from the styleguide with a new <base-icon>
directly in our repo.
Issues
- relates #2074
ToDo
-
add Storybook stories for BaseIcon
-
register BaseIcon
for component tests -
include a list of icons in Storybook (if possible) -
find/provide a list of all available icons (via icomoon or the styleguide)
Background
A few things that are good to know:
- I had to adapt the folder structure we discussed earlier and will now put a
_new
folder into the existing folders when adding new stuff because Nuxt.js forces a particular folder structure on us and there is currently no way to change it (this is also reflected in the docs) - All components in the
generics
folder that are prefixed withBase
will be globally available and don't have to be imported. But: changes made to these components will only be visible when rebuilding the frontend! (So when you work onBaseComponents
make sure to import them like regular components temporarily, to see changes reflected immediately.) - I only copied the icons we are actually using in the app, so instead of more than 600 we now only include 65 icons in the project. To add more icons when you need them just copy-paste the
.svg
file from the styleguide into the/assets/_new/icons/svgs
folder! (I'll try to find/set up a good way to search all available icons.)
Files to review
A ton of files changed just because...
- I replaced
<ds-icon>
with<base-icon>
--> many.vue
files can be ignored, - pasted the
svgs
from the styleguide --> all.svg
files can be safely ignored, - and changed the
localVue
import in all test files --> all.spec.js
files can be ignored
Please have a look at:
-
webapp/README.md
-
webapp/assets/_new/icons/index.js
-
webapp/components/Category/index.vue
-
webapp/components/DropdownFilter/DropdownFilter.vue
-
webapp/components/LocaleSwitch/LocaleSwitch.vue
-
webapp/components/User/User.vue
-
webapp/components/_new/generic/BaseIcon/BaseIcon.story.js
-
webapp/components/_new/generic/BaseIcon/BaseIcon.vue
-
webapp/package.json
-
webapp/plugins/base-components.js
-
webapp/storybook/config.js
-
webapp/storybook/webpack.config.js
-
webapp/test/fileMock.js
-
webapp/test/registerContext.js
-
webapp/test/testSetup.js
That should be all the relevant changes.