Skip to content

Commit 6f21560

Browse files
authored
Merge pull request #37 from microsoft/users/esmishra/caching-fix
Caching, user feedback, accessibility
2 parents eae4632 + e1b58c6 commit 6f21560

28 files changed

+629
-245
lines changed

source/reactjs/README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,58 @@
1+
# Microsoft Assent
2+
## Assent <sub>**A***pproval* **S***olution* **S***implified for* **ENT***erprise*<sub>
3+
Microsoft Assent (*a.k.a Approvals*) as a platform provides the "one stop shop" solution for approvers via a model that brings together disparate different approval requests in a consistent and ultra-modern model. Approvals delivers a unified approvals experience for any approval on multiple form factors - Website, Outlook Actionable email, Teams. It consolidates approvals across organization's line of business applications, building on modern technology and powered by Microsoft Azure. It serves as a showcase for solving modern IT scenarios using the latest technologies.
4+
- Payload Receiver Service API - Accepts payload from tenant system.
5+
- Audit Processor - Azure Function that logs the payload data into Azure Cosmos DB.
6+
- Primary Processor - Azure Function that processes the payload pushed by payload receiver service API to service bus.
7+
- Notification Processor - Azure Function that sends email notifications to Approvers/ Submitters as per configurations.
8+
- WatchdogProcessor - as per configurations from tenant sends reminder email notifications to Approvers for pending approvals as per configurations from tenant.
9+
- Core Services API - Set of Web APIs to support the Approvals UI.
10+
111
## Run the template
212

3-
1. Update all properties in the globals section of config/local.js
13+
1. Update below properties in the globals section of config/local.js
414
1. __CLIENT_ID__: process.env.clientId || '########-####-####-####-############',
515
2. __INSTRUMENTATION_KEY__: process.env.instrumentationKey || '########-####-####-####-############'
616
};
717

818
2. Run `npm install`
919

10-
3. Run `npm start` to run the app
20+
3. Run `npm start` to run the app
21+
22+
## User feedback setup
23+
24+
1. Update the __FEEDBACK_CONFIGURATION_URL__ value in the config files to your feedback endpoint, the feedback icon in top header will only appear if this value is set
25+
2. Implement the IFeedback interface provided in Feedback.ts, a sample Feedback class is provided in the same file
26+
3. If using a custom component for the Feedback UI, it can be linked with the top header using the launchfeedback event handler of the Feedback class and any initialization required for the user feedback flow can be done within the constructor
27+
4. Create an instance of your feedback class of type IFeedback and pass it to the TopHeader component, an example is provided below where feedback is initialized as a local state object
28+
29+
```
30+
setFeedback(new Feedback() as IFeedback);
31+
<TopHeader upn={user?.email} displayName={user?.name} feedback={feedback} />
32+
```
33+
34+
## License
35+
36+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
37+
38+
## Contributing
39+
40+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
41+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
42+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
43+
44+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
45+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
46+
provided by the bot. You will only need to do this once across all repos using our CLA.
47+
48+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
49+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
50+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
51+
52+
## Trademarks
53+
54+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
55+
trademarks or logos is subject to and must follow
56+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
57+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
58+
Any use of third-party trademarks or logos are subject to those third-party's policies.

source/reactjs/THIRD_PARTY_NOTICES.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,4 +1276,31 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12761276

12771277
---------------------------------------------------------
12781278

1279+
---------------------------------------------------------
1280+
1281+
react-cache-buster: 0.1.7 - MIT
1282+
1283+
MIT License
1284+
1285+
Copyright (c) 2021 Çağrı Aldemir
1286+
1287+
Permission is hereby granted, free of charge, to any person obtaining a copy
1288+
of this software and associated documentation files (the "Software"), to deal
1289+
in the Software without restriction, including without limitation the rights
1290+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1291+
copies of the Software, and to permit persons to whom the Software is
1292+
furnished to do so, subject to the following conditions:
1293+
1294+
The above copyright notice and this permission notice shall be included in all
1295+
copies or substantial portions of the Software.
1296+
1297+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1298+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1299+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1300+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1301+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1302+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1303+
1304+
---------------------------------------------------------
1305+
12791306
---------------------------------------------------------

