microsoft / Viva-Connections-Extensibility-Beta

38 stars 6 forks source link

Hiding a card: Hiding the card is not working #26

Closed vasanthkumarc94 closed 3 years ago

vasanthkumarc94 commented 3 years ago

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Versions

[Windows ] Operating System [ 12.13 ] Node version [ ] Gulp version [ ] SPFx Generator version (npm list -g @microsoft/generator-sharepoint)

Expected or Desired Behavior

I am trying to hide the Card when loading a page, even though cardView I have not registered I am seeing the card get loaded on the page. My understanding is since "protected renderCard(): string | undefined; " is by default it is rendering the BaseCardView.

Observed Behavior

By default BaseCardView is loaded in the page.

trying

is there a way to load the card on the demand, for example if Card get some data then only Card will be available on the page or if there is no data then Card should not be available. Any suggestions or workaround really helpful ......

johnguy0 commented 3 years ago

The documentation for BaseAdaptiveCardExtension.renderCard has a remark clarifying a default view will be displayed. There is currently no way to hide the card, but we are looking at adding it in the future.

vasanthkumarc94 commented 3 years ago

Is there any workaround Can I try...

jansenbe commented 3 years ago

@vasanthkumarc94 : if the card is not getting data (e.g. because the user is not licensed), then you for now should show a card explaining the reason the card is not working. If the card is not relevant at all the admin managing the Viva connections dashboard should simply not add the card.

vasanthkumarc94 commented 3 years ago

Thank you for the suggestion @jansenbe , I thought of that but I have other kind of scenario also with this... just tried that with data property. If it works with that then I could incorporate it. Any way its in future road map. Thank you @johnguy0