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

Added 'AdaptiveCardHost' Control #1119

Merged
merged 3 commits into from
Feb 12, 2022
Merged

Added 'AdaptiveCardHost' Control #1119

merged 3 commits into from
Feb 12, 2022

Conversation

fabiofranzini
Copy link
Collaborator

Added 'AdaptiveCardHost' Control and Documentation

Q A
Bug fix? [no]
New feature? [yes]
New sample? [no]
Related issues? mentioned in #1096

What's in this Pull Request?

I added the new 'AdaptiveCardHost' Control used for rendering Adaptive Cards in React using integrated features likes SP and Teams Themes, using Fluent UI React Controls for Elements and Actions and Templating.

Added 'AdaptiveCardHost' Control and Documentation
@joelfmrodrigues
Copy link
Collaborator

Clicking the 'Show Card' button on the test control gives an error, but works if clicked again. The same for closing the card using the button: clicking the first time gives an error, the second time works.
image

@joelfmrodrigues
Copy link
Collaborator

@fabiofranzini I added some comments for some minor things 🙂

@fabiofranzini
Copy link
Collaborator Author

Thanks @joelfmrodrigues I'll check this ASAP 🙂

Copy link
Collaborator

@AJIXuMuK AJIXuMuK left a comment

Choose a reason for hiding this comment

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

@fabiofranzini - please check out some additional comments I left.
Thanks for the great work!

src/controls/adaptiveCardHost/AdaptiveCardHost.css Outdated Show resolved Hide resolved
src/controls/adaptiveCardHost/AdaptiveCardHost.tsx Outdated Show resolved Hide resolved
src/controls/adaptiveCardHost/AdaptiveCardHost.tsx Outdated Show resolved Hide resolved
@fabiofranzini
Copy link
Collaborator Author

fabiofranzini commented Feb 11, 2022

Clicking the 'Show Card' button on the test control gives an error, but works if clicked again. The same for closing the card using the button: clicking the first time gives an error, the second time works. image

I'm not able to reproduce this bug (whether I use the test webpart with all controls or leaving only the AdaptiveCardHost control.) ... very strange...

ShowCardDemostration

I'm trying to remove the useless code from 'updateCssClasses' function and implement like this:

protected updateCssClasses() {
        if (this.renderedElement) {
            this.renderedElement.setAttribute(
                "aria-expanded",
                (this.state === ActionButtonState.Expanded).toString()
            );
        }
    }

@joelfmrodrigues
Copy link
Collaborator

Clicking the 'Show Card' button on the test control gives an error, but works if clicked again. The same for closing the card using the button: clicking the first time gives an error, the second time works. image

I'm not able to reproduce this bug (whether I use the test webpart with all controls or leaving only the AdaptiveCardHost control.) ... very strange...

ShowCardDemostration

I'm trying to remove the useless code from 'updateCssClasses' function and implement like this:

protected updateCssClasses() {
        if (this.renderedElement) {
            this.renderedElement.setAttribute(
                "aria-expanded",
                (this.state === ActionButtonState.Expanded).toString()
            );
        }
    }

@fabiofranzini think I have found the glitch with the error on button click 🙂 seems to happen when running using npm run serve, but not with gulp serve. Are you using gulp serve?

@fabiofranzini
Copy link
Collaborator Author

Clicking the 'Show Card' button on the test control gives an error, but works if clicked again. The same for closing the card using the button: clicking the first time gives an error, the second time works. image

I'm not able to reproduce this bug (whether I use the test webpart with all controls or leaving only the AdaptiveCardHost control.) ... very strange...
ShowCardDemostration
I'm trying to remove the useless code from 'updateCssClasses' function and implement like this:

protected updateCssClasses() {
        if (this.renderedElement) {
            this.renderedElement.setAttribute(
                "aria-expanded",
                (this.state === ActionButtonState.Expanded).toString()
            );
        }
    }

@fabiofranzini think I have found the glitch with the error on button click 🙂 seems to happen when running using npm run serve, but not with gulp serve. Are you using gulp serve?

@joelfmrodrigues I'm using gulp serve... It's ok?

@joelfmrodrigues
Copy link
Collaborator

Clicking the 'Show Card' button on the test control gives an error, but works if clicked again. The same for closing the card using the button: clicking the first time gives an error, the second time works. image

I'm not able to reproduce this bug (whether I use the test webpart with all controls or leaving only the AdaptiveCardHost control.) ... very strange...
ShowCardDemostration
I'm trying to remove the useless code from 'updateCssClasses' function and implement like this:

protected updateCssClasses() {
        if (this.renderedElement) {
            this.renderedElement.setAttribute(
                "aria-expanded",
                (this.state === ActionButtonState.Expanded).toString()
            );
        }
    }

@fabiofranzini think I have found the glitch with the error on button click 🙂 seems to happen when running using npm run serve, but not with gulp serve. Are you using gulp serve?

@joelfmrodrigues I'm using gulp serve... It's ok?

Sure, maybe a bug with spfx-fast-serve then. If it works with gulp serve then it's all good I think. As a side note, if you don't generally use fast serve I strongly advise you to give it a try as it's insanely fast

@fabiofranzini
Copy link
Collaborator Author

@joelfmrodrigues and @AJIXuMuK I just committed the changes... Please check now and of course many thanks for your feedback 🙂

@fabiofranzini
Copy link
Collaborator Author

@joelfmrodrigues @AJIXuMuK let me know if I must Squash this three commits or not.
I added a small fix, in the last commit, the return value for 'get value()' prop for the FluentUIDateInput to the correct format. 🙂

@AJIXuMuK AJIXuMuK merged commit 15c0968 into pnp:dev Feb 12, 2022
@AJIXuMuK
Copy link
Collaborator

Thanks again @fabiofranzini for the great contribution!

@AJIXuMuK AJIXuMuK added this to the 3.6.0 milestone Feb 12, 2022
@fabiofranzini
Copy link
Collaborator Author

Thanks again @fabiofranzini for the great contribution!

It's a pleasure! I'll do more contributions in the next months 🙂

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

Successfully merging this pull request may close these issues.

3 participants