Skip to content

Commit deff57c

Browse files
committed
Merge branch 'main' into live
2 parents a7452b3 + 6ebba7f commit deff57c

9 files changed

+133
-6
lines changed
Loading
Loading
Loading
Loading

docs/spfx/release-1.18.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,17 @@ export interface IHostContext {
169169

170170
Starting this version React templates use Fluent UI React v8 instead of v7.
171171

172+
### Transparent outline icon for Teams-hosted web parts
173+
The default outline icon for Teams-hosted web parts is now transparent. This allows to meet the Teams design guidelines for application.
174+
172175
## Deprecations
173176

174177
- `BaseAdaptiveCardView` - use `BaseAdaptiveCardQuickView` instead
175178
- `template` property in `BaseTemplateCardView` and its descendants
176179

177180
## Fixed Issues
178181

179-
This release didn't include fixes on any reported issues within the [SPFx issue list](https://github.com/SharePoint/sp-dev-docs/issues).
182+
- [#9010](https://github.com/SharePoint/sp-dev-docs/issues/9010) - Placeholder `{tenantDomain}` is not replaced with `SPFX_SERVE_TENANT_DOMAIN`.
180183

181184
## Feedback and issues
182185

docs/spfx/viva/design/designing-quick-view.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,13 @@ Currently dark themes are not supported for quick views on iOS and Android mobil
9393

9494
:::image type="content" source="../../../images/viva-design/img_quickview_ios_theme.jpg" alt-text="Screenshot that shows how a card viewed on mobile appears in light mode and dark mode.":::
9595

96+
We plan to introduce dark theme support in Quick View in Viva Connections Mobile for both iOS and Android in early Q4 of CY23. The API ([context.hostContext.theme](/javascript/api/sp-adaptive-card-extension-base/ihostcontext)) to get the theme in which Quick View is rendered of the Quick View will be available in SPFx 1.18.0 package.
97+
98+
:::image type="content" source="../../../images/viva-design/img_quickview_new_ios_theme.png" alt-text="Screenshot that shows how a card quickview viewed on mobile will appear in light mode and dark mode.":::
99+
100+
> [!IMPORTANT]
101+
> Please test your existing cards using [Adaptive Card designer](https://adaptivecards.io/designer) to make sure that the icons and images used in light mode for Quick View of the existing cards are compatible with dark mode as some discrepancies have been observed. Tenant admins will also be able to test their card Quick Views in dark mode. To update your card for the new theming, please follow the tutorial [**'Making your Quick View compatible with Dark Mode in Mobile'**](../get-started/making-quickview-compatable-darkmode-mobile.md).
102+
96103
### Behavior for links and Single sign-on
97-
For some cards, you will use links to URLs. Depending on the ___location of the content, links to URLs may display content in Microsoft Teams or elsewhere and Single sign-on (SSO) behavior can differ. Get more information about how links to URLs and SSO behave depending on the ___location of the content you are linking to. [Learn more](/viva/connections/create-dashboard.md#how-urls-and-single-sign-on-works)
104+
105+
For some cards, you will use links to URLs. Depending on the ___location of the content, links to URLs may display content in Microsoft Teams or elsewhere and Single sign-on (SSO) behavior can differ. Get more information about how links to URLs and SSO behave depending on the ___location of the content you are linking to. [Learn more](/viva/connections/create-dashboard#how-urls-and-single-sign-on-works)

docs/spfx/viva/get-started/actions/media-upload/MediaUploadDocumentation.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,9 @@ If you don't want to write up a new ACE but still want to see the media upload i
151151

152152
## Availability of media upload action
153153

154-
> [!NOTE]
155-
> Currently this feature is not supported in teams mobile and will throw an error indicating that this.
156-
157154
Action | Viva Connection Desktop | Viva Connections Mobile | Browser
158155
------------ | ----------------------- | ----------------------- | ---------
159-
Select Media | Supported | Not Supported | Supported
156+
Select Media | Supported | Supported | Supported
160157

161158
## See Also
162159

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Making Quick View compatible with dark mode in mobile devices
3+
description: Making Adaptive Card Extension Quick View compatible for both dark and light mode by using different resources for both scenarios.
4+
ms.date: 08/08/2023
5+
ms.localizationpriority: high
6+
---
7+
# Making Quick View compatible with dark mode in mobile devices
8+
9+
> [!IMPORTANT]
10+
> The following tutorial is targeted specifically for Quick View in Mobile for Viva Connections iOS and Android.
11+
12+
To adapt to the dark mode release in Viva Connections Mobile, which is scheduled for early Q4 of CY23, make sure that your card contents look compatible with both light and dark mode.
13+
14+
An API ([context.hostContext.theme](/javascript/api/sp-adaptive-card-extension-base/ihostcontext)) will be available in SPFx 1.18.0 package to get the information about the theme of the mobile app. This helps with using associated assets like images compliant to the theme. If you want to use two different sets of data while keeping the existing view style, follow these steps:
15+
16+
- Let’s create a basic card with an image in Quick View. Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/template/QuickViewTemplate.json**.
17+
- Replace the contents of this file with the following JSON:
18+
19+
```json
20+
{
21+
"type": "AdaptiveCard",
22+
"body": [
23+
{
24+
"type": "TextBlock",
25+
"weight": "Bolder",
26+
"text": "${title}"
27+
},
28+
{
29+
"type": "ColumnSet",
30+
"columns": [
31+
{
32+
"type": "Column",
33+
"items": [
34+
{
35+
"type": "Image",
36+
"url": "${imageUrl}"
37+
},
38+
{
39+
"type": "TextBlock",
40+
"weight": "Bolder",
41+
"text": "${subTitle}",
42+
"wrap": true,
43+
"horizontalAlignment": "Center"
44+
}
45+
],
46+
"width": "stretch"
47+
}
48+
]
49+
}
50+
],
51+
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
52+
"version": "1.3"
53+
}
54+
```
55+
56+
- Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/QuickView.ts**.
57+
- Add a variable **imageUrl** to the existing interface **IQuickViewData** and add **imageUrl value** to **data()** function.
58+
59+
```typescript
60+
import { ISPFxAdaptiveCard, BaseAdaptiveCardView } from '@microsoft/sp-adaptive-card-extension-base';
61+
import { ITestCardDmAdaptiveCardExtensionProps, ITestCardDmAdaptiveCardExtensionState } from '../TestCardDmAdaptiveCardExtension';
62+
import * as strings from 'TestCardDmAdaptiveCardExtensionStrings';
63+
64+
export interface IQuickViewData {
65+
subTitle: string;
66+
title: string;
67+
imageUrl: string;
68+
}
69+
70+
export class QuickView extends BaseAdaptiveCardView<
71+
ITestCardDmAdaptiveCardExtensionProps,
72+
ITestCardDmAdaptiveCardExtensionState,
73+
IQuickViewData
74+
> {
75+
public get data(): IQuickViewData {
76+
return {
77+
subTitle: strings.SubTitle,
78+
title: strings.Title,
79+
imageUrl: require('../assets/LightModeImage.png')
80+
};
81+
}
82+
83+
public get template(): ISPFxAdaptiveCard {
84+
return require('./template/QuickViewTemplate.json');
85+
}
86+
}
87+
```
88+
89+
- Quick View in mobile iOS looks like this:
90+
91+
:::image type="content" source="../../../images/viva-design/img_quickview_tutorial_light.png" alt-text="Screenshot that shows how an image in quick view viewed on mobile appears in light mode.":::
92+
93+
- When we switch to dark mode, the image conflicts with the background.
94+
95+
:::image type="content" source="../../../images/viva-design/img_quickview_tutorial_dark.png" alt-text="Screenshot that shows how the same image in quick view viewed on mobile appears in dark mode.":::
96+
97+
- To avoid this issue, we can assign different images for light and dark theme in **QuickView.ts**. Replace the existing code in the **data()** function with this snippet:
98+
99+
```typescript
100+
public get data(): IQuickViewData {
101+
const isDarkTheme = (this.context.hostContext.theme === 'dark') ? true : false;
102+
return {
103+
subTitle: strings.SubTitle,
104+
title: strings.Title,
105+
imageUrl: isDarkTheme ? require('../assets/DarkModeImage.png') : require('../assets/LightModeImage.png')
106+
}
107+
}
108+
```
109+
110+
- Now when we switch to dark mode, on opening the same Quick View we see for light and dark theme respectively.
111+
112+
:::image type="content" source="../../../images/viva-design/img_quickview_tutorial_light_and_dark.png" alt-text="Screenshot that shows how a card quick view viewed on mobile appears in light mode and dark mode with different images assigned.":::
113+
114+
Similarly, we can customize our icons, images, and other elements of Quick View to support both light and dark theme.
115+
116+
> [!NOTE]
117+
> Please note that the value for ‘this.context.hostContext.theme’ is undefined for web and Teams app as they do not support dark theme and is only available for Viva Connections Mobile iOS and Android.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@
592592
href: spfx/viva/get-started/build-people-search-adaptive-card-extension.md
593593
- name: Using focus feature in an ACE
594594
href: spfx/viva/features/focus-feature/FocusFeatureTutorial.md
595+
- name: Making Quick View compatible with dark mode
596+
href: spfx/viva/get-started/making-quickview-compatable-darkmode-mobile.md
595597
- name: Migrate existing ACEs to SharePoint Framework v1.18
596598
href: spfx/viva/get-started/migrate-to-spfx-1-18.md
597599
- name: Known issues

0 commit comments

Comments
 (0)