Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build new playground #751

Merged
merged 76 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c8610e7
implement new playground
fifoosid Jul 29, 2019
6bed3a5
fix merge conflicts
fifoosid Jul 29, 2019
f0fd305
fix gitignore & api docs
fifoosid Jul 29, 2019
af2918b
fix api docs
fifoosid Jul 29, 2019
0086749
change config for jest tests
fifoosid Aug 27, 2019
b09e0cc
Merge master branch
fifoosid Aug 27, 2019
d27e309
disable jest tests
fifoosid Aug 27, 2019
3c5548c
use bundle exec for jekyll build
fifoosid Aug 28, 2019
d663f3a
update build deps
fifoosid Aug 28, 2019
763b2bc
fix typo
fifoosid Aug 28, 2019
02212ce
install specific version of jekyll
fifoosid Aug 28, 2019
bb581ca
implement new label & update gitignore
fifoosid Aug 28, 2019
ccd387e
Merge remote-tracking branch 'origin/master' into build-new-playground
vladitasev Aug 28, 2019
eef8544
Merge branch 'build-new-playground' of https://github.com/SAP/ui5-web…
fifoosid Aug 28, 2019
c05061b
update rollup config
fifoosid Aug 28, 2019
5ba56ea
remove lock file
fifoosid Aug 28, 2019
1202589
run jest tests
fifoosid Aug 29, 2019
bf27c4e
Merge branch 'master' into build-new-playground
fifoosid Aug 29, 2019
4b4c65e
skip jest tests
fifoosid Aug 29, 2019
3148b3e
fix jest tests
fifoosid Aug 30, 2019
6cca780
fix assets url
fifoosid Aug 30, 2019
00b7352
change hover color
fifoosid Sep 2, 2019
a041c08
Merge remote-tracking branch 'origin/master' into build-new-playground
vladitasev Sep 2, 2019
27ec6b9
some fixes to jest
vladitasev Sep 2, 2019
14c2b24
fix qunit tests
vladitasev Sep 3, 2019
7423bb2
fix active marker in firefox
fifoosid Sep 4, 2019
3b1061d
fix vladi's comments
fifoosid Sep 4, 2019
1b9be53
require the minimum needed rollup version
vladitasev Sep 5, 2019
520fc0e
fix part of adi's comments
fifoosid Sep 10, 2019
078d98a
Merge branch 'build-new-playground' of https://github.com/SAP/ui5-web…
fifoosid Sep 10, 2019
19bdd8f
make use of the rollup bundle in main
fifoosid Sep 12, 2019
2c07ee4
remove unused css
fifoosid Sep 13, 2019
7a2ca36
Merge branch 'master' into build-new-playground
fifoosid Sep 13, 2019
0de9a94
fix more comments
fifoosid Sep 13, 2019
ecfe75a
fix more of the comments
fifoosid Sep 16, 2019
62fe895
fix landing page issue on IE
fifoosid Sep 17, 2019
e4b14dd
Merge branch 'master' into build-new-playground
fifoosid Sep 17, 2019
71f5b6f
update gemfile.lock file
fifoosid Sep 17, 2019
9773846
fix build for windows
fifoosid Sep 18, 2019
0677421
fix build pn travis
fifoosid Sep 18, 2019
18c8232
fix rake version in lock file
fifoosid Sep 18, 2019
99a3ffe
fix rouge version
fifoosid Sep 18, 2019
ff536a2
update rouge version
fifoosid Sep 18, 2019
0302047
update jekyll version
fifoosid Sep 18, 2019
673bbfb
skip building the playground on travis
fifoosid Sep 25, 2019
f4e5a8d
update deploy script
fifoosid Sep 26, 2019
eb91729
update deploy script
fifoosid Sep 26, 2019
4bba04f
fix merge conflicts
fifoosid Sep 30, 2019
64caa89
Merge master branch into 'build-new-playground' branch
fifoosid Sep 30, 2019
0af9485
fix build errors
fifoosid Sep 30, 2019
3abdd36
Fix merge conflicts & merge 'master' branch into 'build-new-playground'
fifoosid Oct 1, 2019
831d967
Merge 'master' branch into 'build-new-playground' branch
fifoosid Oct 17, 2019
ae7deec
Merge 'master' branch into 'build-new-playground'
fifoosid Oct 18, 2019
58f68fc
remove cpx & update build scripts
fifoosid Oct 22, 2019
baab7bd
Merge 'master' bracnh into 'build-new-playground' branch
fifoosid Oct 22, 2019
d4a6b2d
add src directory
fifoosid Oct 23, 2019
de4b39a
remove app directory
fifoosid Oct 23, 2019
054c721
fix paths
fifoosid Oct 23, 2019
3d829e7
Merge 'master' branch into 'build-new-playground' branch
fifoosid Oct 23, 2019
712c944
adapt to new paths
fifoosid Oct 24, 2019
9b43d23
move assets from src folder to top level
fifoosid Oct 28, 2019
b3c1513
remove src folder
fifoosid Oct 28, 2019
2ff3eb9
update gitignore & build scripts
fifoosid Oct 28, 2019
5e5418b
fix deploy path for windows
vladitasev Oct 28, 2019
e19340e
Merge 'master' branch into 'build-new-playground' branch
fifoosid Nov 1, 2019
24b10fd
test deployment on travis
fifoosid Nov 4, 2019
a22fc78
Merge branch 'build-new-playground' of https://github.com/SAP/ui5-web…
fifoosid Nov 4, 2019
1326c77
fix build on ntravis
fifoosid Nov 4, 2019
aba4dc3
instal bundle
fifoosid Nov 4, 2019
1934b8d
fix dist folder
fifoosid Nov 4, 2019
224bf4f
remove travis logs
fifoosid Nov 4, 2019
c529a0a
move bundler install to package.json
fifoosid Nov 4, 2019
8b205d2
remove unnecessary deployment
fifoosid Nov 4, 2019
aec1d3c
skip deployment on current branch
fifoosid Nov 4, 2019
5d8f63e
fix comments
fifoosid Nov 6, 2019
d22f356
fix more comments
fifoosid Nov 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ yarn-debug.log*

# Ignore default target directory for the npm package 'ui5-schemas'
.tmp


# Playground
packages/playground/_site/
packages/playground/.sass-cache/
packages/playground/assets/js/ui5-webcomponents/

packages/playground/docs/components
!packages/playground/docs/components/component.md

packages/playground/docs/documentation
!packages/playground/docs/documentation/documentation.md

packages/playground/docs/tutorials
!packages/playground/docs/tutorials/tutorials.md
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"

# Playground dependecies:
- gem install jekyll -v 3.8.6
- gem install jekyll-seo-tag

script:
- yarn build
- yarn test
Expand Down
4 changes: 2 additions & 2 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if [ "$TRAVIS_BRANCH" == "$TRAVIS_LATEST_RELEASE_WEBSITE_BRANCH" ]; then

# Run the build again so rollup can generate the correct public path urls
cd $TRAVIS_BUILD_DIR
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/ yarn build
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/assets/js/ui5-webcomponents/ yarn build:playground

# Move master build folder to gh-pages folder
cp -Rf $TRAVIS_BUILD_DIR/packages/playground/dist/* gh-pages
Expand Down Expand Up @@ -85,7 +85,7 @@ if [ "$TRAVIS_BRANCH" == "$TRAVIS_LATEST_RELEASE_WEBSITE_BRANCH" ]; then

# Run the build again so rollup can generate the correct public path urls
cd $TRAVIS_BUILD_DIR
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/master yarn build
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/master/assets/js/ui5-webcomponents/ yarn build:playground

# Move master build folder to gh-pages folder
cp -Rf $TRAVIS_BUILD_DIR/packages/playground/dist/* gh-pages/master
Expand Down
46 changes: 30 additions & 16 deletions docs/Angular-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@

In this tutorial you will learn how to add UI5 Web Components to your application. The UI5 Web Components can be added both to new Angular applications, as well as already existing ones.

## Step 1: Install Angular CLI:
```
## Step 1: Install Angular CLI

```bash
npm install -g @angular/cli
```

## Step 2: Create New Angular Application:
```
## Step 2: Create New Angular Application

```bash
ng new ui5-web-components-application
cd ui5-web-components-application
```

## Step 3: Add UI5 Web Components:
```
## Step 3: Add UI5 Web Components

```bash
npm install @ui5/webcomponents --save
```

## Step 4. Allow the Use of Custom Elements in Angular

Before using UI5 Web Components, you have to allow the use of custom elements in Angular. To do so, you have to import CUSTOM_ELEMENTS_SCHEMA in ```app.module.ts``` :

```js
import { ..., CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
```

After importing it, you have to add it to the schemas array:

```
```js
imports: [
...
],
Expand All @@ -34,35 +40,42 @@ schemas: [
]
```

## Step 5. Import the Components That You Are Going to Use:
## Step 5. Import the Components That You Are Going to Use

```js
import "@ui5/webcomponents/dist/Button";
```

## Step 6. Use the Imported Elements in Your Application:
## Step 6. Use the Imported Elements in Your Application

```html
<ui5-button>Hello world!</ui5-button>
```

## Step 7. Launch the Application:
```
## Step 7. Launch the Application

```bash
ng serve -o
```

## Additional:
## Additional

### Two-Way Data Binding:
### Two-Way Data Binding

You can use two-way data binding with the following components: CheckBox, RadioButton, Input, DatePicker, Switch, TextArea.
In order to use it, you have to use a library called [Origami](https://github.com/hotforfeature/origami), that provides advanced support for two-way data binding of custom elements.

Example:
1. Install Origami:
```

1. Install Origami:

```bash
npm install @codebakery/origami
```

2. Import the OrigamiFormsModule from Origami
```

```js
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { OrigamiFormsModule } from '@codebakery/origami/forms';
Expand All @@ -78,6 +91,7 @@ export class AppModule {}
```

3. Use Origami in your template:

```html
<ui5-input [(ngModel)]="value" origami></ui5-input>
```
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ calendarType | Gregorian, Islamic, Buddhist, Japanese, Persian | Gregorian |
[formatSettings](#formatSettings)| See the [Format settings](#formatSettings) section below | Empty object | Allows to override locale-specific configuration

<a name="rtl"></a>
###RTL
### RTL

When the `rtl` setting is set to `true`, UI5 Web Components will adjust their styling accordingly.
However, you should also set the HTML attribute `dir` to `rtl` on the `body` or `html` or any other relevant region of your application
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 17 additions & 13 deletions docs/React-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,40 @@

In this tutorial you will learn how to add UI5 Web Components to your application. The UI5 Web Components can be added both to new React applications, as well as already existing ones.

## Step 1. Start New Application. For Example with create-react-app:
```
## Step 1. Start New Application. For Example with create-react-app

```bash
npx create-react-app ui5-web-components-application
cd ui5-web-components-application
```

## Step 2. Add UI5 Web Components:
```
## Step 2. Add UI5 Web Components

```bash
npm install @ui5/webcomponents --save
```

## Step 3. Import the Components That You Are Going to Use:
## Step 3. Import the Components That You Are Going to Use

```js
import "@ui5/webcomponents/dist/Button";
```

## Step 4. Use the Imported Elements in Your Application:
## Step 4. Use the Imported Elements in Your Application

```html
<ui5-button>Hello world!</ui5-button>
```

## Step 5. Launch the Application:
```
## Step 5. Launch the Application

```bash
yarn start
```

## Additional

## Additional:

### Event Binding:
### Event Binding

In order to use the events, provided by UI5 Web Components, currently you need to get a ref to the component, because React doesn't support custom events. Here is an example of what you need to do in order to use the events provided by UI5 Web Components:

Expand All @@ -57,12 +61,12 @@ class Home extends Component {
}
```

### Bolean Properties Binding:
### Bolean Properties Binding

For boolean properties like ```collapsed``` in ```ui5-panel```, instead of setting true or false, you have to take care of the presence of the property. Here is an example:

```html
<ui5-panel header-text="Achievements" collapsed={!this.state.achievements.length || undefined}>
<!-- Content of ui5-panel -->
</ui5-panel>
```
```
32 changes: 20 additions & 12 deletions docs/Vue-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,57 @@

In this tutorial you will learn how to add UI5 Web Components to your application. The UI5 Web Components can be added both to new VueJS applications, as well as already existing ones.

## Step 1. Install Vue CLI:
```
## Step 1. Install Vue CLI

```bash
npm install -g @vue/cli
```

## Step 2. Init New App:
```
## Step 2. Init New App

```bash
vue create ui5-web-components-application
cd ui5-web-components-application
```

## Step 3. Add UI5 Web Components:
```
## Step 3. Add UI5 Web Components

```bash
npm install @ui5/webcomponents --save
```

## Step 4. Add UI5 Web Components to Vue ignoredElement

Add the following line to your ```main.js``` file:

```js
Vue.config.ignoredElements = [/^ui5-/];
```

## Step 5. Import the Components That You Are Going to Use:
## Step 5. Import the Components That You Are Going to Use

```js
import "@ui5/webcomponents/dist/Button";
```

## Step 6. Use the Imported Elements in Your Application:
## Step 6. Use the Imported Elements in Your Application

```html
<ui5-button>Hello world!</ui5-button>
```

## Step 7: Launch the Application:
```
## Step 7: Launch the Application

```bash
yarn serve
```

## Additional:
## Additional

### Two-Way Data Binding:
### Two-Way Data Binding

`v-model` binding doesn't work as expected for custom elements. In order to use two way data binding, you should bind and update the value yourself like this:

```html
<ui5-input
:value="inputValue"
Expand Down
14 changes: 2 additions & 12 deletions lib/documentation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Handlebars.registerHelper('toLowerCase', function (str) {

Handlebars.registerHelper('toKebabCase', function (str) {
const kebab = str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
return kebab !== str ? kebab : "";
return kebab !== str ? kebab : undefined;
});

Handlebars.registerHelper('checkEven', function (iIndex) {
Expand Down Expand Up @@ -105,20 +105,10 @@ const generateSamplePage = entry => {
} catch (err) { }

if (content) {
const fnRedirect = `
<script>
function redirect(event, component) {
event.preventDefault();
var location = window.parent.location.href;
window.parent.location.href = location.replace(/components\\/.+/gi, "components/" + component);
};
</script>
`;
const APIReference = compiledHandlebars(entry).replace(/\[\]/g, " [0..n]");
const EntitySince = compiledSinceTemplate(entry).replace(/\[\]/g, " [0..n]");

content = content.replace('</body', APIReference + '</body');
content = content.replace('</body', fnRedirect + '</body');
content = content.replace('<!-- JSDoc marker -->', APIReference);
content = content.replace(sinceMarker, EntitySince);

content = content.replace(linkMatcher, match => {
Expand Down
4 changes: 2 additions & 2 deletions lib/documentation/templates/api-events-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ module.exports = {
</div>

{{#each this.parameters}}
<tr class="api-table-event-param" >
<tr class="api-table-event-param">
<div class="api-table-content-event-params-wrapper">
<div class="cell api-table-param-name api-table-content-cell api-table-content-cell-bold">{{this.name}}</div>
<div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} </br> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
<div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} <br/> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
</div>
</tr>
{{/each}}
Expand Down
2 changes: 1 addition & 1 deletion lib/documentation/templates/api-methods-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {

{{#each this.parameters}}
<div class="cell api-table-content-cell api-table-content-cell-bold api-table-param-name">{{this.name}}</div>
<div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} </br> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
<div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} <br/> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
{{/each}}
{{/each}}
</div>
Expand Down
11 changes: 10 additions & 1 deletion lib/documentation/templates/api-properties-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ module.exports = {

{{#each properties}}
<div class="row {{checkEven @index}}">
<div class="cell api-table-content-cell api-table-content-cell-bold">{{this.name}} {{#if this.readonly}} (readonly) {{else}} <br> <code>{{toKebabCase this.name}}{{/if}} </code></div>
<div class="cell api-table-content-cell api-table-content-cell-bold">
{{this.name}}
{{#if this.readonly}}
(readonly)
{{/if}}
<br>
{{#if (toKebabCase this.name)}}
<code>{{toKebabCase this.name}}</code>
{{/if}}
</div>
<div class="cell api-table-content-cell">{{this.type}}</div>
<div class="cell api-table-content-cell">{{this.defaultValue}}</div>
<div class="cell api-table-content-cell api-table-content-cell-description">
Expand Down
2 changes: 1 addition & 1 deletion lib/documentation/templates/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ module.exports = {
<a class="separator" href="https://www.sap.com/about/legal/privacy.html" target="_blank">Privacy Policy</a>
<a href="https://www.sap.com/about/legal/impressum.html" target="_blank">Legal</a>
</div>
<img src="../../images/sap-logo-svg.svg" alt="Sap Logo" />
<img src="../../../../../../assets/images/sap-logo-svg.svg" alt="Sap Logo" />
</footer>`
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
"ui5"
],
"scripts": {
"build": "npm-run-all --sequential build:core build:base build:main build:playground",
"build": "npm-run-all --sequential build:core build:base build:main",
"build:core": "cd packages/core && yarn build",
"build:base": "cd packages/base && yarn build",
"build:main": "cd packages/main && yarn build",
"build:playground": "cd packages/playground && yarn build",
"build:playground": "yarn build:main && cd packages/playground && yarn build",
"clean": "npm-run-all --sequential clean:core clean:base clean:main",
"clean:core": "cd packages/core && yarn clean",
"clean:base": "cd packages/base && yarn clean",
"clean:main": "cd packages/main && yarn clean",
"start": "npm-run-all --parallel start:base start:main",
"start:base": "cd packages/base && yarn start",
"start:main": "cd packages/main && yarn start",
"start:playground": "cross-env DEPLOY_PUBLIC_PATH=/assets/js/ui5-webcomponents/ yarn build:main && cd packages/playground && yarn start",
"test": "cd packages/main && yarn test",
"lint": "wsrun --exclude-missing lint",
"link-all": "wsrun link",
Expand Down
Loading