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

Icon picker with localisation and documentation #485

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Icon picker with localisation and documentation #485

merged 1 commit into from
Mar 23, 2020

Conversation

Konradox
Copy link
Contributor

@Konradox Konradox commented Feb 23, 2020

Q A
Bug fix? [ ]
New feature? [x]
New sample? [ ]
Related issues?

What's in this Pull Request?

This pull request adds new control - IconPicker. This control allows to pick an icon from office-ui-fabric-react icon set.

@msftclas
Copy link

msftclas commented Feb 23, 2020

CLA assistant check
All CLA requirements met.

@AJIXuMuK
Copy link
Collaborator

Thank you @Konradox for the component!
I really like the idea to have an icon picker in the library.

The only thing I'm concerned - predefined list of icons' names. It will be hard to maintain if we change used office ui fabric version...

Maybe we could explicitly reference @uifabric/icons dependency (v 5.8.0 is the one used by office-ui-fabric-react@5.131.0) and use IconNames enum from there?
In that case we'll just need to update dependency, not maintain the list of names.

@estruyf - what are your thoughts?

@AJIXuMuK AJIXuMuK added type:discussion type:enhancement New feature or enhancement of existing capability labels Feb 23, 2020
@Konradox
Copy link
Contributor Author

You are right @AJIXuMuK. But it's not possible because this enum is a const enum:
export declare const enum IconNames { PageLink = "PageLink", CommentSolid = "CommentSolid",

This means that is not iterable. It's also marked as deprecated.

@estruyf
Copy link
Member

estruyf commented Feb 25, 2020

Maybe we need to find another way to get all the icon names. @juliemturner what was your approach to get all the available icon names?

@Konradox
Copy link
Contributor Author

Konradox commented Feb 25, 2020

In the newer version of @uifabric/icon there is a new folder called data and there is a file AllIconNames.json which contains all that we need. Maybe we could consider upgrading this package?

From @uifabric/icon github changelog:
7.1.0
Tue, 02 Jul 2019 12:29:06 GMT

Minor changes
Update MDL2 icons. Add AllIconNames.json

@AJIXuMuK
Copy link
Collaborator

Hi @Konradox,

We can try to use v7.1.0 of @uifabric/icon and test if it works with current referenced version of OUIFR.
If not - we're considering updating components to v7 of OUIFR but it will happen after SPFx is completely updated to v7 as well.

@russgove
Copy link
Contributor

hey, this may help microsoft/fluentui#11399

i upgraded the react-securitygrid sample webpart to show user selected icons based on a persons. permission level and needed the same thing.

@Konradox
Copy link
Contributor Author

Konradox commented Feb 26, 2020

@russgove that's the file I've linked and a solution that requires package update 😊

@AJIXuMuK I will check if the @uifabric/icon update will work.

Update: It doesn't work. OUIFR has to be updated as well.

@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Mar 6, 2020

Thank you @Konradox for checking this one.

@estruyf I think we can merge the control as is for now, but keep in mind that we'll need to update it after OUIFR update.

@estruyf estruyf merged commit 4dbd2ed into pnp:dev Mar 23, 2020
@estruyf
Copy link
Member

estruyf commented Mar 23, 2020

thanks @Konradox - merged this to our DEV branch

@estruyf estruyf mentioned this pull request Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:discussion type:enhancement New feature or enhancement of existing capability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants