Commit 680186fb authored by Laurent Sittler's avatar Laurent Sittler ©
Browse files

Merge branch 'dev' into 'master'

First version

See merge request !1
parents 9cf25ca2 0f91a03d
Pipeline #784 passed with stage
in 37 seconds
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# change these settings to your own preference
indent_style = space
indent_size = 2
# we recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[{package,bower}.json]
indent_style = space
indent_size = 2
\ No newline at end of file
# Logs
logs
*.log
npm-debug.log*
# Dependency directories
node_modules
# Build generated files
dist
lib
solution
temp
*.sppkg
# Coverage directory used by tools like istanbul
coverage
# OSX
.DS_Store
# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj
# Resx Generated Code
*.resx.ts
# Styles Generated Code
*.scss.ts
stages:
- build
- package
extension:
image: node:10
stage: build
only:
- tags
script:
- npm i -g gulp
- npm i
- npm audit fix
- gulp bundle --ship
- gulp package-solution --ship
- mv ./sharepoint/solution/toc.sppkg ././toc.sppkg
artifacts:
paths:
- toc.sppkg
allow_failure: false
changelog:
image: node:latest
stage: package
only:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /Update Changelog from CI/
script:
- npm install -g conventional-changelog-cli && npm install -g version && apt-get install git
- mkdir repo && cd ./repo
- git clone -b $CI_COMMIT_REF_NAME https://gitlab-runner:[email protected]/$CI_PROJECT_PATH.git && git init &> /dev/null
- cd ./$CI_PROJECT_NAME
- conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md && git pull
- git config --global user.email "$GITLAB_USER_EMAIL"
- git commit -m 'Update Changelog from CI' && git push origin $CI_COMMIT_REF_NAME &> /dev/null
# Summary
<!-- Describe your issue here.-->
## Your environment
<!-- Add / replace the white space by a cross into the square bracket in accordance with your environment -->
|||
|----|----|
| Tenant Release | <ul><li> [ ] Standard</li><li> [ ] Targeted</li></ul> |
| Extension version | ? |
| Deployment | <ul><li> [ ] Tenant App Catalog and install one whole Tenant</li><li> [ ] Tenant App Catalog and install per site collection</li></li><li> [ ] Site collection app catalog</li></ul> |
## Current behavior
<!--
Describe the steps to reproduce your behavior. Recommandation: use a numbered list - one line by step.
If you have any screenshot to help us better understand, it is appreciate
-->
1.
2.
3.
## Expected behavior
<!--
Describe what you expect instead of the current behavior
You can use a numbered list to reproduce the steps until the expected behavior or a plain text
-->
## Additional information
<details>
<summary>Expand for output related to your SharePoint Environment</summary>
<!--
Indicate all other information that can be useful to fix the issue
Logs - command lines - cmdlet - links - etc.
-->
</pre>
</details>
~Bug
\ No newline at end of file
{
"recommendations": [
"msjsdiag.debugger-for-chrome"
]
}
\ No newline at end of file
{
/**
* Install Chrome Debugger Extension for Visual Studio Code to debug your components with the
* Chrome browser: https://aka.ms/spfx-debugger-extensions
*/
"version": "0.2.0",
"configurations": [{
"name": "Local workbench",
"type": "chrome",
"request": "launch",
"url": "https://localhost:4321/temp/workbench.html",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///.././src/*": "${webRoot}/src/*",
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"name": "Hosted workbench",
"type": "chrome",
"request": "launch",
"url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///.././src/*": "${webRoot}/src/*",
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222",
"-incognito"
]
}
]
}
\ No newline at end of file
// Place your settings in this file to overwrite default and user settings.
{
// Configure glob patterns for excluding files and folders in the file explorer.
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/bower_components": true,
"**/coverage": true,
"**/lib-amd": true,
"src/**/*.scss.ts": true
},
"typescript.tsdk": ".\\node_modules\\typescript\\lib"
}
\ No newline at end of file
{
"@microsoft/generator-sharepoint": {
"isCreatingSolution": true,
"environment": "spo",
"version": "1.10.0",
"libraryName": "table-of-content-for-share-point",
"libraryId": "4950183a-dfd5-498b-a31c-b063200d941e",
"packageManager": "npm",
"isDomainIsolated": false,
"componentType": "extension",
"extensionType": "ApplicationCustomizer"
}
}
\ No newline at end of file
# Contributing Guidelines
If you'd like to contribute to this repository, please read the following guidelines. Contributors are more than welcome to share their learnings with others from a centralized location.
## Issue
* If you find a bug, please have a look at the [issue list][1] if a similar bug has already been logged. If not, please create a new issue describing your issue
* If you have a suggestion of improvement of the existing code, please check if a similar card already exist, and let me know by adding an card into the [issue list][1]
## Merge Request
* Do not combine multiple changes in one merge request
* Do not submit MR's for coding style changes
* Do not commit code you didn't write
* Do not edit CHANGELOG. It is automatically update
### Submitting Merge Requests
1. Always fork repository to your own account for applying modifications
2. Ensure your fork is updated and not behind the upstream origin repo.
3. Create a new branch from the `dev` branch for your fork for the contribution
4. Include your changes to your branch
5. Commit your changes using descriptive commit message
* Use keyword prefix "Feature" or "Feat", "Fix", "Performance Improvement" or "Breaking Changes". Example: feat(UI): refresh button
6. Ensure your fork is updated and not behind the upstream of the main repo
* Sync your `dev` banch with the main repo one
```bash
# assuming you are in the folder of your locally cloned fork....
git checkout dev
# add a new remote named "upstream" and point to the main repo
git remote add upstream https://gitlab.lsonline.fr/SharePoint/sp-dev-fx-webparts/toc.git
# assuming you have a remote named `upstream` pointing on the main repo
git fetch upstream
# update your local dev to be a mirror of what's in the main repo
git pull --rebase upstream dev
# switch to your branch where you are working, say "your-feature"
git checkout your-feature
# update your branch to update it's fork point to the current tip of dev & put your changes on top of it
git rebase dev
```
7. Create a merge request in your own fork branch to the `dev` branch from the main repo
[1] https://gitlab.lsonline.fr/SharePoint/sp-dev-fx-webparts/toc/-/issues
# Table Of Content
A SharePoint SPFx WebPart that allow to display a Table of Content based on headers into the current page
\ No newline at end of file
## Table Of Contents
### Summary
A SharePoint SPFx extension that allow to display a Table of Contents based on the headers into the current page
![](assets/LsOnline-SPFx-TOC.gif)
### Used SharePoint Framework Version
![SPFx 1.10.0](https://img.shields.io/badge/SPFx-1.10.0-success.svg)
## Applies to
* [SharePoint Framework][1]
* [Office 365 tenant][2]
## Minimal Path to Awesome
To build manually the package, please make sure you have the prerequisites like illustrated to the [Set up your SharePoint Framework development environment][3] article and follow the next steps:
* clone this repo
* in the command line run:
* `npm i`
* `gulp bundle --ship`
* `gulp package-solution --ship`
* deploy the package to your **Tenant App Catalog** or **Site Collection App Catalog**
## Customize your install
Some properties can be defined to manage the default behavior / UI of the extension. For more information:
* **tocShape**: `circle` or `square` (`square` by default)
* **tocIcon**: UI Fabric icon class (`BulletedList` by default)
* **tocHeaders**: HTML headers tags separate by a comma (`H2, H3, H4` by default)
## Debug URL for testing
Here's a debug URL for testing around this sample.
```
&loadSPFX=true&customActions={"ec4bf35f-7f65-49e7-8b28-c9a59d2d712a":{"location":"ClientSideExtension.ApplicationCustomizer","properties":{"buttonIcon":"","shape":"","headers":""}}}
```
## Features
This project contains SharePoint Framework extensions that illustrates next features:
* ApplicationCustomizer
* Can be deploy in to the whole Tenant
* Add a button at the bottom of all pages of the site collection (if at least one header exist into the current page)
* On click, a right panel is opening with all clickable headers
* Change button shape
* Change button icon
* Specify supported headers
* Support headers from H2 to H4
## Features to come
* Update selected node while scrolling page
* Force display button based on page metadata
* Add filter into the panel
* Change the position of the button in responsive mode
* Support more headers (H5, H6)
* Property the choose the position of the button for a desktop mode/display
## Contributing
If you have ideas for new features or feedback, feel free to create an issue in the issues list. Before you submit a PR with your improvements, please review the [contributing guidelines][4].
[1]: https://dev.office.com/sharepoint
[2]: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant
[3]: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
[4]: ./CONTRIBUTING.md
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"table-of-content-application-customizer": {
"components": [
{
"entrypoint": "./lib/extensions/tableOfContent/TableOfContentApplicationCustomizer.js",
"manifest": "./src/extensions/tableOfContent/TableOfContentApplicationCustomizer.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"TableOfContentApplicationCustomizerStrings": "lib/extensions/tableOfContent/loc/{locale}.js"
}
}
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy"
}
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "table-of-content-for-share-point",
"accessKey": "<!-- ACCESS KEY -->"
}
\ No newline at end of file
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "Table Of Content for SharePoint",
"id": "4950183a-dfd5-498b-a31c-b063200d941e",
"version": "1.0.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"features": [
{
"title": "Application Extension - Table Of Content",
"description": "Deploys a custom action with ClientSideComponentId association",
"id": "084a8a93-3c0b-4910-9698-475989d979c1",
"version": "1.0.0.0",
"assets": {
"elementManifests": [
"elements.xml",
"ClientSideInstance.xml"
]
}
}
]
},
"paths": {
"zippedPackage": "solution/toc.sppkg"
}
}
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"port": 4321,
"https": true,
"serveConfigurations": {
"default": {
"pageUrl": "https://ltsrdev.sharepoint.com/sites/spfx-toc/SitePages/Home.aspx",
"customActions": {
"ec4bf35f-7f65-49e7-8b28-c9a59d2d712a": {
"location": "ClientSideExtension.ApplicationCustomizer",
"properties": {
"tocIcon": "",
"tocShape": "",
"tocHeaders": ""
}
}
}
},
"tableOfContent": {
"pageUrl": "https://ltsrdev.sharepoint.com/sites/spfx-toc/SitePages/Home.aspx",
"customActions": {
"ec4bf35f-7f65-49e7-8b28-c9a59d2d712a": {
"location": "ClientSideExtension.ApplicationCustomizer",
"properties": {
"tocIcon": "",
"tocShape": "",
"tocHeaders": ""
}
}
}
}
}
}
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
"cdnBasePath": "<!-- PATH TO CDN -->"
}
\ No newline at end of file
'use strict';
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.`);
build.addSuppression(`Warning - tslint - src/extensions/tableOfContent/TableOfContentApplicationCustomizer.ts(69,27): error no-function-expression: Use arrow function instead of function expression`);
build.initialize(require('gulp'));
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment