Merge branch 'pnp:main' into react-tabaccordion

This commit is contained in:
Arun Kumar Perumal 2022-04-11 13:16:07 +05:30 committed by GitHub
commit 138c6fb3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 7745 additions and 7832 deletions

View File

@ -1,7 +1,7 @@
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
{
"name": "SPFx 1.8.2",
"image": "docker.io/m365pnp/spfx:1.8.2",
"name": "SPFx 1.14.0",
"image": "docker.io/m365pnp/spfx:1.14.0",
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
@ -12,8 +12,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
4321,
35729,
5432
35729
],
"portsAttributes": {
"4321": {
@ -22,11 +21,12 @@
"onAutoForward": "silent",
"requireLocalPort": true
},
"5432": {
"protocol": "https",
"label": "Workbench",
"onAutoForward": "silent"
},
// Not needed for SPFx>= 1.12.1
// "5432": {
// "protocol": "https",
// "label": "Workbench",
// "onAutoForward": "silent"
// },
"35729": {
"protocol": "https",
"label": "LiveReload",
@ -36,4 +36,4 @@
},
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
"remoteUser": "node"
}
}

View File

@ -7,9 +7,11 @@ echo
echo -e "\e[1;94mGenerating dev certificate\e[0m"
gulp trust-dev-cert
# Convert the generated PEM certificate to a CER certificate
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
cp ~/.gcb-serve-data/gcb-serve.cer ./spfx-dev-cert.cer
cp ~/.gcb-serve-data/gcb-serve.cer ./spfx-dev-cert.pem
# Copy the PEM ecrtificate for non-Windows hosts
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
## add *.cer to .gitignore to prevent certificates from being saved in repo
if ! grep -Fxq '*.cer' ./.gitignore

View File

@ -31,3 +31,7 @@ obj
# Styles Generated Code
*.scss.ts
# .CER Certificates
*.cer
# .PEM Certificates
*.pem

View File

@ -0,0 +1,16 @@
!dist
config
gulpfile.js
release
src
temp
tsconfig.json
tslint.json
*.log
.yo-rc.json
.vscode

View File

@ -1,7 +1,7 @@
{
"@microsoft/generator-sharepoint": {
"version": "1.8.2",
"libraryName": "happy-birdthay",
"version": "1.14.0",
"libraryName": "happy-birthday",
"libraryId": "57890dd1-b655-4ec8-85ec-e47a9b696e7c",
"environment": "spo",
"packageManager": "npm",

View File

@ -17,8 +17,8 @@ But you can synchronize the Birthdays list with other applications HR Systems, o
## Compatibility
![SPFx 1.12.1](https://img.shields.io/badge/SPFx-1.12.1-green.svg)
![Node.js v14 | v12 | v10](https://img.shields.io/badge/Node.js-v14%20%7C%20v12%20%7C%20v10-green.svg)
![SPFx 1.14.0](https://img.shields.io/badge/SPFx-1.14.0-green.svg)
![Node.js v14 | v12](https://img.shields.io/badge/Node.js-v14%20|%20v12-green.svg)
![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-yellow.svg)
![Teams N/A: Untested with Microsoft Teams](https://img.shields.io/badge/Teams-N%2FA-lightgrey.svg "Untested with Microsoft Teams")
![Workbench Hosted: Does not work with local workbench](https://img.shields.io/badge/Workbench-Hosted-yellow.svg "Does not work with local workbench")
@ -36,13 +36,13 @@ Existing list in tenant root site, with the Title "Birthdays" and columns:
Column Internal Name|Type|Required| comments
--------------------|----|--------|----------
JobTitle| Text| no|
Birthday| DateTime | true|
userAADGUID| Text| no | required if used Azure Function to get Birthdays from AAD
Title| Text| true
email| Text| true
JobTitle | Text| no
Birthday | DateTime | true
userAADGUID | Text | no | required if used Azure Function to get Birthdays from AAD
Title | Text | true
email | Text | true
> **IMPORTANT:** After create a column Index on column "Birthday"
> **IMPORTANT:** Create index on column "Birthday".
## Solution
@ -58,6 +58,7 @@ Version|Date|Comments
1.0.0|November 6, 2018|Initial release
1.1.0|July 23, 2019 | new version
2.0.0|June 16, 2021 | Upgraded to SPFx 1.12.1
3.0.0|April 7, 2022 | Upgraded to SPFx 1.14.0
## Minimal Path to Awesome

View File

@ -9,7 +9,7 @@
"The Web Part Birthdays shows the upcoming birthdays in the company, the web part reads birthdays from a list located on the tenant\u0027s root site with title \u0022Birthdays.\u0022"
],
"creationDateTime": "2019-07-23",
"updateDateTime": "2021-06-16",
"updateDateTime": "2022-04-07",
"products": [
"SharePoint"
],
@ -20,7 +20,7 @@
},
{
"key": "SPFX-VERSION",
"value": "1.12.1"
"value": "1.14.0"
},
{
"key": "SPFX-TEAMSTAB",

View File

@ -2,7 +2,7 @@
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"happy-birdthay-web-part": {
"happy-birthday-web-part": {
"components": [
{
"entrypoint": "./lib/webparts/Birthdays/BirthdaysWebPart.js",

View File

@ -1,4 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy"
}

View File

@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "happy-birdthay",
"accessKey": "<!-- ACCESS KEY -->"
}
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "happy-birthday",
"accessKey": "<!-- ACCESS KEY -->"
}

View File

@ -1,12 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "happy-birdthay-anniversary-client-side-solution",
"name": "happy-birthday-anniversary-client-side-solution",
"id": "474e78f8-113f-4057-a9a9-640241137620",
"version": "2.0.0.0",
"version": "3.0.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"websiteUrl": "",
"mpnId": "Undefined-1.14.0"
},
"metadata": {
"shortDescription": {
"default": "birthdays-anniversary"
},
"longDescription": {
"default": "birthdays-anniversary"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "birthdays-anniversary Feature",
"description": "The feature that activates elements of the birthdays-anniversary solution.",
"id": "22eb0871-ae82-49b1-8d14-9dd9e1ec4d30",
"version": "3.0.0.0"
}
],
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",

View File

@ -2,9 +2,5 @@
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:5432/workbench",
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
}

View File

@ -5,6 +5,13 @@ const gulp = require('gulp');
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'));
build.initialize(gulp);
return result;
};
build.initialize(require('gulp'));

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,8 @@
{
"name": "birthdays-anniversay",
"name": "birthdays-anniversary",
"version": "2.0.0",
"private": true,
"engines": {
"node": ">=0.10.0"
},
"main": "lib/index.js",
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
@ -12,40 +10,37 @@
},
"dependencies": {
"@microsoft/loader-set-webpack-public-path": "^3.4.5",
"@microsoft/rush-stack-compiler-3.2": "^0.3.37",
"@microsoft/sp-core-library": "1.8.2",
"@microsoft/sp-lodash-subset": "1.8.2",
"@microsoft/sp-office-ui-fabric-core": "1.8.2",
"@microsoft/sp-webpart-base": "^1.12.1",
"@microsoft/sp-core-library": "1.14.0",
"@microsoft/sp-lodash-subset": "1.14.0",
"@microsoft/sp-office-ui-fabric-core": "1.14.0",
"@microsoft/sp-property-pane": "1.14.0",
"@microsoft/sp-webpart-base": "1.14.0",
"@pnp/common": "^1.3.11",
"@pnp/graph": "^1.3.11",
"@pnp/logging": "^1.3.11",
"@pnp/odata": "^1.3.11",
"@pnp/sp": "^1.3.11",
"@pnp/spfx-controls-react": "1.10.0",
"@pnp/spfx-controls-react": "3.7.2",
"@pnp/spfx-property-controls": "1.12.0",
"@types/es6-promise": "0.0.33",
"@types/react": "16.7.22",
"@types/react-dom": "16.8.0",
"@types/webpack-env": "1.13.1",
"moment": "^2.29.2",
"office-ui-fabric-react": "6.143.0",
"react": "16.7.0",
"react-dom": "16.7.0"
"moment": "^2.29.1",
"office-ui-fabric-react": "7.174.1",
"react": "16.13.1",
"react-dom": "16.13.1"
},
"devDependencies": {
"@microsoft/rush-stack-compiler-2.9": "0.7.7",
"@microsoft/rush-stack-compiler-3.9": "0.4.48",
"@microsoft/set-webpack-public-path-plugin": "^2.4.0",
"@microsoft/sp-build-web": "^1.12.1",
"@microsoft/sp-module-interfaces": "1.8.2",
"@microsoft/sp-tslint-rules": "1.8.2",
"@microsoft/sp-webpart-workbench": "^1.12.1",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"@microsoft/sp-build-web": "1.14.0",
"@microsoft/sp-module-interfaces": "1.14.0",
"@microsoft/sp-tslint-rules": "1.14.0",
"@types/es6-promise": "0.0.33",
"@types/react": "16.9.51",
"@types/react-dom": "16.9.8",
"@types/webpack-env": "1.13.1",
"ajv": "~5.2.2",
"gulp": "~3.9.1"
"gulp": "4.0.2"
},
"resolutions": {
"@types/react": "16.7.22"
"@types/react": "16.8.8"
}
}

View File

@ -1,6 +1,6 @@
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
@import '~office-ui-fabric-react/dist/sass/References.scss';
.happyBirdthay {
.happyBirthday {
.documentCard {
-webkit-font-smoothing: antialiased;
background-color: #ffffff;

View File

@ -2,9 +2,8 @@ import * as React from 'react';
import styles from './HappyBirthdayCard.module.scss';
import { IHappyBirthdayCardProps } from './IHappyBirthdayCardProps';
import { IHappyBirthdayCardPState } from './IHappyBirthdayCardState';
import { escape } from '@microsoft/sp-lodash-subset';
import { IPersonaSharedProps, Persona, PersonaSize, IPersonaProps, PersonaPresence } from 'office-ui-fabric-react/lib/Persona';
import { Image, IImageProps, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { IPersonaSharedProps, Persona, PersonaSize, IPersonaProps } from 'office-ui-fabric-react/lib/Persona';
import { Image, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { Label } from 'office-ui-fabric-react/lib/Label';
import * as strings from 'ControlStrings';
import { Icon } from 'office-ui-fabric-react/lib/Icon';
@ -109,10 +108,10 @@ export class HappyBirthdayCard extends React.Component<IHappyBirthdayCardProps,
}
// Render
public render(): React.ReactElement<IHappyBirthdayCardProps> {
this._birthdayMsg = this.state.isBirthdayToday ? (this.props.anniversary? strings.HappyAnniversaryMsg: strings.HappyBirthdayMsg) : (this.props.anniversary? strings.NextAnniversaryMsg: strings.NextBirthdayMsg);
return (
<div className={styles.happyBirdthay}>
<div className={styles.happyBirthday}>
<div className={styles.documentCardWrapper}>
<div className={styles.documentCard}>
<Image

View File

@ -1,4 +1,3 @@
export interface IHappyBirthdayCardPState {
isBirthdayToday: boolean;
}

View File

@ -1,6 +1,6 @@
define([], function() {
return {
"BirdthayControlDefaultDay": "Today",
"BirthdayControlDefaultDay": "Today",
"HappyBirthdayMsg": "Happy Birthday!",
"NextBirthdayMsg": "Next Birthday",
"HappyAnniversaryMsg": "Happy Anniversary!",

View File

@ -1,5 +1,5 @@
declare interface IControlStrings {
BirdthayControlDefaultDay: string,
BirthdayControlDefaultDay: string,
HappyBirthdayMsg: string,
NextBirthdayMsg: string,
HappyAnniversaryMsg: string,

View File

@ -1,4 +1,4 @@
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
@import '~office-ui-fabric-react/dist/sass/References.scss';
.happyBirthday {
.backgroundImgBallons{

View File

@ -2,29 +2,12 @@ import * as React from 'react';
import styles from './HappyBirthday.module.scss';
import { IHappyBirthdayProps } from './IHappyBirthdayProps';
import { IHappbirthdayState } from './IHappybirthdayState';
import { escape } from '@microsoft/sp-lodash-subset';
import { IUser } from './IUser';
import HappyBirdthayCard from '../../controls/happyBirthdayCard/HappyBirthdayCard';
import HappyBirthdayCard from '../../controls/happyBirthdayCard/HappyBirthdayCard';
import * as moment from 'moment';
import { Image, IImageProps, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { Label } from 'office-ui-fabric-react/lib/Label';
import * as strings from 'ControlStrings';
export class HappyBirthday extends React.Component<IHappyBirthdayProps, IHappbirthdayState> {
private _showBirthdays: boolean = true;
constructor(props: IHappyBirthdayProps) {
super(props);
console.log(props.imageTemplate);
}
public async componentDidMount() {
}
public componentDidUpdate(prevProps: IHappyBirthdayProps, prevState: IHappbirthdayState): void {
}
//
public render(): React.ReactElement<IHappyBirthdayProps> {
return (
<div className={styles.happyBirthday}>
@ -32,7 +15,7 @@ export class HappyBirthday extends React.Component<IHappyBirthdayProps, IHappbir
this.props.users.map((user: IUser) => {
return (
<div className={styles.container}>
<HappyBirdthayCard userName={user.userName}
<HappyBirthdayCard userName={user.userName}
jobDescription={user.jobDescription}
birthday={moment(user.birthday, ["MM-DD-YYYY", "YYYY-MM-DD", "DD/MM/YYYY", "MM/DD/YYYY"]).format('Do MMMM')}
anniversary={user.anniversary}

View File

@ -1,5 +1,5 @@
import { IUser } from './IUser';
import { WebPartContext } from "@microsoft/sp-webpart-base";
export interface IHappyBirthdayProps {
users: IUser[];
imageTemplate: string;

View File

@ -1,13 +1,11 @@
import { WebPartContext } from "@microsoft/sp-webpart-base";
import { ApplicationCustomizerContext } from "@microsoft/sp-application-base";
import { SPHttpClient, SPHttpClientResponse, MSGraphClient } from "@microsoft/sp-http";
import { MSGraphClient } from "@microsoft/sp-http";
import * as moment from 'moment';
export class SPService {
private graphClient: MSGraphClient = null;
private birthdayListTitle: string = "Birthdays";
constructor(private _context: WebPartContext | ApplicationCustomizerContext) {
constructor(private _context: WebPartContext) {
}
// Get Profiles
@ -21,9 +19,9 @@ export class SPService {
_month = parseInt(moment().format('MM'));
_day = parseInt(moment().format('DD'));
_filter = "fields/Birthday ge '" + _today + "'";
// If we are in Dezember we have to look if there are birthday in January
// If we are in December we have to look if there are birthdays in January
// we have to build a condition to select birthday in January based on number of upcommingDays
// we can not use the year for teste , the year is always 2000.
// we can not use the year for test, the year is always 2000.
console.log(_month);
_countdays = _day + upcommingDays;
_f = 0;

View File

@ -13,7 +13,6 @@ import {
import * as strings from 'BirthdaysWebPartStrings';
import Birthdays from './components/Birthdays';
import { IBirthdaysProps } from './components/IBirthdaysProps';
import { Version } from '@microsoft/sp-core-library';
export interface IBirthdaysWebPartProps {
title: string;

View File

@ -1,4 +1,4 @@
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
@import '~office-ui-fabric-react/dist/sass/References.scss';
.happyBirthday {
.backgroundImgBallons{

View File

@ -1,14 +1,13 @@
import * as React from 'react';
import styles from './Birthdays.module.scss';
import { IBirthdaysProps } from './IBirthdaysProps';
import { escape } from '@microsoft/sp-lodash-subset';
import { HappyBirthday, IUser } from '../../../controls/happybirthday';
import * as moment from 'moment';
import { IBirthdayState } from './IBirthdaysState';
import SPService from '../../../services/SPService';
import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle";
const imgBackgroundBallons: string = require('../../../../assets/ballonsBackgroud.png');
import { Image, IImageProps, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { Image, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { Label } from 'office-ui-fabric-react/lib/Label';
import * as strings from 'ControlStrings';

View File

@ -1,4 +1,4 @@
import {IUser } from '../../../services/IUser';
import { IUser } from '../../../services/IUser';
export interface IBirthdayState{
Users : IUser[] ;
showBirthdays: boolean;

View File

@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.2/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"packageName": "HappyBirdthayAnniversary",
"packageName": "HappyBirthdayAnniversary",
"id": "b0069b7e-8ec8-4e14-a76c-0c8bcb33993e",
"version": "0.1",
"developer": {
@ -14,8 +14,8 @@
"short": "HappyBirthdayAnniversary"
},
"description": {
"short": "HappyBirdthay & anniversary description",
"full": "HappyBirdthay & anniversary description"
"short": "HappyBirthday & anniversary description",
"full": "HappyBirthday & anniversary description"
},
"icons": {
"outline": "tab20x20.png",

View File

@ -1,5 +1,5 @@
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.2/includes/tsconfig-web.json",
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
"compilerOptions": {
"target": "es5",
"forceConsistentCasingInFileNames": true,
@ -19,20 +19,17 @@
"./node_modules/@microsoft"
],
"types": [
"es6-promise",
"webpack-env"
],
"lib": [
"es5",
"dom",
"es2015.collection"
"es2015.collection",
"es2015.promise"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"lib"
"src/**/*.ts",
"src/**/*.tsx"
]
}

View File

@ -1,30 +1,29 @@
{
"extends": "@microsoft/sp-tslint-rules/base-tslint.json",
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
}
}
{
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json",
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
}
}