Skip to content

Commit

Permalink
Merge pull request #405 from waldekmastykarz/enh-timeaway-pnpjs
Browse files Browse the repository at this point in the history
Changes TimeAway to use PnPjs
  • Loading branch information
VesaJuvonen authored Jun 9, 2020
2 parents 82b609d + a5394c3 commit 94843f7
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 504 deletions.
9 changes: 5 additions & 4 deletions solutions/TimeAway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ When you add the web part for the first time, a user will need to create the bac
![Time Away Screenshot](./assets/timeaway.png)
![Time Away as a personal Teams app](./assets/timeaway-teams.png)

## Used SharePoint Framework Version
## Used SharePoint Framework Version

![drop](https://img.shields.io/badge/version-1.10-green.svg)

## Applies to
Expand All @@ -38,7 +39,7 @@ When you add the web part for the first time, a user will need to create the bac
* [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment)

## Prerequisites

None.

## Solution
Expand All @@ -59,6 +60,7 @@ TimeAway | Cindy Yan (Canviz)

Version | Date | Comments
-------- | ------------------ | --------
1.0.14 | May 27, 2020 | Changed to use PnPjs
1.0.13 | April 24, 2020 | Updated to SPFx v1.10
1.0 | September 27, 2017 | Initial release

Expand All @@ -81,9 +83,8 @@ Version | Date | Comments

You can choose to use the web parts separately -- for example, place the "Your Time Away" web part on a page for users to manage their personal information, and the Time Away Summary part on your home page. Alternatively, you can just use the Time Away Summary web part by itself. It optionally will show a "Edit your Time Away" summary link that users can use to adjust their time away.

You can also toggle whether the web part willl show a full week, or only show Monday/Tuesday/Wednesday/Thursday/Friday.
You can also toggle whether the web part will show a full week, or only show Monday/Tuesday/Wednesday/Thursday/Friday.

Finally, you can also choose to use content approval features in SharePoint to set up simple notifications or approvals. Via a setting in the Time Away Summary web part, you can choose to hide Time Away out-of-office entries unless the Approval field is set to Approved. This gives administrators the ability to connect SharePoint approval features, or a workflow product like Microsoft Flow, tied to the Approval field in the Time Away list, to let managers choose to approve or hide fields.

<img src="https://telemetry.sharepointpnp.com/sp-dev-solutions/solutions/timeaway" />

67 changes: 66 additions & 1 deletion solutions/TimeAway/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion solutions/TimeAway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spca",
"version": "1.0.13",
"version": "1.0.14",
"private": true,
"main": "lib/index.js",
"engines": {
Expand All @@ -14,6 +14,7 @@
"@microsoft/sp-page-context": "1.10.0",
"@microsoft/sp-property-pane": "1.10.0",
"@microsoft/sp-webpart-base": "1.10.0",
"@pnp/sp": "^2.0.5",
"@types/es6-promise": "0.0.33",
"@types/lodash": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.52.tgz",
"@types/react": "16.8.8",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import update from 'immutability-helper';
import * as ca from "../../solutions/SharePointUtility";
import { CommandButton, Label, css, PrimaryButton } from 'office-ui-fabric-react';
import { CommandButton, css, PrimaryButton } from 'office-ui-fabric-react';
import styles from './MyTimeAwayContainer.module.scss';
import { IMyTimeAwayContainerProps } from './IMyTimeAwayContainerProps';
import IMyTimeAwayContainerState from './IMyTimeAwayContainerState';
Expand All @@ -22,7 +22,7 @@ export class MyTimeAwayContainer extends React.Component<IMyTimeAwayContainerPro
showDialogType: TimeAwayDialogType.Hidden,
period: this.props.period,
items: [],
isHaveAdminPermission: utility.checkCurrentUserIsAbleToManageList(this.props.context),
isHaveAdminPermission: utility.checkCurrentUserIsAbleToManageList(this.props.context.pageContext.web.permissions),
submitting: false,
isInitialized: this.props.isInitialized
};
Expand Down
Loading

0 comments on commit 94843f7

Please sign in to comment.