Added Teams Virtual Events
This commit is contained in:
parent
9fc30c5e7a
commit
9088b11c5d
|
@ -0,0 +1,352 @@
|
|||
require('@rushstack/eslint-config/patch/modern-module-resolution');
|
||||
module.exports = {
|
||||
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
|
||||
parserOptions: { tsconfigRootDir: __dirname },
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
'parserOptions': {
|
||||
'project': './tsconfig.json',
|
||||
'ecmaVersion': 2018,
|
||||
'sourceType': 'module'
|
||||
},
|
||||
rules: {
|
||||
// Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin
|
||||
'@rushstack/no-new-null': 1,
|
||||
// Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin
|
||||
'@rushstack/hoist-jest-mock': 1,
|
||||
// Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security
|
||||
'@rushstack/security/no-unsafe-regexp': 1,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/adjacent-overload-signatures': 1,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
//
|
||||
// CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol
|
||||
'@typescript-eslint/ban-types': [
|
||||
1,
|
||||
{
|
||||
'extendDefaults': false,
|
||||
'types': {
|
||||
'String': {
|
||||
'message': 'Use \'string\' instead',
|
||||
'fixWith': 'string'
|
||||
},
|
||||
'Boolean': {
|
||||
'message': 'Use \'boolean\' instead',
|
||||
'fixWith': 'boolean'
|
||||
},
|
||||
'Number': {
|
||||
'message': 'Use \'number\' instead',
|
||||
'fixWith': 'number'
|
||||
},
|
||||
'Object': {
|
||||
'message': 'Use \'object\' instead, or else define a proper TypeScript type:'
|
||||
},
|
||||
'Symbol': {
|
||||
'message': 'Use \'symbol\' instead',
|
||||
'fixWith': 'symbol'
|
||||
},
|
||||
'Function': {
|
||||
'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
// RATIONALE: Code is more readable when the type of every variable is immediately obvious.
|
||||
// Even if the compiler may be able to infer a type, this inference will be unavailable
|
||||
// to a person who is reviewing a GitHub diff. This rule makes writing code harder,
|
||||
// but writing code is a much less important activity than reading it.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/explicit-function-return-type': [
|
||||
1,
|
||||
{
|
||||
'allowExpressions': true,
|
||||
'allowTypedFunctionExpressions': true,
|
||||
'allowHigherOrderFunctions': false
|
||||
}
|
||||
],
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
// Rationale to disable: although this is a recommended rule, it is up to dev to select coding style.
|
||||
// Set to 1 (warning) or 2 (error) to enable.
|
||||
'@typescript-eslint/explicit-member-accessibility': 0,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/no-array-constructor': 1,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
//
|
||||
// RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript.
|
||||
// This rule should be suppressed only in very special cases such as JSON.stringify()
|
||||
// where the type really can be anything. Even if the type is flexible, another type
|
||||
// may be more appropriate such as "unknown", "{}", or "Record<k,V>".
|
||||
'@typescript-eslint/no-explicit-any': 1,
|
||||
// RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch()
|
||||
// handler. Thus wherever a Promise arises, the code must either append a catch handler,
|
||||
// or else return the object to a caller (who assumes this responsibility). Unterminated
|
||||
// promise chains are a serious issue. Besides causing errors to be silently ignored,
|
||||
// they can also cause a NodeJS process to terminate unexpectedly.
|
||||
'@typescript-eslint/no-floating-promises': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'@typescript-eslint/no-for-in-array': 2,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/no-misused-new': 2,
|
||||
// RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks
|
||||
// a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler
|
||||
// optimizations. If you are declaring loose functions/variables, it's better to make them
|
||||
// static members of a class, since classes support property getters and their private
|
||||
// members are accessible by unit tests. Also, the exercise of choosing a meaningful
|
||||
// class name tends to produce more discoverable APIs: for example, search+replacing
|
||||
// the function "reverse()" is likely to return many false matches, whereas if we always
|
||||
// write "Text.reverse()" is more unique. For large scale organization, it's recommended
|
||||
// to decompose your code into separate NPM packages, which ensures that component
|
||||
// dependencies are tracked more conscientiously.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/no-namespace': [
|
||||
1,
|
||||
{
|
||||
'allowDeclarations': false,
|
||||
'allowDefinitionFiles': false
|
||||
}
|
||||
],
|
||||
// RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)"
|
||||
// that avoids the effort of declaring "title" as a field. This TypeScript feature makes
|
||||
// code easier to write, but arguably sacrifices readability: In the notes for
|
||||
// "@typescript-eslint/member-ordering" we pointed out that fields are central to
|
||||
// a class's design, so we wouldn't want to bury them in a constructor signature
|
||||
// just to save some typing.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
// Set to 1 (warning) or 2 (error) to enable the rule
|
||||
'@typescript-eslint/parameter-properties': 0,
|
||||
// RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code
|
||||
// may impact performance.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
1,
|
||||
{
|
||||
'vars': 'all',
|
||||
// Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code,
|
||||
// the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures
|
||||
// that are overriding a base class method or implementing an interface.
|
||||
'args': 'none'
|
||||
}
|
||||
],
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/no-use-before-define': [
|
||||
2,
|
||||
{
|
||||
'functions': false,
|
||||
'classes': true,
|
||||
'variables': true,
|
||||
'enums': true,
|
||||
'typedefs': true
|
||||
}
|
||||
],
|
||||
// Disallows require statements except in import statements.
|
||||
// In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports.
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
// RATIONALE: The "module" keyword is deprecated except when describing legacy libraries.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'@typescript-eslint/prefer-namespace-keyword': 1,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
// Rationale to disable: it's up to developer to decide if he wants to add type annotations
|
||||
// Set to 1 (warning) or 2 (error) to enable the rule
|
||||
'@typescript-eslint/no-inferrable-types': 0,
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
// Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios
|
||||
'@typescript-eslint/no-empty-interface': 0,
|
||||
// RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake.
|
||||
'accessor-pairs': 1,
|
||||
// RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking.
|
||||
'dot-notation': [
|
||||
1,
|
||||
{
|
||||
'allowPattern': '^_'
|
||||
}
|
||||
],
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
'eqeqeq': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'for-direction': 1,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'guard-for-in': 2,
|
||||
// RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time
|
||||
// to split up your code.
|
||||
'max-lines': ['warn', { max: 2000 }],
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-async-promise-executor': 2,
|
||||
// RATIONALE: Deprecated language feature.
|
||||
'no-caller': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-compare-neg-zero': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-cond-assign': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-constant-condition': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-control-regex': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-debugger': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-delete-var': 2,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-duplicate-case': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-empty': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-empty-character-class': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-empty-pattern': 1,
|
||||
// RATIONALE: Eval is a security concern and a performance concern.
|
||||
'no-eval': 1,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-ex-assign': 2,
|
||||
// RATIONALE: System types are global and should not be tampered with in a scalable code base.
|
||||
// If two different libraries (or two versions of the same library) both try to modify
|
||||
// a type, only one of them can win. Polyfills are acceptable because they implement
|
||||
// a standardized interoperable contract, but polyfills are generally coded in plain
|
||||
// JavaScript.
|
||||
'no-extend-native': 1,
|
||||
// Disallow unnecessary labels
|
||||
'no-extra-label': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-fallthrough': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-func-assign': 1,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-implied-eval': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-invalid-regexp': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-label-var': 2,
|
||||
// RATIONALE: Eliminates redundant code.
|
||||
'no-lone-blocks': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-misleading-character-class': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-multi-str': 2,
|
||||
// RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to
|
||||
// a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()",
|
||||
// or else implies that the constructor is doing nontrivial computations, which is often
|
||||
// a poor class design.
|
||||
'no-new': 1,
|
||||
// RATIONALE: Obsolete language feature that is deprecated.
|
||||
'no-new-func': 2,
|
||||
// RATIONALE: Obsolete language feature that is deprecated.
|
||||
'no-new-object': 2,
|
||||
// RATIONALE: Obsolete notation.
|
||||
'no-new-wrappers': 1,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-octal': 2,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
'no-octal-escape': 2,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-regex-spaces': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-return-assign': 2,
|
||||
// RATIONALE: Security risk.
|
||||
'no-script-url': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-self-assign': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-self-compare': 2,
|
||||
// RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use
|
||||
// commas to create compound expressions. In general code is more readable if each
|
||||
// step is split onto a separate line. This also makes it easier to set breakpoints
|
||||
// in the debugger.
|
||||
'no-sequences': 1,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-shadow-restricted-names': 2,
|
||||
// RATIONALE: Obsolete language feature that is deprecated.
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-sparse-arrays': 2,
|
||||
// RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception,
|
||||
// such flexibility adds pointless complexity, by requiring every catch block to test
|
||||
// the type of the object that it receives. Whereas if catch blocks can always assume
|
||||
// that their object implements the "Error" contract, then the code is simpler, and
|
||||
// we generally get useful additional information like a call stack.
|
||||
'no-throw-literal': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-unmodified-loop-condition': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-unsafe-finally': 2,
|
||||
// RATIONALE: Catches a common coding mistake.
|
||||
'no-unused-expressions': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-unused-labels': 1,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-useless-catch': 1,
|
||||
// RATIONALE: Avoids a potential performance problem.
|
||||
'no-useless-concat': 1,
|
||||
// RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior.
|
||||
// Always use "let" or "const" instead.
|
||||
//
|
||||
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
|
||||
'no-var': 2,
|
||||
// RATIONALE: Generally not needed in modern code.
|
||||
'no-void': 1,
|
||||
// RATIONALE: Obsolete language feature that is deprecated.
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'no-with': 2,
|
||||
// RATIONALE: Makes logic easier to understand, since constants always have a known value
|
||||
// @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js
|
||||
'prefer-const': 1,
|
||||
// RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused.
|
||||
'promise/param-names': 2,
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'require-atomic-updates': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'require-yield': 1,
|
||||
// "Use strict" is redundant when using the TypeScript compiler.
|
||||
'strict': [
|
||||
2,
|
||||
'never'
|
||||
],
|
||||
// RATIONALE: Catches code that is likely to be incorrect
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
'use-isnan': 2,
|
||||
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
|
||||
// Set to 1 (warning) or 2 (error) to enable.
|
||||
// Rationale to disable: !!{}
|
||||
'no-extra-boolean-cast': 0,
|
||||
// ====================================================================
|
||||
// @microsoft/eslint-plugin-spfx
|
||||
// ====================================================================
|
||||
'@microsoft/spfx/import-requires-chunk-name': 1,
|
||||
'@microsoft/spfx/no-require-ensure': 2,
|
||||
'@microsoft/spfx/pair-react-dom-render-unmount': 1
|
||||
}
|
||||
},
|
||||
{
|
||||
// For unit tests, we can be a little bit less strict. The settings below revise the
|
||||
// defaults specified in the extended configurations, as well as above.
|
||||
files: [
|
||||
// Test files
|
||||
'*.test.ts',
|
||||
'*.test.tsx',
|
||||
'*.spec.ts',
|
||||
'*.spec.tsx',
|
||||
|
||||
// Facebook convention
|
||||
'**/__mocks__/*.ts',
|
||||
'**/__mocks__/*.tsx',
|
||||
'**/__tests__/*.ts',
|
||||
'**/__tests__/*.tsx',
|
||||
|
||||
// Microsoft convention
|
||||
'**/test/*.ts',
|
||||
'**/test/*.tsx'
|
||||
],
|
||||
rules: {}
|
||||
}
|
||||
]
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
|
||||
# Build generated files
|
||||
dist
|
||||
lib
|
||||
release
|
||||
solution
|
||||
temp
|
||||
*.sppkg
|
||||
.heft
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
|
||||
# Visual Studio files
|
||||
.ntvs_analysis.dat
|
||||
.vs
|
||||
bin
|
||||
obj
|
||||
|
||||
# Resx Generated Code
|
||||
*.resx.ts
|
||||
|
||||
# Styles Generated Code
|
||||
*.scss.ts
|
||||
package-lock.json
|
|
@ -0,0 +1,16 @@
|
|||
!dist
|
||||
config
|
||||
|
||||
gulpfile.js
|
||||
|
||||
release
|
||||
src
|
||||
temp
|
||||
|
||||
tsconfig.json
|
||||
tslint.json
|
||||
|
||||
*.log
|
||||
|
||||
.yo-rc.json
|
||||
.vscode
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"plusBeta": false,
|
||||
"isCreatingSolution": true,
|
||||
"nodeVersion": "18.18.2",
|
||||
"sdksVersions": {
|
||||
"@microsoft/microsoft-graph-client": "3.0.2",
|
||||
"@microsoft/teams-js": "2.12.0"
|
||||
},
|
||||
"version": "1.18.1",
|
||||
"libraryName": "teams-virtual-events",
|
||||
"libraryId": "38997de3-1140-4a1b-b50d-fe43cd8c1404",
|
||||
"environment": "spo",
|
||||
"packageManager": "npm",
|
||||
"solutionName": "Teams Virtual Events",
|
||||
"solutionShortDescription": "Teams Virtual Events description",
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false,
|
||||
"componentType": "webpart"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
# teams-virtual-events
|
||||
|
||||
## Summary
|
||||
|
||||
Short summary on functionality and used technologies.
|
||||
|
||||
[picture of the solution in action, if possible]
|
||||
|
||||
## Used SharePoint Framework Version
|
||||
|
||||
![version](https://img.shields.io/badge/version-1.18.0-green.svg)
|
||||
|
||||
## Applies to
|
||||
|
||||
- [SharePoint Framework](https://aka.ms/spfx)
|
||||
- [Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
|
||||
|
||||
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
> Any special pre-requisites?
|
||||
|
||||
## Solution
|
||||
|
||||
| Solution | Author(s) |
|
||||
| ----------- | ------------------------------------------------------- |
|
||||
| folder name | Author details (name, company, twitter alias with link) |
|
||||
|
||||
## Version history
|
||||
|
||||
| Version | Date | Comments |
|
||||
| ------- | ---------------- | --------------- |
|
||||
| 1.1 | March 10, 2021 | Update comment |
|
||||
| 1.0 | January 29, 2021 | Initial release |
|
||||
|
||||
## Disclaimer
|
||||
|
||||
**THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||
|
||||
---
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
- Clone this repository
|
||||
- Ensure that you are at the solution folder
|
||||
- in the command-line run:
|
||||
- **npm install**
|
||||
- **gulp serve**
|
||||
|
||||
> Include any additional steps as needed.
|
||||
|
||||
## Features
|
||||
|
||||
Description of the extension that expands upon high-level summary above.
|
||||
|
||||
This extension illustrates the following concepts:
|
||||
|
||||
- topic 1
|
||||
- topic 2
|
||||
- topic 3
|
||||
|
||||
> Notice that better pictures and documentation will increase the sample usage and the value you are providing for others. Thanks for your submissions advance.
|
||||
|
||||
> Share your web part with others through Microsoft 365 Patterns and Practices program to get visibility and exposure. More details on the community, open-source projects and other activities from http://aka.ms/m365pnp.
|
||||
|
||||
## References
|
||||
|
||||
- [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
|
||||
- [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
|
||||
- [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
|
||||
- [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
|
||||
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
|
||||
"version": "2.0",
|
||||
"bundles": {
|
||||
"my-teams-virual-events-web-part": {
|
||||
"components": [
|
||||
{
|
||||
"entrypoint": "./lib/webparts/myTeamsVirtualEvents/MyTeamsVirtualEventsWebPart.js",
|
||||
"manifest": "./src/webparts/myTeamsVirtualEvents/MyTeamsVirtualEventsWebPart.manifest.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"externals": {},
|
||||
"localizedResources": {
|
||||
"MyTeamsVirtualEventsWebPartStrings": "lib/webparts/myTeamsVirtualEvents/loc/{locale}.js",
|
||||
"ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
|
||||
"workingDir": "./release/assets/",
|
||||
"account": "<!-- STORAGE ACCOUNT NAME -->",
|
||||
"container": "teams-virtual-events",
|
||||
"accessKey": "<!-- ACCESS KEY -->"
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
|
||||
"solution": {
|
||||
"name": "Teams Webinars Virtual Events",
|
||||
"id": "633573bf-ea82-4607-a64c-ff68856efe2c",
|
||||
"title": "Teams Webinars Virtual Events",
|
||||
"version": "1.0.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false,
|
||||
"webApiPermissionRequests": [
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "VirtualEvent.Read"
|
||||
},
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "Team.ReadBasic.All"
|
||||
},
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "Sites.ReadWrite.All"
|
||||
},
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "OnlineMeetings.ReadWrite"
|
||||
},
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "GroupMember.Read.All"
|
||||
}
|
||||
],
|
||||
"developer": {
|
||||
"name": "Nick Brown",
|
||||
"websiteUrl": "https://nbdev.uk",
|
||||
"privacyUrl": "",
|
||||
"termsOfUseUrl": "",
|
||||
"mpnId": "Undefined-1.18.2"
|
||||
},
|
||||
"metadata": {
|
||||
"shortDescription": {
|
||||
"default": "Teams Webinars Virtual Events description"
|
||||
},
|
||||
"longDescription": {
|
||||
"default": "Displays a list of your up coming Webinars, allows you to auto approve registrants based on an Entra group or sync them to a SharePoint list"
|
||||
},
|
||||
"screenshotPaths": [],
|
||||
"videoUrl": "",
|
||||
"categories": []
|
||||
},
|
||||
"features": [
|
||||
{
|
||||
"title": "List My Teams Webinars",
|
||||
"description": "Displays a list of Webinars you have organized or are organizing",
|
||||
"id": "acfa9985-28d2-42ab-bf26-d0afc29cb6d3",
|
||||
"version": "1.0.0.0"
|
||||
},
|
||||
{
|
||||
"title": "Sync Webinars to a SharePoint List",
|
||||
"description": "Based on selected webinars Sync those into a SharePoint list for showing in a Team",
|
||||
"id": "26e47f10-6862-4af8-9ef3-8c557b4c871f",
|
||||
"version": "1.0.0.0"
|
||||
},
|
||||
{
|
||||
"title": "Approve pending registrants based on group membership",
|
||||
"description": "Go though pending registrants and approve them based on an Entra Group membership",
|
||||
"id": "6714ae2f-9d6a-429d-a23d-fc4ee575fef6",
|
||||
"version": "1.0.0.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/teams-virtual-events.sppkg"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
|
||||
"port": 4321,
|
||||
"https": true,
|
||||
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
|
||||
"cdnBasePath": "<!-- PATH TO CDN -->"
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
const build = require('@microsoft/sp-build-web');
|
||||
|
||||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
|
||||
|
||||
var getTasks = build.rig.getTasks;
|
||||
build.rig.getTasks = function () {
|
||||
var result = getTasks.call(build.rig);
|
||||
|
||||
result.set('serve', result.get('serve-deprecated'));
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
build.initialize(require('gulp'));
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "teams-virtual-events",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "gulp bundle",
|
||||
"clean": "gulp clean",
|
||||
"test": "gulp test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fluentui/react": "^8.112.9",
|
||||
"@fluentui/react-components": "^9.42.0",
|
||||
"@fluentui/react-migration-v8-v9": "^9.4.37",
|
||||
"@microsoft/microsoft-graph-types": "^2.40.0",
|
||||
"@microsoft/microsoft-graph-types-beta": "^0.42.0-preview",
|
||||
"@microsoft/sp-component-base": "1.18.2",
|
||||
"@microsoft/sp-core-library": "1.18.2",
|
||||
"@microsoft/sp-lodash-subset": "1.18.2",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.18.2",
|
||||
"@microsoft/sp-property-pane": "1.18.2",
|
||||
"@microsoft/sp-webpart-base": "1.18.2",
|
||||
"@pnp/spfx-controls-react": "3.16.0",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"tslib": "2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/eslint-config-spfx": "1.18.2",
|
||||
"@microsoft/eslint-plugin-spfx": "1.18.2",
|
||||
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
|
||||
"@microsoft/sp-build-web": "1.18.2",
|
||||
"@microsoft/sp-module-interfaces": "1.18.2",
|
||||
"@rushstack/eslint-config": "2.5.1",
|
||||
"@types/react": "17.0.45",
|
||||
"@types/react-dom": "17.0.17",
|
||||
"@types/webpack-env": "~1.15.2",
|
||||
"ajv": "^6.12.5",
|
||||
"eslint": "8.7.0",
|
||||
"eslint-plugin-react-hooks": "4.3.0",
|
||||
"gulp": "4.0.2",
|
||||
"typescript": "4.7.4"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
// A file is required to be in the root of the /src directory by the TypeScript compiler
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
|
||||
"id": "26c11d2f-c74a-4d93-91ed-054bdea6aad8",
|
||||
"alias": "MyTeamsVirtualEventsWebPart",
|
||||
"componentType": "WebPart",
|
||||
|
||||
// The "*" signifies that the version should be taken from the package.json
|
||||
"version": "*",
|
||||
"manifestVersion": 2,
|
||||
|
||||
// If true, the component can only be installed on sites where Custom Script is allowed.
|
||||
// Components that allow authors to embed arbitrary script code should set this to true.
|
||||
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
|
||||
"requiresCustomScript": false,
|
||||
"supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"],
|
||||
"supportsThemeVariants": true,
|
||||
|
||||
"preconfiguredEntries": [{
|
||||
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Advanced
|
||||
"group": { "default": "Advanced" },
|
||||
"title": { "default": "My Teams Virtual Events" },
|
||||
"description": { "default": "My Teams Virtual Events description" },
|
||||
"officeFabricIconFontName": "TeamsLogo",
|
||||
"properties": {
|
||||
}
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
import * as React from 'react';
|
||||
import * as ReactDom from 'react-dom';
|
||||
import { Version } from '@microsoft/sp-core-library';
|
||||
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
|
||||
import { IReadonlyTheme } from '@microsoft/sp-component-base';
|
||||
import MyTeamsVirtualEvents from './components/MyTeamsVirualEvents';
|
||||
import { IMyTeamsVirtualEventsProps } from './components/IMyTeamsVirtualEventsProps';
|
||||
import { createV9Theme } from '@fluentui/react-migration-v8-v9';
|
||||
import { FluentProvider, FluentProviderProps, Theme, teamsDarkTheme, teamsLightTheme, webDarkTheme, webLightTheme } from '@fluentui/react-components';
|
||||
|
||||
export enum AppMode {
|
||||
SharePoint, Teams, Office, Outlook
|
||||
}
|
||||
|
||||
export default class MyTeamsVirtualEventsWebPart extends BaseClientSideWebPart<{}> {
|
||||
private _isDarkTheme: boolean = false;
|
||||
private _appMode: AppMode = AppMode.SharePoint;
|
||||
private _theme: Theme = webLightTheme;
|
||||
|
||||
protected async onInit(): Promise<void> {
|
||||
if (!!this.context.sdks.microsoftTeams) {
|
||||
const teamsContext = await this.context.sdks.microsoftTeams.teamsJs.app.getContext();
|
||||
switch (teamsContext.app.host.name.toLowerCase()) {
|
||||
case 'teams': this._appMode = AppMode.Teams; break;
|
||||
case 'office': this._appMode = AppMode.Office; break;
|
||||
case 'outlook': this._appMode = AppMode.Outlook; break;
|
||||
default: throw new Error('Unknown host');
|
||||
}
|
||||
} else this._appMode = AppMode.SharePoint;
|
||||
return super.onInit();
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
const element: React.ReactElement<IMyTeamsVirtualEventsProps> = React.createElement(
|
||||
MyTeamsVirtualEvents, { context: this.context }
|
||||
);
|
||||
|
||||
//wrap the component with the Fluent UI 9 Provider.
|
||||
const fluentElement: React.ReactElement<FluentProviderProps> = React.createElement(
|
||||
FluentProvider,
|
||||
{
|
||||
theme: this._appMode === AppMode.Teams ?
|
||||
this._isDarkTheme ? teamsDarkTheme : teamsLightTheme :
|
||||
this._appMode === AppMode.SharePoint ?
|
||||
this._isDarkTheme ? webDarkTheme : this._theme :
|
||||
this._isDarkTheme ? webDarkTheme : webLightTheme
|
||||
},
|
||||
element
|
||||
);
|
||||
|
||||
ReactDom.render(fluentElement, this.domElement);
|
||||
}
|
||||
|
||||
protected onThemeChanged(currentTheme: IReadonlyTheme | undefined): void {
|
||||
if (!currentTheme) return;
|
||||
this._isDarkTheme = !!currentTheme.isInverted;
|
||||
//if the app mode is sharepoint, adjust the fluent ui 9 web light theme to use the sharepoint theme color, teams/dark mode should be fine on default
|
||||
if (this._appMode === AppMode.SharePoint) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this._theme = createV9Theme(currentTheme as any, webLightTheme);
|
||||
}
|
||||
}
|
||||
|
||||
protected onDispose(): void {
|
||||
ReactDom.unmountComponentAtNode(this.domElement);
|
||||
}
|
||||
|
||||
protected get dataVersion(): Version {
|
||||
return Version.parse('1.0');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
import { WebPartContext } from "@microsoft/sp-webpart-base";
|
||||
|
||||
export interface IMyTeamsVirtualEventsProps {
|
||||
context: WebPartContext
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
@import '~@fluentui/react/dist/sass/References.scss';
|
||||
|
||||
.myTeamsVirualEvents {
|
||||
overflow: hidden;
|
||||
padding: 1em;
|
||||
color: "[theme:bodyText, default: #323130]";
|
||||
color: var(--bodyText);
|
||||
&.teams {
|
||||
font-family: $ms-font-family-fallbacks;
|
||||
}
|
||||
}
|
||||
|
||||
.welcome {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.welcomeImage {
|
||||
width: 100%;
|
||||
max-width: 420px;
|
||||
}
|
||||
|
||||
.links {
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: "[theme:link, default:#03787c]";
|
||||
color: var(--link); // note: CSS Custom Properties support is limited to modern browsers only
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: "[theme:linkHovered, default: #014446]";
|
||||
color: var(--linkHovered); // note: CSS Custom Properties support is limited to modern browsers only
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,159 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import * as React from 'react';
|
||||
import styles from './MyTeamsVirtualEvents.module.scss';
|
||||
import type { IMyTeamsVirtualEventsProps } from './IMyTeamsVirtualEventsProps';
|
||||
import {
|
||||
DataGrid, DataGridBody, DataGridCell, DataGridHeader, DataGridHeaderCell, DataGridProps, DataGridRow, Skeleton, SkeletonItem, Spinner,
|
||||
TableColumnDefinition, createTableColumn, makeStyles, shorthands, tokens, Text, Toolbar, ToolbarButton, TableRowId, Tooltip, Link, Button,
|
||||
DrawerBody, DrawerHeader, DrawerHeaderTitle, OverlayDrawer
|
||||
} from '@fluentui/react-components';
|
||||
import { MSGraphClientV3 } from '@microsoft/sp-http';
|
||||
import * as MicrosoftGraphBeta from '@microsoft/microsoft-graph-types-beta';
|
||||
import { GraphError } from '@microsoft/microsoft-graph-client';
|
||||
import RegistrantCounts from './RegistrantCounts';
|
||||
import { ApprovalsAppRegular, ApprovalsAppFilled, bundleIcon, FilterSyncRegular, FilterSyncFilled, DismissRegular, DismissFilled } from '@fluentui/react-icons';
|
||||
import TeamApprove from './TeamApprove';
|
||||
import * as strings from 'MyTeamsVirtualEventsWebPartStrings';
|
||||
import Sync from './Sync';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
invertedWrapper: {
|
||||
backgroundColor: tokens.colorNeutralBackground1,
|
||||
},
|
||||
skeletonRow: {
|
||||
alignItems: "center",
|
||||
display: "grid",
|
||||
paddingBottom: "10px",
|
||||
width: "100%",
|
||||
position: "relative",
|
||||
...shorthands.gap("10px"),
|
||||
gridTemplateColumns: "min-content 20% 20% 15% 15%",
|
||||
},
|
||||
});
|
||||
|
||||
const ApprovalIcon = bundleIcon(ApprovalsAppFilled, ApprovalsAppRegular);
|
||||
const SyncListIcon = bundleIcon(FilterSyncFilled, FilterSyncRegular);
|
||||
const DismissIcon = bundleIcon(DismissRegular, DismissFilled);
|
||||
|
||||
enum DrawState { Closed, OpenTeam, OpenSync }
|
||||
|
||||
export default function MyTeamsVirtualEvents(props: IMyTeamsVirtualEventsProps): React.ReactElement<IMyTeamsVirtualEventsProps> {
|
||||
const { context } = props;
|
||||
const styles2 = useStyles();
|
||||
const [events, setEvents] = React.useState<MicrosoftGraphBeta.VirtualEventWebinar[]>();
|
||||
const [selectedRows, setSelectedRows] = React.useState(new Set<TableRowId>([]));
|
||||
const [drawState, setDrawState] = React.useState<DrawState>(DrawState.Closed);
|
||||
|
||||
const processGraph = (client: MSGraphClientV3, err: GraphError, res: { '@odata.nextlink'?: string, value: MicrosoftGraphBeta.VirtualEventWebinar[] }): void => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setEvents((events ?? []).concat(res.value.filter(e => e.startDateTime?.dateTime && new Date(e.startDateTime.dateTime) > new Date())));
|
||||
if (res['@odata.nextlink'])
|
||||
client.api(res['@odata.nextlink'])
|
||||
.get((err1: GraphError, res1: { '@odata.nextlink'?: string, value: MicrosoftGraphBeta.VirtualEventWebinar[] }) => processGraph(client, err1, res1))
|
||||
.catch(console.error);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
context.msGraphClientFactory
|
||||
.getClient('3')
|
||||
.then((client: MSGraphClientV3) => {
|
||||
client
|
||||
.api(`/solutions/virtualEvents/webinars/getByUserRole(role='organizer')`)
|
||||
.version("Beta")
|
||||
.filter(`status eq 'published' and startDateTime/dateTime gt '${new Date().toJSON()}'`)
|
||||
.get((err: GraphError, res: { '@odata.nextlink'?: string, value: MicrosoftGraphBeta.VirtualEventWebinar[] }) => processGraph(client, err, res))
|
||||
.catch(console.error);
|
||||
}).catch(console.error);
|
||||
}, [context]);
|
||||
|
||||
const columns: TableColumnDefinition<MicrosoftGraphBeta.VirtualEventWebinar>[] = [
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventWebinar>({
|
||||
columnId: "name",
|
||||
compare: (a, b) => (a.displayName ?? "").localeCompare(b.displayName ?? ""),
|
||||
renderHeaderCell: () => strings.Name,
|
||||
renderCell: (item) => <Link href={`https://events.teams.microsoft.com/event/${item.id}`} target='_blank'>{item.displayName}</Link>,
|
||||
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventWebinar>({
|
||||
columnId: "createdBy",
|
||||
compare: (a, b) => (a.createdBy?.user?.displayName ?? "").localeCompare(b.createdBy?.user?.displayName ?? ""),
|
||||
renderHeaderCell: () => strings.CreatedBy,
|
||||
renderCell: (item) => item.createdBy?.user?.displayName ?? JSON.stringify(item.createdBy)
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventWebinar>({
|
||||
columnId: "start",
|
||||
compare: (a, b) => (new Date(a.startDateTime!.dateTime!) as unknown as number) - (new Date(b.startDateTime!.dateTime!) as unknown as number),
|
||||
renderHeaderCell: () => strings.Start,
|
||||
renderCell: (item) => <Text size={100}>{new Date(item.startDateTime!.dateTime!).toLocaleString()}</Text>
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventWebinar>({
|
||||
columnId: "end",
|
||||
compare: (a, b) => (new Date(a.endDateTime!.dateTime!) as unknown as number) - (new Date(b.endDateTime!.dateTime!) as unknown as number),
|
||||
renderHeaderCell: () => strings.End,
|
||||
renderCell: (item) => <Text size={100}>{new Date(item.endDateTime!.dateTime!).toLocaleString()}</Text>
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventWebinar>({
|
||||
columnId: "registrants",
|
||||
renderHeaderCell: () => strings.Registrants,
|
||||
renderCell: (item) => <RegistrantCounts id={item.id!} context={context} />
|
||||
})
|
||||
];
|
||||
|
||||
const defaultSortState = React.useMemo<Parameters<NonNullable<DataGridProps["onSortChange"]>>[1]>(() => ({ sortColumn: "start", sortDirection: "ascending" }), []);
|
||||
const onSelectionChange: DataGridProps["onSelectionChange"] = (e, data) => setSelectedRows(data.selectedItems);
|
||||
|
||||
return (
|
||||
<section className={styles.myTeamsVirualEvents}>
|
||||
<Toolbar size="medium">
|
||||
<Tooltip content={strings.DrawHeaderSync} relationship='description'>
|
||||
<ToolbarButton icon={<SyncListIcon />} disabled={selectedRows.size === 0} onClick={() => setDrawState(DrawState.OpenSync)}>{strings.SyncFieldLabel}</ToolbarButton>
|
||||
</Tooltip>
|
||||
<Tooltip content={strings.DrawHeaderApprove} relationship='description'>
|
||||
<ToolbarButton icon={<ApprovalIcon />} disabled={selectedRows.size !== 1} onClick={() => setDrawState(DrawState.OpenTeam)}>{strings.ApproveButton}</ToolbarButton>
|
||||
</Tooltip>
|
||||
</Toolbar>
|
||||
{!events && <div style={{ 'display': 'flex', 'flexDirection': 'column', 'alignItems': 'stretch', 'gap': '10px' }}>
|
||||
<Spinner size='extra-large' label={strings.LoadingTeamsWebinars} />
|
||||
<div className={styles2.invertedWrapper}>
|
||||
<Skeleton>
|
||||
{[0, 1, 2, 3, 4].map(v => (<div key={`skeleton-${v}`} className={styles2.skeletonRow}>
|
||||
<SkeletonItem size={16} />
|
||||
<SkeletonItem size={16} />
|
||||
<SkeletonItem size={16} />
|
||||
<SkeletonItem size={16} />
|
||||
</div>))}
|
||||
</Skeleton>
|
||||
</div>
|
||||
</div>}
|
||||
<OverlayDrawer size='medium' open={drawState !== DrawState.Closed} onOpenChange={(_, { open }) => !open && setDrawState(DrawState.Closed)}>
|
||||
<DrawerHeader>
|
||||
<DrawerHeaderTitle action={<Button appearance="subtle" aria-label={strings.Close} icon={<DismissIcon />} onClick={() => setDrawState(DrawState.Closed)} />}>
|
||||
{drawState === DrawState.OpenSync ? strings.DrawHeaderSync : strings.DrawHeaderApprove}
|
||||
</DrawerHeaderTitle>
|
||||
</DrawerHeader>
|
||||
<DrawerBody>
|
||||
{drawState === DrawState.OpenTeam && <TeamApprove id={[...selectedRows][0] as string} context={context} />}
|
||||
{drawState === DrawState.OpenSync && <Sync context={context} webinars={events?.filter(e => selectedRows.has(e.id!)) ?? []} />}
|
||||
</DrawerBody>
|
||||
</OverlayDrawer>
|
||||
{events && <DataGrid items={events} columns={columns} sortable selectionMode="multiselect" getRowId={(item) => item.id} selectedItems={selectedRows}
|
||||
onSelectionChange={onSelectionChange} focusMode="composite" defaultSortState={defaultSortState} resizableColumns>
|
||||
<DataGridHeader>
|
||||
<DataGridRow selectionCell={{ "aria-label": strings.SelectAllRows }}>
|
||||
{({ renderHeaderCell }) => (<DataGridHeaderCell>{renderHeaderCell()}</DataGridHeaderCell>)}
|
||||
</DataGridRow>
|
||||
</DataGridHeader>
|
||||
<DataGridBody<MicrosoftGraphBeta.VirtualEventWebinar>>
|
||||
{({ item, rowId }) => (
|
||||
<DataGridRow<MicrosoftGraphBeta.VirtualEventWebinar> key={rowId} selectionCell={{ "aria-label": strings.SelectRow }}>
|
||||
{({ renderCell }) => (<DataGridCell>{renderCell(item)}</DataGridCell>)}
|
||||
</DataGridRow>
|
||||
)}
|
||||
</DataGridBody>
|
||||
</DataGrid>}
|
||||
</section>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
import * as React from 'react';
|
||||
import { WebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import * as MicrosoftGraphBeta from '@microsoft/microsoft-graph-types-beta';
|
||||
import { Label, Skeleton, SkeletonItem, Tooltip, makeStyles, shorthands, tokens } from '@fluentui/react-components';
|
||||
import { MSGraphClientV3 } from '@microsoft/sp-http';
|
||||
import { GraphError } from '@microsoft/microsoft-graph-client';
|
||||
import * as strings from 'MyTeamsVirtualEventsWebPartStrings';
|
||||
|
||||
interface IRegistrantCountsProps {
|
||||
id: string;
|
||||
context: WebPartContext;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
regdetails: {
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
...shorthands.gap("10px")
|
||||
},
|
||||
regcount: {
|
||||
fontSize: tokens.fontSizeBase100
|
||||
}
|
||||
});
|
||||
|
||||
export default function RegistrantCounts(props: IRegistrantCountsProps): React.ReactElement<IRegistrantCountsProps> {
|
||||
const [registrants, setRegistrants] = React.useState<MicrosoftGraphBeta.VirtualEventRegistration[]>();
|
||||
const { id, context } = props;
|
||||
const styles = useStyles();
|
||||
|
||||
React.useEffect(() => {
|
||||
context.msGraphClientFactory
|
||||
.getClient('3')
|
||||
.then((client: MSGraphClientV3) => {
|
||||
client
|
||||
.api(`solutions/virtualEvents/webinars/${id}/registrations`)
|
||||
.version("Beta")
|
||||
.get((err: GraphError, res: { value: MicrosoftGraphBeta.VirtualEventRegistration[] }) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setRegistrants(res.value);
|
||||
}).catch(console.error);
|
||||
}).catch(console.error);
|
||||
}, [context]);
|
||||
|
||||
if (!registrants) return (<Skeleton><SkeletonItem /></Skeleton>);
|
||||
else return (<div className={styles.regdetails}>
|
||||
<Tooltip content={strings.ThereAreRegistrantsRegistered.replace("{x}", registrants.filter(r => r.status === 'registered').length.toString())}
|
||||
relationship="label">
|
||||
<Label className={styles.regcount}>R: {registrants.filter(r => r.status === 'registered').length}</Label>
|
||||
</Tooltip>
|
||||
<Tooltip content={strings.ThereAreRegistrantsPendingApproval.replace("{x}", registrants.filter(r => r.status === 'pendingApproval').length.toString())}
|
||||
relationship="label">
|
||||
<Label className={styles.regcount}>P: {registrants.filter(r => r.status === 'pendingApproval').length}</Label>
|
||||
</Tooltip>
|
||||
</div>);
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
import { Accordion, AccordionHeader, AccordionItem, AccordionPanel, Button, Field, Label, ProgressBar, Text, makeStyles } from '@fluentui/react-components';
|
||||
import { WebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import * as React from 'react';
|
||||
import * as strings from 'MyTeamsVirtualEventsWebPartStrings';
|
||||
import { ISite, SitePicker } from "@pnp/spfx-controls-react/lib/SitePicker";
|
||||
import { ListPicker } from "@pnp/spfx-controls-react/lib/ListPicker";
|
||||
import * as MicrosoftGraphBeta from '@microsoft/microsoft-graph-types-beta';
|
||||
import { MonacoEditor } from "@pnp/spfx-controls-react/lib/MonacoEditor";
|
||||
|
||||
interface ISyncProps {
|
||||
context: WebPartContext;
|
||||
webinars: MicrosoftGraphBeta.VirtualEventWebinar[];
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
AccordionPanel: {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
rowGap: '4px'
|
||||
}
|
||||
})
|
||||
|
||||
export default function Sync(props: ISyncProps): React.ReactElement<ISyncProps> {
|
||||
const { context, webinars } = props;
|
||||
const [site, setSite] = React.useState<ISite>();
|
||||
const [list, setList] = React.useState<string>();
|
||||
const [running, setRunning] = React.useState<boolean>(false);
|
||||
const [status, setStatus] = React.useState<number>(-1);
|
||||
const [error, setError] = React.useState<string>();
|
||||
const styles = useStyles();
|
||||
|
||||
const regLinkColFormatting = React.useMemo(() => JSON.stringify({
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
|
||||
"elmType": "div",
|
||||
"children": [
|
||||
{
|
||||
"elmType": "div",
|
||||
"style": {
|
||||
"display": "flex",
|
||||
"flex-direction": "row"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"elmType": "a",
|
||||
"style": {
|
||||
"width": "80px",
|
||||
"height": "26px",
|
||||
"border-radius": "3px",
|
||||
"cursor": "pointer",
|
||||
"display": "flex",
|
||||
"align-items": "center",
|
||||
"justify-content": "space-evenly",
|
||||
"margin": "5px",
|
||||
"text-decoration": "none"
|
||||
},
|
||||
"attributes": {
|
||||
"href": "=[$RegistrationLink]",
|
||||
"target": "_blank",
|
||||
"class": "ms-bgColor-themePrimary ms-bgColor-themeDark--hover ms-fontColor-white ms-fontSize-12 ms-fontWeight-bold"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"elmType": "span",
|
||||
"attributes": {
|
||||
"iconName": "TeamsLogo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"elmType": "span",
|
||||
"txtContent": "Register"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, null, 2), []);
|
||||
|
||||
const sync = async (): Promise<void> => {
|
||||
setRunning(true);
|
||||
setStatus(0);
|
||||
const client = await context.msGraphClientFactory.getClient('3');
|
||||
for (let i = 0; i < webinars.length; i++) {
|
||||
const webinar = webinars[i];
|
||||
try {
|
||||
await client.api(`/sites/${site?.id}/lists/${list}/items`)
|
||||
.version("v1.0")
|
||||
.header('Content-Type', 'application/json')
|
||||
.post(JSON.stringify({
|
||||
"fields": {
|
||||
"Title": webinar.displayName,
|
||||
"Description": webinar.description?.content,
|
||||
"RegistrationLink": `https://events.teams.microsoft.com/event/${webinar.id}`,
|
||||
"Start": `${webinar.startDateTime?.dateTime}Z`,
|
||||
"End": `${webinar.endDateTime?.dateTime}Z`
|
||||
}
|
||||
}));
|
||||
setStatus(i + 1);
|
||||
} catch (e) {
|
||||
setStatus(i + 1);
|
||||
console.error(e);
|
||||
setError(`${error ? `${error}; ` : ''}${e.toString()}`);
|
||||
}
|
||||
}
|
||||
setRunning(false);
|
||||
};
|
||||
|
||||
return (<div style={{ 'display': 'flex', 'flexDirection': 'column', 'alignItems': 'stretch', 'gap': '10px', 'position': 'relative' }}>
|
||||
<Label>{strings.SyncColumns}</Label>
|
||||
<Accordion collapsible>
|
||||
<AccordionItem value="title">
|
||||
<AccordionHeader>Title [Single line of text]</AccordionHeader>
|
||||
<AccordionPanel className={styles.AccordionPanel}>
|
||||
<Text>{strings.TitleDescription}</Text>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="description">
|
||||
<AccordionHeader>Description [Multiple lines of text with Rich Text]</AccordionHeader>
|
||||
<AccordionPanel className={styles.AccordionPanel}>
|
||||
<Text>{strings.DescriptionDescription1}</Text>
|
||||
<Text>{strings.DescriptionDescription2}</Text>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="start">
|
||||
<AccordionHeader>Start [Date and time include time]</AccordionHeader>
|
||||
<AccordionPanel className={styles.AccordionPanel}>
|
||||
<Text>{strings.Start1}</Text>
|
||||
<Text>{strings.Start2}</Text>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="end">
|
||||
<AccordionHeader>End [Date and time include time]</AccordionHeader>
|
||||
<AccordionPanel className={styles.AccordionPanel}>
|
||||
<Text>{strings.End1}</Text>
|
||||
<Text>{strings.End2}</Text>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem value="link">
|
||||
<AccordionHeader>Registration Link [Single line of text]</AccordionHeader>
|
||||
<AccordionPanel className={styles.AccordionPanel}>
|
||||
<Text>{strings.RegistrationLink}</Text>
|
||||
<MonacoEditor value={regLinkColFormatting} showMiniMap={false} readOnly language={"json"} />
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
<SitePicker context={context} label={strings.SelectTeamSync} mode={'site'} allowSearch={true} multiSelect={false} onChange={(sites) => setSite(sites[0] ?? undefined)}
|
||||
placeholder={strings.SelectTeamSync} searchPlaceholder={strings.SearchTeamSync} />
|
||||
<ListPicker context={context} label={strings.SelectList} placeHolder={strings.SelectList} baseTemplate={100} includeHidden={false}
|
||||
multiSelect={false} onSelectionChanged={(v) => setList(Array.isArray(v) ? v[0] : v ?? undefined)} webAbsoluteUrl={site?.url ?? undefined} disabled={!site} />
|
||||
<Button appearance='primary' style={{ alignSelf: 'start' }} disabled={!list || running} onClick={sync}>Sync</Button>
|
||||
{status >= 0 && <Field validationMessage={`${webinars.length === status ? strings.Done : `${strings.Processing.replace("{name}", webinars[status].displayName ?? '')} ${error ? ` ${strings.WithErrors}${error}` : ''}`}`}
|
||||
validationState={error ? 'error' : webinars.length === status ? 'success' : 'none'}>
|
||||
<ProgressBar max={webinars.length} value={status} color={error ? 'error' : webinars.length === status ? 'success' : 'brand'} />
|
||||
</Field>}
|
||||
</div>);
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import * as React from 'react';
|
||||
import { WebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import * as MicrosoftGraphBeta from '@microsoft/microsoft-graph-types-beta';
|
||||
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
||||
import {
|
||||
Skeleton, SkeletonItem, Spinner, makeStyles, shorthands, tokens, DataGrid, DataGridBody,
|
||||
DataGridCell, DataGridHeader, DataGridHeaderCell, DataGridRow, TableColumnDefinition,
|
||||
createTableColumn, DataGridProps, PresenceBadge, Title1
|
||||
} from '@fluentui/react-components';
|
||||
import { MSGraphClientV3 } from '@microsoft/sp-http';
|
||||
import { GraphError } from '@microsoft/microsoft-graph-client';
|
||||
import Teams from './Teams';
|
||||
import * as strings from 'MyTeamsVirtualEventsWebPartStrings';
|
||||
|
||||
interface ITeamApproveProps {
|
||||
context: WebPartContext
|
||||
id: string;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
invertedWrapper: {
|
||||
backgroundColor: tokens.colorNeutralBackground1,
|
||||
},
|
||||
skeletonRow: {
|
||||
alignItems: "center",
|
||||
display: "grid",
|
||||
paddingBottom: "10px",
|
||||
width: "100%",
|
||||
position: "relative",
|
||||
...shorthands.gap("10px"),
|
||||
gridTemplateColumns: "min-content 20% 20% 15% 15%",
|
||||
},
|
||||
});
|
||||
|
||||
export default function TeamApprove(props: ITeamApproveProps): React.ReactElement<ITeamApproveProps> {
|
||||
const [registrants, setRegistrants] = React.useState<MicrosoftGraphBeta.VirtualEventRegistration[]>();
|
||||
const [selTeam, setSelTeam] = React.useState<string>();
|
||||
const [myTeams, setMyTeams] = React.useState<MicrosoftGraph.Team[]>();
|
||||
const [teamMembers, setTeamMembers] = React.useState<MicrosoftGraph.User[]>();
|
||||
const { id, context } = props;
|
||||
const styles = useStyles();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (id) context.msGraphClientFactory
|
||||
.getClient('3')
|
||||
.then((client: MSGraphClientV3) => {
|
||||
if (!registrants) client
|
||||
.api(`solutions/virtualEvents/webinars/${id}/registrations`)
|
||||
.version("Beta")
|
||||
.get((err: GraphError, res: { value: MicrosoftGraphBeta.VirtualEventRegistration[] }) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setRegistrants(res.value.filter(r => r.status === 'pendingApproval'));
|
||||
}).catch(console.error);
|
||||
if (!myTeams) client
|
||||
.api(`me/joinedTeams`)
|
||||
.version("v1.0")
|
||||
.get((err: GraphError, res: { value: MicrosoftGraph.Team[] }) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setMyTeams(res.value);
|
||||
}).catch(console.error);
|
||||
}).catch(console.error);
|
||||
}, [context]);
|
||||
|
||||
React.useEffect(() => {
|
||||
setTeamMembers(undefined);
|
||||
if (selTeam) context.msGraphClientFactory
|
||||
.getClient('3')
|
||||
.then((client: MSGraphClientV3) => {
|
||||
client
|
||||
.api(`groups/${selTeam}/members`)
|
||||
.version("v1.0")
|
||||
.top(999)
|
||||
.get((err: GraphError, res: { value: MicrosoftGraph.User[] }) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setTeamMembers(res.value);
|
||||
}).catch(console.error);
|
||||
}).catch(console.error);
|
||||
}, [selTeam, context]);
|
||||
|
||||
const columns: TableColumnDefinition<MicrosoftGraphBeta.VirtualEventRegistration>[] = [
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventRegistration>({
|
||||
columnId: "firstName",
|
||||
compare: (a, b) => (a.firstName ?? "").localeCompare(b.firstName ?? ""),
|
||||
renderHeaderCell: () => strings.FirstName,
|
||||
renderCell: (item) => item.firstName!
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventRegistration>({
|
||||
columnId: "lastName",
|
||||
compare: (a, b) => (a.lastName ?? "").localeCompare(b.lastName ?? ""),
|
||||
renderHeaderCell: () => strings.LastName,
|
||||
renderCell: (item) => item.lastName!
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventRegistration>({
|
||||
columnId: "email",
|
||||
compare: (a, b) => (a.email ?? "").localeCompare(b.email ?? ""),
|
||||
renderHeaderCell: () => strings.Email,
|
||||
renderCell: (item) => item.email!
|
||||
}),
|
||||
createTableColumn<MicrosoftGraphBeta.VirtualEventRegistration>({
|
||||
columnId: "matched",
|
||||
renderHeaderCell: () => strings.Matched,
|
||||
// eslint-disable-next-line @rushstack/security/no-unsafe-regexp
|
||||
renderCell: (item) => <PresenceBadge status={teamMembers?.find(t => new RegExp(item.email!, "gi").test(t.mail!)) ? 'available' : 'blocked'} />
|
||||
}),
|
||||
];
|
||||
|
||||
const defaultSortState = React.useMemo<Parameters<NonNullable<DataGridProps["onSortChange"]>>[1]>(() => ({ sortColumn: "email", sortDirection: "ascending" }), []);
|
||||
|
||||
return (
|
||||
<div style={{ 'display': 'flex', 'flexDirection': 'column', 'alignItems': 'stretch', 'gap': '10px' }}>
|
||||
{!registrants}
|
||||
{(!myTeams || !registrants) && <div style={{ 'display': 'flex', 'flexDirection': 'column', 'alignItems': 'stretch', 'gap': '10px' }}>
|
||||
{!registrants && <Spinner labelPosition='below' size='extra-large' label='Loading registrants' />}
|
||||
{!myTeams && <Spinner labelPosition='below' size='extra-large' label='Loading My Teams Webinars' />}
|
||||
<Skeleton><SkeletonItem /></Skeleton>
|
||||
</div>}
|
||||
{registrants?.length === 0 && <Title1>{strings.NoPending}</Title1>}
|
||||
{registrants && registrants.length > 0 && <>
|
||||
{myTeams && <Teams context={context} label={strings.SelectTeamApprove} onOptionSelect={(e, d) => setSelTeam(d.optionValue)} />}
|
||||
{selTeam && registrants && !teamMembers && <div className={styles.invertedWrapper}>
|
||||
<Skeleton>
|
||||
{registrants.map((v, i) => (<div key={`skeleton-${i}`} className={styles.skeletonRow}>
|
||||
<SkeletonItem size={36} />
|
||||
<SkeletonItem size={12} />
|
||||
</div>))}
|
||||
</Skeleton>
|
||||
</div>}
|
||||
{selTeam && registrants && teamMembers && <DataGrid items={registrants} columns={columns} sortable getRowId={(item) => item.id}
|
||||
focusMode="composite" defaultSortState={defaultSortState} resizableColumns>
|
||||
<DataGridHeader>
|
||||
<DataGridRow>
|
||||
{({ renderHeaderCell }) => (<DataGridHeaderCell>{renderHeaderCell()}</DataGridHeaderCell>)}
|
||||
</DataGridRow>
|
||||
</DataGridHeader>
|
||||
<DataGridBody<MicrosoftGraphBeta.VirtualEventRegistration>>
|
||||
{({ item, rowId }) => (<DataGridRow<MicrosoftGraphBeta.VirtualEventRegistration> key={rowId}>
|
||||
{({ renderCell }) => (<DataGridCell>{renderCell(item)}</DataGridCell>)}
|
||||
</DataGridRow>)}
|
||||
</DataGridBody>
|
||||
</DataGrid>}
|
||||
</>}
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
import { Dropdown, Field, Skeleton, SkeletonItem, Option } from "@fluentui/react-components";
|
||||
import { WebPartContext } from "@microsoft/sp-webpart-base";
|
||||
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
||||
import { MSGraphClientV3 } from '@microsoft/sp-http';
|
||||
import { GraphError } from '@microsoft/microsoft-graph-client';
|
||||
import * as React from "react";
|
||||
|
||||
export declare type SelectionEvents = React.ChangeEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement>;
|
||||
export declare type OptionOnSelectData = {
|
||||
optionValue: string | undefined;
|
||||
optionText: string | undefined;
|
||||
selectedOptions: string[];
|
||||
};
|
||||
|
||||
interface ITeamsProps {
|
||||
context: WebPartContext;
|
||||
label: string;
|
||||
onOptionSelect?: (event: SelectionEvents, data: OptionOnSelectData) => void;
|
||||
}
|
||||
|
||||
export default function Teams(props: ITeamsProps): React.ReactElement<ITeamsProps> {
|
||||
const { context, label } = props;
|
||||
const [myTeams, setMyTeams] = React.useState<MicrosoftGraph.Team[]>();
|
||||
const [selectedOptions, setSelectedOptions] = React.useState<string[]>([]);
|
||||
const [value, setValue] = React.useState<string>("");
|
||||
|
||||
const onOptionSelect: (typeof props)["onOptionSelect"] = (ev, data) => {
|
||||
setSelectedOptions(data.selectedOptions);
|
||||
setValue(data.optionText ?? "");
|
||||
if (props.onOptionSelect) props.onOptionSelect(ev, data);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
if ((myTeams?.length ?? -1) < 0) context.msGraphClientFactory
|
||||
.getClient('3')
|
||||
.then((client: MSGraphClientV3) => {
|
||||
if (!myTeams) client
|
||||
.api(`me/joinedTeams`)
|
||||
.version("v1.0")
|
||||
.get((err: GraphError, res: { value: MicrosoftGraph.Team[] }) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
setMyTeams(res.value);
|
||||
}).catch(console.error);
|
||||
}).catch(console.error);
|
||||
}, [context]);
|
||||
|
||||
return (<Field required label={label}>
|
||||
{!myTeams && <Skeleton><SkeletonItem /></Skeleton>}
|
||||
{myTeams && <Dropdown value={value}
|
||||
selectedOptions={selectedOptions}
|
||||
onOptionSelect={onOptionSelect}>
|
||||
{myTeams.map(t => (<Option key={t.id} text={t.displayName ?? ''} value={t.id}>{t.displayName}</Option>))}
|
||||
</Dropdown>}
|
||||
</Field>);
|
||||
}
|
42
samples/react-teams-my-webinars/src/webparts/myTeamsVirtualEvents/loc/en-us.js
vendored
Normal file
42
samples/react-teams-my-webinars/src/webparts/myTeamsVirtualEvents/loc/en-us.js
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
define([], function() {
|
||||
return {
|
||||
"SyncFieldLabel": "Add to list",
|
||||
"SiteLabel": "Select a site",
|
||||
"ListLabel": "Select a list",
|
||||
"DrawHeaderSync": "Add Webinars to a List",
|
||||
"DrawHeaderApprove": "Approve based on Team Membership",
|
||||
"SelectAllRows": "Select all rows",
|
||||
"SelectRow": "Select row",
|
||||
"Close": "Close",
|
||||
"SelectTeamApprove": "Select the team to get membership off",
|
||||
"SelectTeamSync": "Select the site",
|
||||
"SearchTeamSync": "Search for a site",
|
||||
"Done": "Done",
|
||||
"Processing": "Processing {name}",
|
||||
"WithErrors": "With error(s): ",
|
||||
"SelectList": "Select your list",
|
||||
"SyncColumns": "The sync expects the following columns",
|
||||
"TitleDescription": "This will hold the title of the webinar",
|
||||
"DescriptionDescription1": "Please set this column to use multiple lines of text and use rich text",
|
||||
"DescriptionDescription2": "This will hold the details of the webinar, this field is HTML formatted",
|
||||
"Start1": "Make sure to toggle include time",
|
||||
"Start2": "This will hold the Date and Time the webinar starts",
|
||||
"End1": "Make sure to toggle include time",
|
||||
"End2": "This will hold the Date and Time the webinar ends",
|
||||
"RegistrationLink": "To avoid issues use a single line of text and some column formatting to make it into a button. Example formatting:",
|
||||
"NoPending": "No pending registrants",
|
||||
"FirstName": "First Name",
|
||||
"LastName": "Last Name",
|
||||
"Email": "Email",
|
||||
"Matched": "Matched",
|
||||
"ThereAreRegistrantsRegistered": "There are {x} registrants registered",
|
||||
"ThereAreRegistrantsPendingApproval": "There are {x} registrants pending approval",
|
||||
"Name": "Name",
|
||||
"CreatedBy": "Created by",
|
||||
"Start": "Start",
|
||||
"End": "End",
|
||||
"Registrants": "Registrants",
|
||||
"ApproveButton": "Team membership approve",
|
||||
"LoadingTeamsWebinars": "Loading My Teams Webinars"
|
||||
}
|
||||
});
|
45
samples/react-teams-my-webinars/src/webparts/myTeamsVirtualEvents/loc/mystrings.d.ts
vendored
Normal file
45
samples/react-teams-my-webinars/src/webparts/myTeamsVirtualEvents/loc/mystrings.d.ts
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
declare interface IMyTeamsVirtualEventsWebPartStrings {
|
||||
SyncFieldLabel: string;
|
||||
SiteLabel: string;
|
||||
ListLabel: string;
|
||||
DrawHeaderSync: string;
|
||||
DrawHeaderApprove: string;
|
||||
SelectAllRows: string;
|
||||
SelectRow: string;
|
||||
Close: string;
|
||||
SelectTeamApprove: string;
|
||||
SelectTeamSync: string;
|
||||
SearchTeamSync: string;
|
||||
Done: string;
|
||||
Processing: string;
|
||||
WithErrors: string;
|
||||
SelectList: string;
|
||||
SyncColumns: string;
|
||||
TitleDescription: string;
|
||||
DescriptionDescription1: string;
|
||||
DescriptionDescription2: string;
|
||||
Start1: string;
|
||||
Start2: string;
|
||||
End1: string;
|
||||
End2: string;
|
||||
RegistrationLink: string;
|
||||
NoPending: string;
|
||||
FirstName: string;
|
||||
LastName: string;
|
||||
Email: string;
|
||||
Matched: string;
|
||||
ThereAreRegistrantsRegistered: string;
|
||||
ThereAreRegistrantsPendingApproval: string;
|
||||
Name: string;
|
||||
CreatedBy: string;
|
||||
Start: string;
|
||||
End: string;
|
||||
Registrants: string;
|
||||
ApproveButton: string;
|
||||
LoadingTeamsWebinars: string;
|
||||
}
|
||||
|
||||
declare module 'MyTeamsVirtualEventsWebPartStrings' {
|
||||
const strings: IMyTeamsVirtualEventsWebPartStrings;
|
||||
export = strings;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
After Width: | Height: | Size: 249 B |
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.7/includes/tsconfig-web.json",
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "lib",
|
||||
"inlineSources": false,
|
||||
"noImplicitAny": true,
|
||||
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules/@microsoft"
|
||||
],
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom",
|
||||
"es2015.collection",
|
||||
"es2015.promise"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue