Merge pull request #3470 from martinlingstuyl/copy-views-spfx-upgrade

Updates react-copy-views sample to SPFx 1.16.1
This commit is contained in:
Hugo Bernier 2023-02-10 15:29:01 -05:00 committed by GitHub
commit 36af479969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 7192 additions and 2529 deletions

View File

@ -1,47 +0,0 @@
FROM mcr.microsoft.com/powershell:7.1.0-ubuntu-focal
ENV NPM_CONFIG_PREFIX=/home/copy-views-container/.npm-global \
PATH=$PATH:/home/copy-views-container/.npm-global/bin
RUN apt-get update && apt-get install -y \
git \
curl \
sudo \
zsh \
jq \
vim \
&& curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - \
&& apt-get install nodejs -y \
&& rm -rf /var/lib/apt/lists/*
RUN useradd \
--user-group \
--system \
--create-home \
--no-log-init \
copy-views-container
USER copy-views-container
EXPOSE 5432 4321 35729
WORKDIR /home/copy-views-container
# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************
RUN npm install -g gulp-cli@latest yo@4 @microsoft/generator-sharepoint@1.15.x spfx-fast-serve@3 @pnp/cli-microsoft365 --unsafe-perm
RUN zsh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended \
&& git clone https://github.com/denysdovhan/spaceship-prompt.git "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt" --depth=1 \
&& ln -s "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme" "$HOME/.oh-my-zsh/custom/themes/spaceship.zsh-theme" \
&& cp "$HOME/.oh-my-zsh/templates/zshrc.zsh-template" $HOME/.zshrc \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
&& sed -i "11s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"spaceship\"/" ~/.zshrc \
&& sed -i "27s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" ~/.zshrc \
&& sed -i "73s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/" ~/.zshrc \
&& sed -i "50s/# COMPLETION_WAITING_DOTS/COMPLETION_WAITING_DOTS/" ~/.zshrc
CMD [ "/bin/zsh", "-l" ]

View File

@ -1,42 +1,39 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/typescript-node
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
{
"name": "copy-views-container",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 12, 14, 16
"args": {
"VARIANT": "14"
}
},
"name": "SPFx 1.16.1",
"image": "docker.io/m365pnp/spfx:1.16.1",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh",
"args": [
"-l"
]
}
},
"terminal.integrated.defaultProfile.linux": "zsh"
},
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"eamodio.gitlens"
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5432, 4321, 35729],
// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "npm install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "copy-views-container"
"forwardPorts": [
4321,
35729
],
"portsAttributes": {
"4321": {
"protocol": "https",
"label": "Manifest",
"onAutoForward": "silent",
"requireLocalPort": true
},
// Not needed for SPFx>= 1.12.1
// "5432": {
// "protocol": "https",
// "label": "Workbench",
// "onAutoForward": "silent"
// },
"35729": {
"protocol": "https",
"label": "LiveReload",
"onAutoForward": "silent",
"requireLocalPort": true
}
},
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
"remoteUser": "node"
}

View File

@ -0,0 +1,33 @@
echo
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
npm install
## commands to create dev certificate and copy it to the root folder of the project
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
# 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
then
echo "# .CER Certificates" >> .gitignore
echo "*.cer" >> .gitignore
fi
## add *.pem to .gitignore to prevent certificates from being saved in repo
if ! grep -Fxq '*.pem' ./.gitignore
then
echo "# .PEM Certificates" >> .gitignore
echo "*.pem" >> .gitignore
fi
echo
echo -e "\e[1;92mReady!\e[0m"
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"

View File

@ -2,7 +2,8 @@
"@microsoft/generator-sharepoint": {
"plusBeta": false,
"isCreatingSolution": false,
"version": "1.15.2",
"version": "1.16.1",
"nodeVersion": "16.15.0",
"libraryName": "copy-views",
"libraryId": "f9a94606-ce1c-487c-ab87-550b240421de",
"environment": "spo",
@ -11,6 +12,10 @@
"solutionShortDescription": "copy-views description",
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"componentType": "webpart"
"componentType": "webpart",
"sdkVersions": {
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.4.1"
}
}
}

View File

@ -8,14 +8,20 @@ This solution enables a user to copy views from one list/library to another acro
![Copy Views](./assets/copy-views.gif)
## Used Versions
## Compatibility
![SPFx 1.15.2](https://img.shields.io/badge/SPFx-1.15.2-green.svg)
![pnpjs](https://img.shields.io/badge/pnpjs-3.6-green.svg)
![Node.js v14 | v12](https://img.shields.io/badge/Node.js-v14%20%7C%20v12-green.svg)
| :warning: Important |
|:---------------------------|
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
This sample is optimally compatible with the following environment configuration:
![SPFx 1.16.1](https://img.shields.io/badge/SPFx-1.16.1-green.svg)
![Node.js v16 | v14 | v12](https://img.shields.io/badge/Node.js-v16%20%7C%20v14%20%7C%20v12-green.svg)
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Unknown-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Unknown-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
@ -27,17 +33,15 @@ This solution enables a user to copy views from one list/library to another acro
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
## Solution
| Solution | Author(s) |
| ----------- | ------------------------------------------------------- |
| Copy Views | [Martin Lingstuyl](https://github.com/martinlingstuyl) ([@martinlingstuyl](https://twitter.com/martinlingstuyl)), I4-YOU Business Solutions b.v. |
## Authors
[Martin Lingstuyl](https://github.com/martinlingstuyl) ([@martinlingstuyl](https://twitter.com/martinlingstuyl)), I4-YOU Business Solutions b.v.
## Version history
| Version | Date | Comments |
| ------- | ---------------- | --------------- |
| 1.0 | August 29, 2022 | Initial release |
| 1.0.2.0 | Feb 9, 2023 | Upgraded to SPFx version 1.16.1 |
| 1.0.1.5 | August 29, 2022 | Initial release |
## Minimal Path to Awesome

View File

@ -9,7 +9,7 @@
"The Copy Views solution enables a user to copy views from one list/library to another across site collections. It can be used as a webpart on a page, or as a ListView Command Set extension. The user can select multiple views to copy to multiple target lists."
],
"creationDateTime": "2022-08-29",
"updateDateTime": "2022-09-12",
"updateDateTime": "2023-02-09",
"products": [
"SharePoint"
],
@ -20,7 +20,7 @@
},
{
"key": "SPFX-VERSION",
"value": "1.15.2"
"value": "1.16.1"
}
],
"thumbnails": [

View File

@ -3,7 +3,7 @@
"solution": {
"name": "copy-views-client-side-solution",
"id": "f9a94606-ce1c-487c-ab87-550b240421de",
"version": "1.0.1.5",
"version": "1.0.2.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,

View File

@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}

File diff suppressed because it is too large Load Diff

View File

@ -11,35 +11,38 @@
},
"dependencies": {
"@fluentui/react-icons-mdl2": "^1.3.16",
"@microsoft/decorators": "1.15.2",
"@microsoft/sp-adaptive-card-extension-base": "1.15.2",
"@microsoft/sp-core-library": "1.15.2",
"@microsoft/sp-dialog": "1.15.2",
"@microsoft/sp-listview-extensibility": "1.15.2",
"@microsoft/sp-lodash-subset": "1.15.2",
"@microsoft/sp-office-ui-fabric-core": "1.15.2",
"@microsoft/sp-property-pane": "1.15.2",
"@microsoft/sp-webpart-base": "1.15.2",
"@microsoft/decorators": "1.16.1",
"@microsoft/sp-adaptive-card-extension-base": "1.16.1",
"@microsoft/sp-core-library": "1.16.1",
"@microsoft/sp-dialog": "1.16.1",
"@microsoft/sp-listview-extensibility": "1.16.1",
"@microsoft/sp-lodash-subset": "1.16.1",
"@microsoft/sp-office-ui-fabric-core": "1.16.1",
"@microsoft/sp-property-pane": "1.16.1",
"@microsoft/sp-webpart-base": "1.16.1",
"@pnp/sp": "^3.6.0",
"office-ui-fabric-react": "7.185.7",
"react": "16.13.1",
"react-dom": "16.13.1",
"office-ui-fabric-react": "7.199.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.15.2",
"@microsoft/eslint-plugin-spfx": "1.15.2",
"@microsoft/eslint-config-spfx": "1.16.1",
"@microsoft/eslint-plugin-spfx": "1.16.1",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.15.2",
"@microsoft/sp-build-web": "1.16.1",
"@microsoft/sp-module-interfaces": "1.16.1",
"@rushstack/eslint-config": "2.5.1",
"@types/react": "16.9.51",
"@types/react-dom": "16.9.8",
"@types/react": "17.0.45",
"@types/react-dom": "17.0.17",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"eslint-plugin-react-hooks": "4.3.0",
"gulp": "4.0.2",
"spfx-fast-serve-helpers": "^1.15.3",
"typescript": "4.5.5"
},
"engines": {
"node": ">=16.13.0 <17.0.0"
}
}

View File

@ -1,5 +1,4 @@
@import '~office-ui-fabric-react/dist/sass/References.scss';
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
@import '~@fluentui/react/dist/sass/References.scss';
.row {
@include ms-Grid-row;

View File

@ -1,4 +1,4 @@
@import '~office-ui-fabric-react/dist/sass/References.scss';
@import '~@fluentui/react/dist/sass/References.scss';
.copyViews {
padding: 1em;