source/reactjs/config/local.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const staticComponents = {
44
/* =========================
55
* Add host app entry point here
66
* ====================== */
7-
app: './src/App.tsx'
7+
app: './src/App.tsx',
88
};
99

1010
const dynamicComponents = {
@@ -30,23 +30,21 @@ const globals = {
3030
__API_URL_ROOT__: process.env.apiBaseUrl || '/api/v1',
3131
__GRAPH_BASE_URL__: process.env.graphBaseUrl || 'https://graph.microsoft.com/v1.0/',
3232
__GRAPH_RESOURCE_URL__: process.env.graphResourceUrl || 'https://graph.microsoft.com',
33-
__RESOURCE_URL__: process.env.resourceUrl || 'https://api.approvals.contoso.com/',
34-
__MICROFRONTEND_CDN_URL__: process.env.microfrontendURL || '',
3533
__UPN_SUFFIX__: process.env.upnSuffix || '@contoso.com',
36-
//OCV App Id and telemetry group
37-
__OCV_APP_ID__: process.env.ocvAppId || 0000,
38-
__OCV_ENVIRONMENT_NAME__: 'Int',
39-
__OCV_TELEMETRY_GROUP__: process.env.telemetryGroup || {
40-
featureArea: 'Modern Website'
41-
},
42-
34+
__RESOURCE_URL__: process.env.resourceUrl || 'https://api.approvals.contoso.com/',
35+
__MICROFRONTEND_CDN_URL__:
36+
process.env.microfrontendURL || '',
37+
//Feedback data
38+
__FEEDBACK_ENVIRONMENT_NAME__: 'Int',
39+
__FEEDBACK_CONFIGURATION_URL__: '',
40+
//CELA Invoice API Url
4341
__API_BASE_MATTER_URL__: process.env.apiBaseUrl || '',
4442
__API_BASE_MATTER_RESOURCE_URL__: process.env.apiBaseUrl || '',
45-
__CLASSIC_WEB_URL__: process.env.classicWebUrl || 'https://approvals.contoso.com/'
43+
__CLASSIC_WEB_URL__: process.env.classicWebUrl || 'https://approvals.contoso.com/',
4644
};
4745

4846
module.exports = {
4947
staticComponents,
5048
dynamicComponents,
51-
globals
49+
globals,
5250
};

source/reactjs/global.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ declare global {
1414
const __GRAPH_BASE_URL__: string;
1515
const __UPN_SUFFIX__: string;
1616
const __GRAPH_RESOURCE_URL__: string;
17-
const __AUTHORITY__:string;
17+
const __AUTHORITY__: string;
1818
const __API_BASE_MATTER_URL__: string;
1919
const __API_BASE_MATTER_RESOURCE_URL__: string;
20-
const __OCV_APP_ID__:number;
21-
const __OCV_ENVIRONMENT_NAME__:string;
22-
const __OCV_TELEMETRY_GROUP__: {
23-
featureArea: string
24-
};
20+
const __FEEDBACK_ENVIRONMENT_NAME__: string;
21+
const __FEEDBACK_CONFIGURATION_URL__: string;
2522
const __MICROFRONTEND_CDN_URL__: string;
2623
const __CLASSIC_WEB_URL__: string;
2724
}

source/reactjs/package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"private": true,
33
"name": "approvals-web",
4-
"version": "2.3.0",
4+
"version": "2.4.2",
55
"description": "",
66
"main": "index.js",
77
"author": "Microsoft Approvals Team",
88
"scripts": {
9-
"start": "webpack-dev-server --mode development --open",
10-
"start:development": "webpack-dev-server --mode development --open --env NODE_ENV=development",
9+
"generate-meta-tag": "node ./node_modules/react-cache-buster/dist/generate-meta-tag.js",
10+
"start": "npm run generate-meta-tag && webpack-dev-server --mode development --open",
11+
"start:development": "npm run generate-meta-tag && webpack-dev-server --mode development --open --env NODE_ENV=development",
1112
"start:test": "webpack-dev-server --mode development --open --env NODE_ENV=test",
12-
"start:uat": "webpack-dev-server --mode development --open --env NODE_ENV=uat",
13-
"start:prod": "webpack-dev-server --mode development --open --env NODE_ENV=production",
13+
"start:uat": "npm run generate-meta-tag && webpack-dev-server --mode development --open --env NODE_ENV=uat",
14+
"start:prod": "npm run generate-meta-tag && webpack-dev-server --mode development --open --env NODE_ENV=production",
1415
"serve": "webpack-dev-server --mode development --open --hot",
1516
"lerna:clean": "rimraf public/bundles",
1617
"build": "webpack --mode production",
17-
"build:development": "webpack --mode production --env NODE_ENV=development",
18+
"build:development": "npm run generate-meta-tag && webpack --mode production --env NODE_ENV=development",
1819
"build:test": "webpack --mode production --env NODE_ENV=test",
19-
"build:uat": "webpack --mode production --env NODE_ENV=uat",
20-
"build:prod": "webpack --mode production --env NODE_ENV=production",
20+
"build:uat": "npm run generate-meta-tag && webpack --mode production --env NODE_ENV=uat",
21+
"build:prod": "npm run generate-meta-tag && webpack --mode production --env NODE_ENV=production",
2122
"build:static": "webpack --mode production --config-name static",
2223
"build:dynamic": "webpack --mode production --config-name dynamic",
2324
"test": "jest --config jest.config.js",
@@ -38,7 +39,7 @@
3839
"@redux-devtools/extension": "^3.2.2",
3940
"adaptive-expressions": "^4.13.3",
4041
"adaptivecards": "^2.9.0",
41-
"adaptivecards-templating": "^2.1.0",
42+
"adaptivecards-templating": "^2.4.0-ci.202203.22001.0",
4243
"axios": "^0.26.0",
4344
"bootstrap": "^4.4.1",
4445
"buffer": "^6.0.3",
@@ -54,6 +55,7 @@
5455
"node-polyfill-webpack-plugin": "^1.1.4",
5556
"react": "~16.8.5",
5657
"react-bootstrap": "^1.0.1",
58+
"react-cache-buster": "^0.1.7",
5759
"react-device-detect": "^2.1.2",
5860
"react-dom": "^16.8.5",
5961
"react-redux": "^7.2.6",
@@ -66,13 +68,13 @@
6668
"redux-persist": "^6.0.0",
6769
"redux-saga": "^1.1.3",
6870
"reselect": "^4.0.0",
69-
"roosterjs-editor-api": "^8.18.0",
70-
"roosterjs-editor-dom": "^8.18.0",
71-
"sanitize-html": "^2.1.2",
71+
"roosterjs-editor-api": "^8.28.1",
72+
"roosterjs-editor-dom": "^8.28.1",
73+
"sanitize-html": "^2.7.1",
7274
"styled-components": "^5.3.3",
7375
"tslib": "^2.3.1",
7476
"ua-parser-js": "^0.7.33",
75-
"xlsx": "0.17.0"
77+
"xlsx": "0.18.5"
7678
},
7779
"devDependencies": {
7880
"@babel/plugin-syntax-jsx": "^7.12.1",

source/reactjs/public/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":"2.4.2"}

source/reactjs/public/web.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0"?>
22
<configuration>
33
<system.webServer>
4+
<staticContent>
5+
<mimeMap fileExtension=".json" mimeType="application/json" />
6+
</staticContent>
47
<rewrite>
58
<rules>
69
<rule name="React Routes" stopProcessing="true">

0 commit comments

Comments
 (0)