Skip to content

Commit 87e6c2f

Browse files
sebastienlevertgavinbarronmusale
authored
feat: Support for new component mgt-search-results (#2047)
* Adding the basic mgt-search capabilities * Theming, templates and paging * Updating index.html * Added support for query templates and presence * Support for Storybook auth with MGT * Styling * Support for params + custom client * Adding AdaptiveCards but with issues around CJS * fixing rollup issues * Adding basic adaptive cards support * Relying on blank.html vs. storybook for auth * Adding ref to blank * Adding the auth page as env * Search Results update * Updates to use central App ID * Fixing errors with interleaving * Fixing auth within stories * Back with theming + deleted signInAddon * Added the search box component * Debounce in mgt-search-box * Adding test project and workspace edits * Added new scenarios, icons and strings * Strings for Localization * Adding support for ExternalItem * Adding batching for thumbnails * Cleaning code * Added stories per props * Error and tooltip fixes * Pushed renderError to templatedComponent * Adding fluent-divider * Removing separaror CSS * Fixed stories and improved default render * Max page size as const * Updated icons and support for event * Support for dark mode * Updarted for QnA and Acronyms * Adding scenario for chat * Accessibility updates * Removing AC packages * Missing colors for next/prev buttons * Accessibility Updates * Applied suggestions Co-authored-by: Musale Martin <[email protected]> * Updated with comments * Applying suggestions * Fixing comments from PR * Updating picker with inherited error * Linting edits * Prettier fixes * Fixing infinite loop * PR Comments Updates * updating lock files --------- Co-authored-by: Gavin Barron <[email protected]> Co-authored-by: Musale Martin <[email protected]>
1 parent c7bf047 commit 87e6c2f

Some content is hidden

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

69 files changed

+6334
-170
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ package-lock.json
4343
# storybook
4444
storybook-static/
4545
custom-elements.json
46+
workbench.html

index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ <h2>mgt-todo</h2>
9191
<h2>mgt-file-list</h2>
9292
<mgt-file-list></mgt-file-list>
9393
<h2>mgt-picker</h2>
94+
<mgt-picker resource="me/todo/lists" scopes="tasks.read, tasks.readwrite"></mgt-picker>
95+
<h2>mgt-search-box</h2>
96+
<mgt-search-box search-term="contoso"></mgt-search-box>
97+
<h2>mgt-search-results</h2>
98+
<mgt-search-results query-string="contoso"></mgt-search-results>
9499
<mgt-picker resource="me/todo/lists" scopes="tasks.read, tasks.readwrite"></mgt-picker> -->
95100
</main>
96101
</body>

lerna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"packages": [
33
"packages/*",
44
"packages/providers/*",
5+
"samples/react-admin-app",
56
"samples/react-app",
67
"samples/angular-app",
78
"samples/vue-app",

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"packages": [
77
"packages/*",
88
"packages/providers/*",
9+
"samples/react-admin-app",
910
"samples/react-app",
1011
"samples/angular-app",
1112
"samples/vue-app",
@@ -22,6 +23,7 @@
2223
]
2324
},
2425
"scripts": {
26+
"init": "yarn && yarn build",
2527
"analyze": "custom-elements-manifest analyze --litelement --globs \"./packages/*/src/**/*.ts\"",
2628
"build": "npm run prettier:check && npm run clean && lerna run build --scope @microsoft/*",
2729
"build:compile": "npm run prettier:check && npm run clean && lerna run build:compile --scope @microsoft/*",
@@ -50,6 +52,9 @@
5052
"watch": "lerna run --parallel --stream --scope @microsoft/* build:watch ",
5153
"watch:serve": "npm-run-all --parallel watch serve",
5254
"watch:serve:https": "npm-run-all -parallel watch serve:https",
55+
"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",
5358
"prettier:base": "prettier --parser typescript",
5459
"prettier:check": "npm run prettier:base -- --check \"packages/**/*.{ts,tsx}\"",
5560
"prettier:write": "npm run prettier:base -- --write \"packages/**/*.{ts,tsx}\"",

packages/mgt-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@microsoft/mgt-element": "*",
4040
"@microsoft/microsoft-graph-client": "^3.0.0",
4141
"@microsoft/microsoft-graph-types": "^2.0.0",
42-
"@microsoft/microsoft-graph-types-beta": "^0.16.0-preview",
42+
"@microsoft/microsoft-graph-types-beta": "^0.29.0-preview",
4343
"@fluentui/web-components": "^2.5.12",
4444
"office-ui-fabric-core": "^11.0.0"
4545
},
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { CacheItem } from '@microsoft/mgt-element';
2+
3+
/**
4+
* Object to be stored in cache representing a generic query
5+
*/
6+
export interface CacheResponse extends CacheItem {
7+
/**
8+
* json representing a response as string
9+
*/
10+
response?: string;
11+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import './mgt-file/mgt-file';
1010
import './mgt-file-list/mgt-file-list';
1111
import './mgt-picker/mgt-picker';
1212
import './mgt-get/mgt-get';
13+
import './mgt-search-box/mgt-search-box';
14+
import './mgt-search-results/mgt-search-results';
1315
import './mgt-login/mgt-login';
1416
import './mgt-people-picker/mgt-people-picker';
1517
import './mgt-people/mgt-people';
@@ -30,6 +32,8 @@ export * from './mgt-file/mgt-file';
3032
export * from './mgt-file-list/mgt-file-list';
3133
export * from './mgt-picker/mgt-picker';
3234
export * from './mgt-get/mgt-get';
35+
export * from './mgt-search-box/mgt-search-box';
36+
export * from './mgt-search-results/mgt-search-results';
3337
export * from './mgt-login/mgt-login';
3438
export * from './mgt-people-picker/mgt-people-picker';
3539
export * from './mgt-people/mgt-people';

packages/mgt-components/src/components/mgt-file/mgt-file.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ export class MgtFile extends MgtTemplatedComponent {
494494
this.driveItem.package === undefined && this.driveItem.folder === undefined
495495
? re.exec(this.driveItem.name)[1]
496496
? re.exec(this.driveItem.name)[1].toLowerCase()
497-
: 'null'
497+
: this.driveItem.size
498+
? 'null'
499+
: 'folder'
498500
: this.driveItem.package !== undefined
499501
? this.driveItem.package.type === 'oneNote'
500502
? 'onetoc'

packages/mgt-components/src/components/mgt-get/mgt-get.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import { getPhotoForResource } from '../../graph/graph.photos';
2424
import { getDocumentThumbnail } from '../../graph/graph.files';
2525
import { schemas } from '../../graph/cacheStores';
26+
import { CacheResponse } from '../CacheResponse';
2627
import { Entity } from '@microsoft/microsoft-graph-types';
2728

2829
/**
@@ -65,16 +66,6 @@ export enum ResponseType {
6566
image = 'image'
6667
}
6768

68-
/**
69-
* Object to be stored in cache representing a generic query
70-
*/
71-
interface CacheResponse extends CacheItem {
72-
/**
73-
* json representing a response as string
74-
*/
75-
response?: string;
76-
}
77-
7869
/**
7970
* Defines the expiration time
8071
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export class MgtPicker extends MgtTemplatedComponent {
150150
private isRefreshing: boolean;
151151

152152
@state() private response: Entity[];
153-
@state() private error: object;
154153

155154
constructor() {
156155
super();

0 commit comments

Comments
 (0)