Skip to content

Commit 44ed5bd

Browse files
sample: Adding the hero app with current version of MGT (#2525)
Adds react-contoso sample app Removes the previous admin-app Fixed to supported features Adding workspace + spinner Adding the DirectReports GET component Adding the taxonomy explorer Updated docs and scss to be taxonomy-picker specific --------- Co-authored-by: Gavin Barron <[email protected]>
1 parent da8b7e3 commit 44ed5bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2617
-739
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/*",
44
"packages/providers/*",
5-
"samples/react-admin-app",
5+
"samples/react-contoso",
66
"samples/react-app",
77
"samples/angular-app",
88
"samples/vue-app",

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"packages": [
77
"packages/*",
88
"packages/providers/*",
9-
"samples/react-admin-app",
9+
"samples/react-contoso",
1010
"samples/react-app",
1111
"samples/angular-app",
1212
"samples/vue-app",
@@ -34,6 +34,7 @@
3434
"build:mgt-spfx": "lerna run build --scope @microsoft/mgt-spfx",
3535
"build:sp-webpart": "lerna run build --scope mgt-demo",
3636
"build:sp-mgt": "lerna run build --scope sp-mgt-no-framework",
37+
"build:react-contoso": "lerna run build --scope react-contoso",
3738
"package:sp-webpart": "lerna run package --scope mgt-demo",
3839
"package:sp-mgt": "lerna run package --scope sp-mgt-no-framework",
3940
"bundle": "cd ./packages/mgt && npm run bundle",
@@ -53,8 +54,8 @@
5354
"watch:serve": "npm-run-all --parallel watch serve",
5455
"watch:serve:https": "npm-run-all -parallel watch serve:https",
5556
"watch:components": "lerna run --parallel build:watch --scope @microsoft/mgt-components --include-dependents",
56-
"watch:react-admin-app": "lerna run start --scope react-admin-app",
57-
"watch:react": "npm-run-all --parallel watch:components watch:react-admin-app",
57+
"watch:react-contoso": "lerna run start --scope react-contoso",
58+
"watch:react": "npm-run-all --parallel watch:components watch:react-contoso",
5859
"prettier:base": "prettier --parser typescript",
5960
"prettier:check": "npm run prettier:base -- --check \"packages/**/*.{ts,tsx}\"",
6061
"prettier:write": "npm run prettier:base -- --write \"packages/**/*.{ts,tsx}\"",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* -------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4+
* See License in the project root for license information.
5+
* -------------------------------------------------------------------------------------------
6+
*/
7+
8+
@import '../../../../../node_modules/office-ui-fabric-core/dist/sass/References';
9+
@import '../../styles/shared-styles';
10+
@import './mgt-taxonomy-picker.theme';
11+
12+
:host {
13+
--max-height: var(--taxonomy-picker-max-height, 380px);
14+
15+
font-family: $font-family;
16+
17+
.picker {
18+
background-color: $taxonomy-picker-background-color;
19+
}
20+
}
21+
22+
[dir='rtl'] {
23+
.picker {
24+
direction: rtl;
25+
}
26+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* -------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4+
* See License in the project root for license information.
5+
* -------------------------------------------------------------------------------------------
6+
*/
7+
8+
@import '../../styles/shared-sass-variables';
9+
10+
$taxonomy-picker-background-color: var(--taxonomy-picker-background-color, transparent);

packages/mgt-components/src/components/mgt-taxonomy-picker/mgt-taxonomy-picker.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { strings } from './strings';
1414
import { fluentCombobox, fluentOption } from '@fluentui/web-components';
1515
import { registerFluentComponents } from '../../utils/FluentComponents';
1616
import '../../styles/style-helper';
17+
import { styles } from './mgt-taxonomy-picker-css';
1718
import { DataChangedDetail } from '../mgt-get/mgt-get';
1819

1920
registerFluentComponents(fluentCombobox, fluentOption);
@@ -29,6 +30,9 @@ registerFluentComponents(fluentCombobox, fluentOption);
2930
* @export
3031
* @class MgtTaxonomyPicker
3132
* @extends {MgtTemplatedComponent}
33+
*
34+
* @cssprop --taxonomy-picker-background-color - {Color} Picker component background color
35+
* @cssprop --taxonomy-picker-list-max-height - {String} max height for options list. Default value is 380px.
3236
*/
3337
@customElement('taxonomy-picker')
3438
export class MgtTaxonomyPicker extends MgtTemplatedComponent {
@@ -43,6 +47,10 @@ export class MgtTaxonomyPicker extends MgtTemplatedComponent {
4347
return strings;
4448
}
4549

50+
public static get styles() {
51+
return styles;
52+
}
53+
4654
/**
4755
* The termsetId of the term set whose children to get.
4856
*

packages/mgt-react/scripts/generate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const gaTags = new Set([
2121
'taxonomy-picker',
2222
'theme-toggle',
2323
'search-box',
24-
'search-results'
24+
'search-results',
25+
'spinner'
2526
]);
2627
const outputFileName = 'react';
2728

packages/mgt-react/src/generated/react.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ export type SearchResultsProps = {
237237
templateRendered?: (e: CustomEvent<TemplateRenderedData>) => void;
238238
}
239239

240+
export type SpinnerProps = {
241+
mediaQuery?: ComponentMediaQuery;
242+
}
243+
240244
export type TasksProps = {
241245
res?: TasksStringResource;
242246
isNewTaskVisible?: boolean;
@@ -328,6 +332,8 @@ export const SearchBox = wrapMgt<SearchBoxProps>('search-box');
328332

329333
export const SearchResults = wrapMgt<SearchResultsProps>('search-results');
330334

335+
export const Spinner = wrapMgt<SpinnerProps>('spinner');
336+
331337
export const Tasks = wrapMgt<TasksProps>('tasks');
332338

333339
export const TaxonomyPicker = wrapMgt<TaxonomyPickerProps>('taxonomy-picker');

samples/react-admin-app/.env.sample

Lines changed: 0 additions & 3 deletions
This file was deleted.
-30.5 KB
Binary file not shown.

samples/react-admin-app/src/App.css

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)