Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Search components integration #2582

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.md
**/dist
**/generated
**/lib
**/lib
tailwind-styles.module.ts
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"version": "0.2.0",
"configurations": [
{
"type": "edge",
"type": "msedge",
"request": "launch",
"name": "Launch Edge Canary against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"version": "canary"
},
{
"type": "edge",
"type": "msedge",
"request": "launch",
"name": "Launch Edge Dev against localhost",
"url": "http://localhost:3000",
Expand Down
47 changes: 44 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,20 @@
</head>

<body>
<mgt-msal2-provider
<!--<mgt-msal2-provider
client-id="2dfea037-938a-4ed8-9b35-c05708a1b241"
redirect-uri="http://localhost:3000"
scopes="user.read,user.read.all,mail.readBasic,people.read,people.read.all,sites.read.all,user.readbasic.all,contacts.read,presence.read,presence.read.all,tasks.readwrite,tasks.read,calendars.read,group.read.all,files.read,files.read.all,files.readwrite,files.readwrite.all"
></mgt-msal2-provider>
></mgt-msal2-provider>-->

<mgt-msal2-provider
client-id="3073e2a9-87cb-49f3-a69c-944e8a47c00d"
authority="https://login.microsoftonline.com/d7e957c6-c0d2-4ee3-88d5-bf5c0a56268b"
redirect-uri="http://localhost:3000"
login-type="popup"
scopes="ExternalItem.Read.All,Files.Read.All,Sites.Read.All"
>
</mgt-msal2-provider>

<!-- <mgt-mock-provider></mgt-mock-provider> -->
<header>
Expand Down Expand Up @@ -77,7 +86,39 @@ <h2>mgt-login</h2>
<!-- <h2>mgt-search-box</h2>
<mgt-search-box search-term="contoso"></mgt-search-box>
<h2>mgt-search-results</h2>
<mgt-search-results query-string="contoso"></mgt-search-results>
<mgt-search-results query-string="contoso"></mgt-search-results>-->

<mgt-login></mgt-login>

<mgt-search-verticals
id="0fa619a7-442a-4255-8fca-f3ce36a01518"
settings='[{"key":"all","tabName":{"default":"All","fr-fr":"Tout le contenu","ro-ro":"Toate"},"tabValue":"","isLink":false,"linkUrl":null,"openBehavior":0},{"key":"profiles","tabName":{"default":"Profiles","fr-fr":"Profils","ro-ro":"Profiluri"},"tabValue":"","isLink":false,"linkUrl":null,"openBehavior":0}]'
>
</mgt-search-verticals>

<mgt-search-filters
id="99d3e914-2c8e-4f42-897e-53bb4d960e94"
search-results-ids="b359f3dc-6b6a-4575-90ed-e5942bcbb8a6"
operator="and"
settings='[{"filterName":"modifiedby","displayName":{"fr-fr":"Modifié par","ro-ro":"Modificat de","default":"Modified by"},"template":"checkbox","showCount":true,"operator":"or","isMulti":true,"type":"refiner","sortBy":"byCount","sortDirection":"descending","maxBuckets":10000,"sortIdx":10},{"filterName":"FileType","displayName":{"fr-fr":"Type de fichier","ro-ro":"Tip fișier","default":"File Type"},"template":"checkbox","showCount":true,"operator":"or","isMulti":true,"type":"refiner","sortBy":"byCount","sortDirection":"descending","maxBuckets":10000,"sortIdx":11,"aggregations":[{"aggregationName":{"fr-fr":"Document Word","default":"Word document"},"matchingValues":["docx","doc","docm"],"aggregationValue":"or(\"docx\",\"doc\",\"docm\")","aggregationValueIconUrl":"/dist/latest/assets/icons/word.svg"},{"aggregationName":{"fr-fr":"Modèle de fichier Word","default":"Word template"},"matchingValues":["dot","dotx","dotm"],"aggregationValue":"or(\"dot\",\"dotx\",\"dotm\")","aggregationValueIconUrl":"/dist/latest/assets/icons/word.svg"},{"aggregationName":{"fr-fr":"Fichier texte","default":"Text file"},"matchingValues":["txt","rtf"],"aggregationValue":"or(\"txt\",\"rtf\")","aggregationValueIconUrl":"/dist/latest/assets/icons/text.svg"},{"aggregationName":{"fr-fr":"Document Excel","default":"Excel document"},"matchingValues":["xlsx","xls","xlsm","xlsb","xlx","xml","csv"],"aggregationValue":"or(\"xlsx\",\"xls\",\"xlsm\",\"csv\",\"xlsb\",\"xlx\",\"xml\")","aggregationValueIconUrl":"/dist/latest/assets/icons/excel.svg"},{"aggregationName":{"fr-fr":"Modèle de fichier Excel","default":"Excel template"},"matchingValues":["xltm","xlt","xltx"],"aggregationValue":"or(\"xltm\",\"xlt\",\"xltx\")","aggregationValueIconUrl":"/dist/latest/assets/icons/excel.svg"},{"aggregationName":{"fr-fr":"Document PowerPoint","default":"PowerPoint document"},"matchingValues":["pptx","ppt","pptm","pps","ppsm","ppsx"],"aggregationValue":"or(\"pptx\",\"ppt\",\"pptm\",\"pps\",\"ppsm\",\"ppsx\")","aggregationValueIconUrl":"/dist/latest/assets/icons/powerpoint.svg"},{"aggregationName":{"fr-fr":"Modèle de fichier PowerPoint","default":"PowerPoint template"},"matchingValues":["potx","potm","pot"],"aggregationValue":"or(\"potx\",\"potm\",\"pot\")","aggregationValueIconUrl":"/dist/latest/assets/icons/powerpoint.svg"},{"aggregationName":{"fr-fr":"Page web","default":"Web page"},"matchingValues":["aspx","html"],"aggregationValue":"or(\"aspx\",\"html\")","aggregationValueIconUrl":"/dist/latest/assets/icons/webpage.svg"},{"aggregationName":{"fr-fr":"Archive compressée","default":"Compressed archive"},"matchingValues":["zip","7z","rar"],"aggregationValue":"or(\"zip\",\"7z\",\"rar\")","aggregationValueIconUrl":"/dist/latest/assets/icons/archive.svg"},{"aggregationName":"PDF","matchingValues":["pdf"],"aggregationValue":"pdf","aggregationValueIconUrl":"/dist/latest/assets/icons/pdf.svg"},{"aggregationName":{"fr-fr":"Document Visio","default":"Visio document"},"matchingValues":["vsdx","vsd","vsdm"],"aggregationValue":"or(\"vsdx\",\"vsd\",\"vsdm\")","aggregationValueIconUrl":"/dist/latest/assets/icons/visio.svg"},{"aggregationName":{"fr-fr":"Document OneNote","default":"OneNote document"},"matchingValues":["one"],"aggregationValue":"one","aggregationValueIconUrl":"/dist/latest/assets/icons/onenote.svg"}]},{"filterName":"LastModifiedTime","displayName":{"fr-fr":"Date de modification","ro-ro":"Ora ultima modificată","default":"Last modified date"},"template":"date","showCount":true,"operator":"and","isMulti":false,"type":"refiner","sortBy":"byCount","sortDirection":"descending","maxBuckets":10000,"sortIdx":12}]'
>
</mgt-search-filters>

<mgt-search-results
id="b359f3dc-6b6a-4575-90ed-e5942bcbb8a6"
entity-types="listItem"
query-text="*"
query-template="{searchTerms} -ParentLink:PreservationHoldLibrary (FileType:doc OR FileType:docx OR FileType:docm OR FileType:dot OR FileType:dotx OR FileType:dotm OR FileType:txt OR FileType:rtf OR FileType:aspx OR FileType:xls OR FileType:xlsx OR FileType:xlsm OR FileType:xlsb OR FileType:xlx OR FileType:xlt OR FileType:xltx OR FileType:xltm OR FileType:xml OR FileType:csv OR FileType:ppt OR FileType:pptx OR FileType:pptm OR FileType:pps OR FileType:ppsm OR FileType:ppsx OR FileType:pot OR FileType:potx OR FileType:potm OR FileType:pdf OR FileType:zip OR FileType:vsd OR FileType:vsdx OR FileType:vsdm OR FileType:html OR FileType:7z OR FileType:rar OR FileType:one)"
fields="name,title,mssearchsitename,created,createdBy,filetype,lastModifiedTime,modifiedBy,path,hitHighlightedProperties,hitHighlightedSummary,SPSiteURL,SiteTitle,defaultEncodingURL,parentLink,serverRedirectedURL,filename,MSSearchSource,MSSearchSiteName,MSSearchSiteUrl,MSSearchFileType,MSSearchLastModifiedTime"
enable-suggestion
sort-properties='[{"sortField":"LastModifiedTime","sortDirection":"desc","isDefaultSort":false,"isUserSort":true,"sortFieldDisplayName":{"fr-fr":"Date de modification","default":"Last modified"}}]'
page-size="10"
pages-number="4"
search-filters-id="99d3e914-2c8e-4f42-897e-53bb4d960e94"
search-verticals-id="0fa619a7-442a-4255-8fca-f3ce36a01518"
verticals-keys="all"
>
</mgt-search-results>
</main>
</body>
</html>
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
"storybook:build": "npm run storybook:bundle && npm run storybook:dev && build-storybook -s assets && cpx .storybook/CNAME storybook-static && node ./.storybook/fix-title.js 'Microsoft Graph Toolkit Playground' ../",
"setLicense": "gulp setLicense",
"test": "jest",
"version:tsc": "tsc -v"
"version:tsc": "tsc -v",
"wtr": "wtr",
"wtr:watch": "wtr --watch"
},
"devDependencies": {
"@babel/core": "^7.12.8",
Expand All @@ -79,6 +81,7 @@
"@custom-elements-manifest/analyzer": "^0.8.3",
"@microsoft/eslint-config-msgraph": "^1.0.0",
"@octokit/rest": "^18.5.3",
"@open-wc/testing": "^3.2.0",
"@open-wc/testing-helpers": "^2.3.0",
"@storybook/addon-a11y": "^6.4.4",
"@storybook/addon-actions": "^6.4.4",
Expand All @@ -98,10 +101,15 @@
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@web/dev-server": "^0.1.10",
"@web/dev-server-esbuild": "0.3.3",
"@web/test-runner": "0.15.0",
"@web/test-runner-playwright": "0.9.0",
"@webcomponents/webcomponentsjs": "^2.5.0",
"autoprefixer": "10.4.13",
"babel-loader": "^8.2.1",
"core-js": "^3.31.0",
"cpx": "^1.5.0",
"cssnano": "6.0.1",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jsdoc": "^46.4.0",
Expand All @@ -128,6 +136,8 @@
"node-sass": "npm:sass@^1.44.0",
"npm-run-all": "^4.1.5",
"office-ui-fabric-core": "^11.0.0",
"postcss": "^8.4.19",
"postcss-lit": "1.0.1",
"prettier": "2.8.8",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand All @@ -143,11 +153,13 @@
"rollup-plugin-typescript": "^1.0.1",
"sass": "^1.29.0",
"shx": "^0.3.3",
"sinon": "15.0.1",
"storybook-addon-web-components-knobs": "^0.3.20",
"storybook-version": "^0.1.1",
"stylelint": "^15.6.1",
"stylelint-config-prettier-scss": "^0.0.1",
"stylelint-config-standard-scss": "^9.0.0",
"tailwindcss": "3.2.4",
"testing-library__dom": "^7.29.4-beta.1",
"ts-jest": "^29.1.0",
"typescript": "^5.1.5",
Expand All @@ -156,7 +168,7 @@
},
"husky": {
"hooks": {
"pre-commit": "npm run prettier:check && npm run lint"
"pre-commit": "npm run prettier:check"
}
},
"resolutions": {
Expand Down
6 changes: 6 additions & 0 deletions packages/mgt-components/src/components/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import './mgt-messages/mgt-messages';
import './mgt-organization/mgt-organization';
import './mgt-profile/mgt-profile';
import './mgt-theme-toggle/mgt-theme-toggle';
import './preview/mgt-search-results/mgt-search-results';
import './preview/mgt-search-verticals/mgt-search-verticals';
import './preview/mgt-search-filters/mgt-search-filters';

export * from './mgt-agenda/mgt-agenda';
export * from './mgt-file/mgt-file';
Expand All @@ -47,3 +50,6 @@ export * from './mgt-messages/mgt-messages';
export * from './mgt-organization/mgt-organization';
export * from './mgt-profile/mgt-profile';
export * from './mgt-theme-toggle/mgt-theme-toggle';
export * from './preview/mgt-search-results/mgt-search-results';
export * from './preview/mgt-search-verticals/mgt-search-verticals';
export * from './preview/mgt-search-filters/mgt-search-filters';
3 changes: 3 additions & 0 deletions packages/mgt-components/src/components/preview/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export * from './mgt-search-box/mgt-search-box';
export * from './mgt-search-results/mgt-search-results';
export * from './mgt-search-filters/mgt-search-filters';
export * from './mgt-search-verticals/mgt-search-verticals';
export { IMicrosoftSearchQuery, IMicrosoftSearchService } from '@microsoft/mgt-element';
Loading