Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor icons.json #2084

Merged
merged 3 commits into from
Feb 6, 2018
Merged

refactor icons.json #2084

merged 3 commits into from
Feb 6, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented Feb 5, 2018

Changes proposed in this pull request:

  • 🔥 icons.json name=>displayName, className=>iconName
  • update generate-icons-source

Reviewers should focus on:

this PR should fix the broken Icons page in #2070
new record for most files changed? 870

@blueprint-bot
Copy link

icons.json name=>displayName, className=>iconName

Preview: documentation | landing | table

function toShortName(icon) {
return icon.className.replace("pt-icon-", "");
/**
* Removes `pt-icon-` prefix from icon className.
Copy link
Contributor

Choose a reason for hiding this comment

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

that's not what this does

@@ -111,13 +112,13 @@ function exportIconConsts(valueGetter) {
async function buildPathsObject(objectName, size) {
return Promise.all(
ICONS_METADATA.map(async icon => {
const filepath = path.resolve(__dirname, `../../resources/icons/${size}px/${icon.className}.svg`);
const filepath = path.resolve(__dirname, `../../resources/icons/${size}px/${toLongName(icon)}.svg`);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we batch rename the SVG files too? no need for pt- in the filename

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oof, sure

Gilad Gray added 2 commits February 5, 2018 17:17
also chmod -x all these files (why were they executable in the first place??)

// map ENUM_NAME to pt-icon-class-name
writeLinesToFile("iconClasses.ts", ...exportIconConsts(icon => icon.className));
writeLinesToFile("iconClasses.ts", ...exportIconConsts(toLongName));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adidahiya thoughts on deleting this file as it's simply Classes.iconClass(IconNames.AIRPLANE)?

Copy link
Contributor

Choose a reason for hiding this comment

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

hm yeah I guess that's fine... can you add it to the migration script?

@blueprint-bot
Copy link

docs

Preview: documentation | landing | table

@giladgray giladgray merged commit a057afa into develop Feb 6, 2018
@giladgray giladgray deleted the gg/icons-json branch February 6, 2018 19:01
@adidahiya
Copy link
Contributor

are you going to delete iconClasses.ts?

@giladgray
Copy link
Contributor Author

giladgray commented Feb 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants