Skip to content

Commit

Permalink
Merge pull request #2758 from microsoftgraph/merge/chat-from-main
Browse files Browse the repository at this point in the history
chore: update chat from main
  • Loading branch information
gavinbarron authored Oct 5, 2023
2 parents d0f3fa2 + c2eba02 commit 9becafa
Show file tree
Hide file tree
Showing 192 changed files with 1,238 additions and 1,086 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pr-chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
shell: bash
run: |
cp samples/react-contoso/.env.sample samples/react-contoso/.env
sed -i 's|REACT_APP_CLIENT_ID="00000000-0000-0000-0000-000000000000"|REACT_APP_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT}}"|g' samples/react-contoso/.env
sed -i 's|REACT_APP_BACKEND_CLIENT_ID="00000000-0000-0000-0000-000000000000"|REACT_APP_BACKEND_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT_BACKEND}}"|g' samples/react-contoso/.env
sed -i 's|REACT_APP_CLIENT_ID="ed072e38-e76e-45ae-ab76-073cb95495bb"|REACT_APP_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT}}"|g' samples/react-contoso/.env
sed -i 's|REACT_APP_BASE_DIR="/"|REACT_APP_BASE_DIR="/next/mgt-chat"|g' samples/react-contoso/.env
- name: Build 🛠
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Clean pr storybook
name: Clean pr deployments

on:
pull_request:
Expand Down Expand Up @@ -30,5 +30,29 @@ jobs:
git config user.name github-actions
git config user.email github-actions@github.com
git rm -r next/pr/${{ github.event.number }}
git commit -m "PR ${{ github.event.number }} closed"
git commit -m "PR ${{ github.event.number }} closed - remove storybook"
git push
react-contoso:
if: "contains(github.event.pull_request.labels.*.name, 'Build: React Contoso')"
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v2
with:
ref: gh-pages
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git rm -r next/sample/pr/${{ github.event.number }}
git commit -m "PR ${{ github.event.number }} closed - remove react-contoso"
git push
2 changes: 1 addition & 1 deletion .github/workflows/pr-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ jobs:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
message: 'The updated storybook is available [here](https://mgt.dev/next/pr/${{ github.event.number }})'
message: '📖 The updated storybook is available [here](https://mgt.dev/next/pr/${{ github.event.number }})'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/pr-test-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Deploy react-contoso sample app for PR

on:
pull_request:
types: [opened, labeled, synchronize, reopened]
branches: [main, release/**, next/**]

jobs:
react-contoso:
if: "contains(github.event.pull_request.labels.*.name, 'Build: React Contoso')"
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Install deps 🛠
run: |
echo "installing deps for packages"
yarn
- name: Setup env file
shell: bash
run: |
cp samples/react-contoso/.env.sample samples/react-contoso/.env
sed -i 's|REACT_APP_CLIENT_ID="ed072e38-e76e-45ae-ab76-073cb95495bb"|REACT_APP_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT}}"|g' samples/react-contoso/.env
sed -i 's|REACT_APP_BASE_DIR="/"|REACT_APP_BASE_DIR="/next/sample/pr/${{ github.event.number }}"|g' samples/react-contoso/.env
- name: Build 🛠
run: |
yarn build
yarn build:react-contoso
- name: Deploy mgt.dev/sample/pr/${{ github.event.number }} 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: samples/react-contoso/build
target-folder: next/sample/pr/${{ github.event.number }}

- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
message: '🚀 New react-contoso sample application deployed [here](https://mgt.dev/next/sample/pr/${{ github.event.number }})'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
folder: storybook-static
target-folder: next
clean-exclude: |
sample
pr
v3
mgt-chat
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.1.1-5b4fd72c86-0078a23cd9.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ $progress-ring-size: var(--progress-ring-size, 24px);

:host .file-list-wrapper {
background-color: $file-list-background-color;
box-shadow: $file-list-box-shadow;
border: $file-list-border;
position: relative;
display: flex;
Expand Down Expand Up @@ -76,7 +75,7 @@ $progress-ring-size: var(--progress-ring-size, 24px);
--file-padding: 10px 20px 10px 20px;
--file-padding-inline-start: 24px;
--file-border-radius: 2px;
--file-background-color: var(--file-item-background-color, var(--neutral-layer-floating));
--file-background-color: var(--file-item-background-color, var(--neutral-layer-1));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
@import '../../components/mgt-file/mgt-file.theme';

$file-list-background-color: var(--file-list-background-color, var(--neutral-layer-floating));
$show-more-button-background-color: var(--show-more-button-background-color, var(--neutral-layer-floating));
$show-more-button-background-color--hover: var(--show-more-button-background-color-hover, var(-neutral-fill-hover));
$show-more-button-background-color: var(--show-more-button-background-color, var(--neutral-stroke-divider-rest));
$show-more-button-background-color--hover: var(
--show-more-button-background-color-hover,
var(--neutral-fill-input-alt-active)
);
2 changes: 2 additions & 0 deletions packages/mgt-components/src/components/mgt-file/mgt-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ $line3-text-transform: var(--file-line3-text-transform, initial);
background-color: $file-background-color-hover;
border-radius: $file-border-radius;
cursor: pointer;

--secondary-text-color: var(--secondary-text-hover-color);
}

&:focus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

$line1-color: var(--file-line1-color, var(--neutral-foreground-rest));
$line2-color: var(--file-line2-color, var(--neutral-foreground-hint));
$line3-color: var(--file-line3-color, var(--neutral-foreground-hint));
$line2-color: var(--file-line2-color, var(--secondary-text-color));
$line3-color: var(--file-line3-color, var(--secondary-text-color));
$file-background-color: var(--file-background-color);
$file-background-color-focus: var(--file-background-color-focus, var(--neutral-fill-hover));
$file-background-color-hover: var(--file-background-color-hover, var(--neutral-fill-hover));
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,43 @@

@import '../../styles/shared-sass-variables';

$input-background: padding-box linear-gradient(
var(--people-picker-input-background, var(--neutral-fill-input-rest)),
var(--people-picker-input-background, var(--neutral-fill-input-rest))),
$input-background: padding-box
linear-gradient(
var(--people-picker-input-background, var(--neutral-fill-input-rest)),
var(--people-picker-input-background, var(--neutral-fill-input-rest))
),
border-box var(--people-picker-input-border-color, var(--neutral-stroke-input-rest));
$input-hover-background: padding-box linear-gradient(
var(--people-picker-input-hover-background, var(--neutral-fill-input-hover)),
var(--people-picker-input-hover-background, var(--neutral-fill-input-hover))),
$input-hover-background: padding-box
linear-gradient(
var(--people-picker-input-hover-background, var(--neutral-fill-input-hover)),
var(--people-picker-input-hover-background, var(--neutral-fill-input-hover))
),
border-box var(--people-picker-input-hover-border-color, var(--neutral-stroke-input-hover));
$input-focus-background: padding-box linear-gradient(
var(--people-picker-input-focus-background, var(--neutral-fill-input-focus)),
var(--people-picker-input-focus-background, var(--neutral-fill-input-focus))),
$input-focus-background: padding-box
linear-gradient(
var(--people-picker-input-focus-background, var(--neutral-fill-input-focus)),
var(--people-picker-input-focus-background, var(--neutral-fill-input-focus))
),
border-box var(--people-picker-input-focus-border-color, var(--neutral-stroke-input-focus));
$placeholder-text-color: var(--people-picker-input-placeholder-text-color, var(--input-placeholder-rest));
$placeholder-hover-text-color: var(--people-picker-input-placeholder-hover-text-color, var(--input-placeholder-hover));
$placeholder-focus-text-color: var(--people-picker-input-placeholder-focus-text-color, var(--input-placeholder-filled));
$selected-option-bg: var(--people-picker-selected-option-background-color, var(--person-background-color, var(--neutral-layer-3)));
$selected-option-bg: var(
--people-picker-selected-option-background-color,
var(--person-background-color, var(--neutral-layer-3))
);
$selected-option-highlight-bg: var(--people-picker-selected-option-highlight-background-color, var(--accent-fill-rest));
$dropdown-card-color: var(--people-picker-dropdown-background-color, var(--neutral-fill-rest));
$dropdown-result-bg-color: var(--people-picker-dropdown-result-background-color, var(--person-background-color, transparent));
$dropdown-result-hover-bg-color: var(--people-picker-dropdown-result-hover-background-color, var(--person-background-color, var(--neutral-layer-2)));
$dropdown-result-focus-bg-color: var(--people-picker-dropdown-result-focus-background-color, var(--person-background-color, var(--neutral-layer-2)));
$dropdown-card-color: var(--people-picker-dropdown-background-color, var(--neutral-layer-card-container));
$dropdown-result-bg-color: var(
--people-picker-dropdown-result-background-color,
var(--person-background-color, transparent)
);
$dropdown-result-hover-bg-color: var(
--people-picker-dropdown-result-hover-background-color,
var(--person-background-color, var(--neutral-fill-rest))
);
$dropdown-result-focus-bg-color: var(
--people-picker-dropdown-result-focus-background-color,
var(--person-background-color, var(--neutral-fill-rest))
);
$no-results-color: var(--people-picker-no-results-text-color, var(--neutral-foreground-hint));
16 changes: 16 additions & 0 deletions packages/mgt-components/src/components/mgt-picker/mgt-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@
:host {
--max-height: var(--picker-max-height, 380px);

font-family: $font-family;

.picker {
background-color: $picker-background-color;
}

fluent-combobox {
&::part(selected-value) {
&::placeholder {
color: $picker-text-color;
}

&:hover {
&::placeholder {
color: $picker-text-hover-color;
}
}
}
}
}

[dir='rtl'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
@import '../../styles/shared-sass-variables';

$picker-background-color: var(--picker-background-color, transparent);
$picker-text-color: var(--picker-text-color, var(--input-filled-placeholder-rest));
$picker-text-hover-color: var(--picker-text-color-hover, var(--secondary-text-hover-color));
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@
@import './mgt-taxonomy-picker.theme';

:host {
--max-height: var(--taxonomy-picker-max-height, 380px);
--max-height: var(--taxonomy-picker-list-max-height, 380px);

.picker {
background-color: $taxonomy-picker-background-color;
}

fluent-combobox {
&::part(selected-value) {
&::placeholder {
color: $taxonomy-picker-placeholder-color;
}

&:hover {
&::placeholder {
color: $taxonomy-picker-placeholder-hover-color;
}
}
}
}
}

[dir='rtl'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
@import '../../styles/shared-sass-variables';

$taxonomy-picker-background-color: var(--taxonomy-picker-background-color, transparent);
$taxonomy-picker-placeholder-color: var(--taxonomy-picker-placeholder-color, var(--input-filled-placeholder-rest));
$taxonomy-picker-placeholder-hover-color: var(
--taxonomy-picker-placeholder-color-hover,
var(--secondary-text-hover-color)
);
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ registerFluentComponents(fluentCombobox, fluentOption);
*
* @cssprop --taxonomy-picker-background-color - {Color} Picker component background color
* @cssprop --taxonomy-picker-list-max-height - {String} max height for options list. Default value is 380px.
* @cssprop --taxonomy-picker-placeholder-color - {Color} Text color for the placeholder in the picker
* @cssprop --taxonomy-picker-placeholder-hover-color - {Color} Text color for the placeholder in the picker on hover
*/
@customElement('taxonomy-picker')
export class MgtTaxonomyPicker extends MgtTemplatedComponent {
Expand Down
6 changes: 4 additions & 2 deletions packages/mgt-react/src/MgtTemplateProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* -------------------------------------------------------------------------------------------
*/

export interface MgtTemplateProps {
// Make type generic with a default of any to provide backwards compatibility and allow correct typing of the dataContext
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface MgtTemplateProps<T = any> {
template?: string;
dataContext?: unknown;
dataContext?: T;
}
5 changes: 1 addition & 4 deletions samples/react-contoso/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ BROWSER="none"
SKIP_PREFLIGHT_CHECK=true
FAST_REFRESH=false
REACT_APP_SITE_NAME="Contoso Dashboard"
REACT_APP_CLIENT_ID="00000000-0000-0000-0000-000000000000"
REACT_APP_URL_AZURE_FUNCTION="https://contoso.azurewebsites.net"
REACT_APP_BACKEND_CLIENT_ID="00000000-0000-0000-0000-000000000000"
REACT_APP_CLIENT_ID="ed072e38-e76e-45ae-ab76-073cb95495bb"
REACT_APP_BASE_DIR="/"

2 changes: 1 addition & 1 deletion samples/react-contoso/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "react-contoso",
"version": "1.3.0",
"private": true,
"homepage": ".",
"private": true,
"dependencies": {
"@fluentui/fluent2-theme": "^8.0.0",
"@fluentui/merge-styles": "^8.0.3",
Expand Down
4 changes: 0 additions & 4 deletions samples/react-contoso/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { App } from './App';
import { mergeStyles } from '@fluentui/react';
import { Msal2Provider } from '@microsoft/mgt-msal2-provider';
import { Providers, LoginType } from '@microsoft/mgt-element';
import { brokerSettings } from '@microsoft/mgt-chat';

// Inject some global styles
mergeStyles({
Expand All @@ -15,9 +14,6 @@ mergeStyles({
}
});

brokerSettings.functionHost = process.env.REACT_APP_URL_AZURE_FUNCTION!;
brokerSettings.appId = process.env.REACT_APP_BACKEND_CLIENT_ID!;

Providers.globalProvider = new Msal2Provider({
clientId: process.env.REACT_APP_CLIENT_ID!,
loginType: LoginType.Redirect,
Expand Down
4 changes: 3 additions & 1 deletion stories/components/person/person.templating.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const retemplateMetadata = () => html`
</template>
</mgt-person>
<mgt-person view="fourLines">
<br/>
<mgt-person person-query="me" view="fourLines">
<template data-type="line1">
<div>
Hello, my name is: {{person.displayName}}
Expand Down
Loading

0 comments on commit 9becafa

Please sign in to comment.