Skip to content

Commit

Permalink
Merge pull request #17 from OfficeDev/users/v-pogopalakr/incident-cre…
Browse files Browse the repository at this point in the history
…ate-fix-gcc

TEOC v0.5.1 changes
  • Loading branch information
Porkai-Pandian authored Apr 28, 2022
2 parents 8aa46a0 + 25f1b02 commit 9f1cfa7
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Deployment/appPackage/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"manifestVersion": "1.11",
"version": "0.5",
"version": "0.5.1",
"id": "bef61400-db9b-41d4-a617-403deb7bbe77",
"packageName": "com.microsoft.teams.extension",
"developer": {
Expand Down
44 changes: 22 additions & 22 deletions Deployment/provisioning/EOC-Provision.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
param([string]$AdminEmail,
[string]$TenantName)


$FilePath = Read-Host "Please enter site template XML schema file path";
$FilePath = $FilePath.Trim();

Expand Down Expand Up @@ -29,30 +28,31 @@ $EOCSiteURL = "/sites/TEOCSite"
Connect-PnPOnline -Url $TenantURL -Interactive

try {
Write-Host "Checking if site already exists at $EOCSiteURL"
$site = Get-PnPTenantSite -Url $TenantURL$EOCSiteURL -ErrorAction SilentlyContinue
}
catch{

}

if ($site -ne $null)
{
Write-Host "Site already exists, exiting the PowerShell script"
return;
}
else
{
Write-Host "Site doesn't exist, creating new site at $EOCSiteURL"
}
Write-Host "Checking if site already exists at $EOCSiteURL"
$site = Get-PnPTenantSite -Url $TenantURL$EOCSiteURL -ErrorAction SilentlyContinue

New-PnPSite -Type TeamSiteWithoutMicrosoft365Group -Title TEOC -Url $TenantURL$EOCSiteURL -Owner $AdminEmail
if ($site -ne $null)
{
Write-Host "Site already exists, exiting the PowerShell script"
return;
}
else
{
Write-Host "Site doesn't exist, creating new site at $EOCSiteURL"
}

Connect-PnPOnline -Url $TenantURL$EOCSiteURL -Interactive
New-PnPSite -Type TeamSiteWithoutMicrosoft365Group -Title TEOC -Url $TenantURL$EOCSiteURL -Owner $AdminEmail -ErrorAction Stop -WarningAction SilentlyContinue

Write-Host "Creating lists in the EOC site"
Connect-PnPOnline -Url $TenantURL$EOCSiteURL -Interactive

Invoke-PnPSiteTemplate -Path $FilePath
Write-Host "Creating lists in TEOC site"

Write-Host "EOC App Provision complete."
Invoke-PnPSiteTemplate -Path $FilePath -ErrorAction Stop -WarningAction SilentlyContinue

Write-Host "TEOC App Provision complete."
}
catch{

Write-Host "`nError Message: " $_.Exception.Message
Write-Host "`nTEOC App Provisioning failed."
}
11 changes: 11 additions & 0 deletions EOC-TeamsFx/tabs/src/assets/Images/Manage Incident Types.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions EOC-TeamsFx/tabs/src/assets/Images/Manage Roles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion EOC-TeamsFx/tabs/src/common/graphConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const listsGraphEndpoint = "/lists";
export const columnsGraphEndpoint = "/columns";
export const usersGraphEndpoint = "https://graph.microsoft.com/v1.0/users/";
export const teamsAppsGraphEndpoint = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/";
export const newsTabTeamsAppIdGraphEndpoint = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/0ae35b36-0fd7-422e-805b-d53af1579093";
export const newsTabTeamsAppIdGraphEndpoint = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88";
export const assessmentTabTeamsAppIdGraphEndpoint = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88";
export const allAppsGraphEndpoint = "/appCatalogs/teamsApps?$filter=distributionMethod eq 'organization'";
export const betaGraphEndpoint = "https://graph.microsoft.com/beta/teams/";
Expand Down
12 changes: 12 additions & 0 deletions EOC-TeamsFx/tabs/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,18 @@ class Dashboard extends React.PureComponent<IDashboardProps, IDashboardState> {
successIndicator={false}
/>
</div>
<div className="dashboard-link">
<a title="Manage Roles" href={`https://${this.props.tenantName}/sites/${siteConfig.siteName}/lists/${siteConfig.roleAssignmentList}`} target='_blank' rel="noreferrer">
<img src={require("../assets/Images/Manage Roles.svg").default} alt="Manage Roles" />
<span>Manage Roles</span>
</a>
</div>
<div className="dashboard-link">
<a title="Manage Incident Types" href={`https://${this.props.tenantName}/sites/${siteConfig.siteName}/lists/${siteConfig.incTypeList}`} target='_blank' rel="noreferrer">
<img src={require("../assets/Images/Manage Incident Types.svg").default} alt="Manage Incident Types" />
Manage Incident Types
</a>
</div>
<Button
primary id="create-incident-btn"
fluid={true}
Expand Down
22 changes: 21 additions & 1 deletion EOC-TeamsFx/tabs/src/components/IncidentDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Button, ChevronStartIcon, Flex,
FormDropdown, FormInput, FormTextArea, Loader, Dialog
FormDropdown, FormInput, FormTextArea, Loader
} from "@fluentui/react-northstar";
import { LocalizationHelper, PeoplePicker, PersonType, UserType } from '@microsoft/mgt-react';
import { Client } from "@microsoft/microsoft-graph-client";
Expand Down Expand Up @@ -86,8 +86,10 @@ const getInputValildationInitialState = (): IInputValidationStates => {
};

class IncidentDetails extends React.PureComponent<IIncidentDetailsProps, IIncidentDetailsState> {

constructor(props: IIncidentDetailsProps) {
super(props);

this.state = {
dropdownOptions: '',
incDetailsItem: new IncidentEntity(),
Expand Down Expand Up @@ -143,11 +145,29 @@ class IncidentDetails extends React.PureComponent<IIncidentDetailsProps, IIncide

// check if form is in edit mode
await this.checkIfEditMode();
this.updatePeoplePickerRole();
}

//Function for screen Resizing
resize = () => this.setState({ isDesktop: window.innerWidth > constants.mobileWidth })

//Update Roles in Both People Pickers
updatePeoplePickerRole = () => {
customElements.whenDefined('mgt-people-picker').then(() => {
let peoplePicker1 = document?.getElementsByTagName("mgt-people-picker")[0]?.shadowRoot?.querySelector('mgt-flyout')?.querySelector('#people-picker-input');
let peoplePicker2 = document?.getElementsByTagName("mgt-people-picker")[1]?.shadowRoot?.querySelector('mgt-flyout')?.querySelector('#people-picker-input');
peoplePicker1?.setAttribute('role', 'searchbox');
peoplePicker2?.setAttribute('role', 'searchbox');
})
}

public componentDidUpdate(prevProps: IIncidentDetailsProps, prevState: IIncidentDetailsState) {
if (prevState.selectedUsersInEditMode !== this.state.selectedUsersInEditMode ||
prevState.selectedIncidentCommander !== this.state.selectedIncidentCommander) {
this.updatePeoplePickerRole();
}
}

componentWillUnmount() {

//Event listener for screen resizing
Expand Down
25 changes: 23 additions & 2 deletions EOC-TeamsFx/tabs/src/scss/Dashboard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ div[id="dashboard-search-btn-area"] {
color: #939290;
padding-left: 1%;
}
}


}

button[id="create-incident-btn"] {
width: 230px;
Expand All @@ -52,6 +51,28 @@ div[id="dashboard-search-btn-area"] {
}
}

div[class="dashboard-link"]{
text-align: left;
font: normal normal 600 16px/24px Segoe UI;
letter-spacing: 0px;
opacity: 1;
cursor: pointer;
a {
color: #242424 !important;
text-decoration: none !important;
padding:0.5em;
text-align: center;
display:inline-block;
margin:0 auto;
}
img {
width: 30px;
height: 30px;
margin-right: 5px;
margin-bottom: 5px;
}
}

button[id="create-incident-btn"]:hover {
opacity: 0.9;
}
Expand Down
19 changes: 12 additions & 7 deletions EOC-TeamsFx/tabs/src/scss/IncidentDetails.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
}

.incident-details-input-field-disabled{
.incident-details-input-field-disabled {
input {
font: normal normal normal 16px/21px Segoe UI;
opacity: 1;
Expand Down Expand Up @@ -190,7 +190,7 @@

.incCommanderInfoIcon {
padding-left: 3px;
}
}

.incNameInfoIcon {
padding-left: 3px;
Expand All @@ -201,7 +201,8 @@
color: #979593;
cursor: pointer;
}
.editRoleCol{

.editRoleCol {
margin: auto;
}
}
Expand Down Expand Up @@ -290,11 +291,15 @@ div[class="incident-details"] {

label[class="people-picker-label"]::after {
content: " *";
color: #FF0000
color: #FF0000;
}

label[class="message-label"] {
color: #f26e86;
color: #ce0000;
}

label[class="message-label"]::after {
content: "";
}

mgt-people-picker[class="incident-details-people-picker"] {
Expand Down Expand Up @@ -443,7 +448,7 @@ div[class="incident-details"] {
font: normal normal normal 13px/20px Segoe UI;
}

img[class="role-icon"]{
img[class="role-icon"] {
width: 20px;
height: 23px;
cursor: pointer;
Expand Down Expand Up @@ -509,7 +514,7 @@ div[class="incident-details"] {
height: 12pt;
}

div[class="editRoleCol"] > *{
div[class="editRoleCol"]>* {
font-size: 15px;
}
}
Expand Down
7 changes: 5 additions & 2 deletions Wiki/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,16 @@ To provision the TEOC site and SharePoint lists,

![Provisioning Scripts](images/Provisioning_Scripts.PNG)

* Run the below command, this will allow you to run **EOC-Provision.ps1** script. By default, the execution policy is restricted. You may change it back to restricted after deployment is completed.
>Note: Run below commands with Windows Powershell as Administrator
* Run the below command, this will allow you to run **EOC-Provision.ps1** script. By default, the execution policy is restricted for windows computer. You may change it back to restricted after deployment is completed.
>Note: Non-windows computer users can skip this as it is unrestricted by default for them.
```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

* Run the below command to unblock the deployment script.

>Note: File path should be set to provisioning folder.
```
Unblock-File -Path .\EOC-Provision.ps1
```
Expand Down
7 changes: 6 additions & 1 deletion Wiki/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
# FAQs

## 1. Azure deployment failed with conflict error, what do I need to do?
Deployment can fail if the base resource name provided is not available and you could see conflict error. Choose a different "Base Resource Name". You can check if your desired name is available by going to the page to [create a new web app](https://portal.azure.com/#create/Microsoft.WebSite) in the Azure Portal. Enter your desired name in the "App name" field. An error message will appear if the name you have chosen is taken or invalid.
Deployment can fail if the base resource name provided is not available and you could see conflict error. Choose a different "Base Resource Name". You can check if your desired name is available by going to the page to [create a new web app](https://portal.azure.com/#create/Microsoft.WebSite) in the Azure Portal. Enter your desired name in the "App name" field. An error message will appear if the name you have chosen is taken or invalid.

## 2. Provisioning failed with error, what do I need to do?
Provisioning can fail due to some network issue.
![ProvisioningError](Images/ProvisioningError.jpg)
If it failed and TEOC site collection is created in your tenant then delete the site collection from Active sites as well as Deleted sites. Run the provisioning script again.
Binary file modified Wiki/Images/CreateIncidentButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Wiki/Images/Dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Wiki/Images/ProvisioningError.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Wiki/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ This page contains the release information for Microsoft Teams Emergency Operati
## Version history
| Version | Release Date |
|----|----|
| 0.5.1 | Apr 28, 2022 |
| 0.5 | Mar 31, 2022 |

## Release notes

### v0.5.1 (Apr 28, 2022)

This app is released in _Public Preview_ mode. Below are the changes released with this version -

- Allow users to manage roles and incident types from dashboard.
- Fix for incident creation failure for GCC tenant.
- Wiki updates

### v0.5 (Mar 31, 2022)

This app is released in _Public Preview_ mode. Below are the features released with this version -
Expand Down

0 comments on commit 9f1cfa7

Please sign in to comment.