Skip to content

Commit 5c57a15

Browse files
author
dixyushi
committed
Merge remote-tracking branch 'upstream/main' into main
2 parents 6f2ccad + 8273678 commit 5c57a15

21 files changed

Lines changed: 453 additions & 1 deletion

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# What will the user learn in your tutorial?
2+
3+
4+
# What should the user already know when starting the tutorial?
5+

.github/workflows/checkpr.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Check PR
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
env:
11+
PR_NUMBER: ${{github.event.number}}
12+
13+
steps:
14+
- name: Get PR info
15+
id: pr_info
16+
run: |
17+
content=`curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}`
18+
# the following lines are only required for multi line json
19+
content="${content//'%'/'%25'}"
20+
content="${content//$'\n'/'%0A'}"
21+
content="${content//$'\r'/'%0D'}"
22+
# end of optional handling for multi line json
23+
echo "::set-output name=json::$content"
24+
25+
- name: Check draft
26+
if: "${{!startsWith(fromJson(steps.pr_info.outputs.json).title,'WIP') && !fromJson(steps.pr_info.outputs.json).draft}}"
27+
uses: mshick/add-pr-comment@v1
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
repo-token-user-login: 'github-actions[bot]'
31+
message: |
32+
Please mark your pull request as draft until it is finished: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft
33+
34+
- name: Check title
35+
if: "${{contains(fromJson(steps.pr_info.outputs.json).title, 'commit')}}"
36+
uses: mshick/add-pr-comment@v1
37+
with:
38+
repo-token: ${{ secrets.GITHUB_TOKEN }}
39+
repo-token-user-login: 'github-actions[bot]'
40+
message: |
41+
Please add a meaningful title to your pull request.
42+
43+
- name: Check body
44+
if: "${{fromJson(steps.pr_info.outputs.json).body == null}}"
45+
uses: mshick/add-pr-comment@v1
46+
with:
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
repo-token-user-login: 'github-actions[bot]'
49+
message: |
50+
Please add a description to your pull request.

.github/workflows/pr.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,22 @@ jobs:
1515
repo-token: ${{ secrets.GITHUB_TOKEN }}
1616
repo-token-user-login: 'github-actions[bot]'
1717
message: |
18-
You can view the generated tutorials of this PR on https://www.katacoda.com/devonfw-dev in a few minutes. You just have to wait for the next run of the deployment action https://github.com/devonfw-tutorials/katacoda-scenarios-dev/actions
18+
Thanks for submitting your work on a (new) tutorial!
19+
20+
Some suggestions, which might help:
21+
22+
- Title: Focus on what you want to train in a few words. Don't be too generic
23+
- Tutorial:
24+
- Address the user directly.
25+
- Explain why the steps are necessary.
26+
- Explain what are the results and why are they necessary for your next step.
27+
- Forward the user to more elaborate documentation on the website (deep links) for further reading
28+
29+
Also please find further help for creating tutorials [here](https://www.katacoda.com/devonfw/scenarios/create-your-own-tutorial) or more help regarding the tutorial syntax [here](https://github.com/devonfw-tutorials/tutorials/wiki/Development).
30+
31+
You can view the generated tutorials of this PR [here](https://www.katacoda.com/devonfw-dev) in a few minutes. You just have to wait for the run of the [deployment action](https://github.com/devonfw-tutorials/katacoda-scenarios-dev/actions) to finish.
32+
33+
When you think you are done writing the tutorial try the tutorial on the [deveplopment area](https://www.katacoda.com/devonfw-dev) and check if you explained every step in a way someone who is trying to learn what you are teaching can understand. Ideally ask someone to have a look on what you have done and have that part double checked because this is very important.
1934
2035
- name: Repository dispatch
2136
uses: peter-evans/repository-dispatch@v1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
import { HomeComponent } from './pages/home/home.component';
4+
import { DataComponent } from './pages/data/data.component';
5+
6+
const routes: Routes = [
7+
{ path: '', component: HomeComponent },
8+
{ path: 'data', component: DataComponent }
9+
];
10+
11+
@NgModule({
12+
imports: [RouterModule.forRoot(routes)],
13+
exports: [RouterModule]
14+
})
15+
export class AppRoutingModule { }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.menu {
2+
margin-right: auto;
3+
}
4+
mat-sidenav-container {
5+
position: absolute;
6+
top: 64px;
7+
left: 0;
8+
right: 0;
9+
bottom: 0;
10+
a.active {
11+
background: #8e8d8d;
12+
color: #fff;
13+
14+
p {
15+
color: #4a4a4a;
16+
}
17+
}
18+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<mat-toolbar color="primary">
2+
<button mat-icon-button aria-label="menu" class="menu" (click)="sidenav.toggle()">
3+
<mat-icon>menu</mat-icon>
4+
</button>
5+
<button mat-button [matMenuTriggerFor]="submenu">Menu 1</button>
6+
<button mat-button>Menu 2</button>
7+
<button mat-button>Menu 3</button>
8+
9+
<mat-menu #submenu="matMenu">
10+
<button mat-menu-item>Sub-menu 1</button>
11+
<button mat-menu-item [matMenuTriggerFor]="submenu2">Sub-menu 2</button>
12+
</mat-menu>
13+
14+
<mat-menu #submenu2="matMenu">
15+
<button mat-menu-item>Menu Item 1</button>
16+
<button mat-menu-item>Menu Item 2</button>
17+
<button mat-menu-item>Menu Item 3</button>
18+
</mat-menu>
19+
20+
</mat-toolbar>
21+
<mat-sidenav-container>
22+
<mat-sidenav [disableClose]="false" mode="over" #sidenav>
23+
<mat-nav-list>
24+
<a
25+
id="home"
26+
mat-list-item
27+
[routerLink]="['./']"
28+
(click)="sidenav.close()"
29+
routerLinkActive="active"
30+
[routerLinkActiveOptions]="{exact: true}"
31+
>
32+
<mat-icon matListAvatar>home</mat-icon>
33+
<h3 matLine>Home</h3>
34+
<p matLine>sample home page</p>
35+
</a>
36+
<a
37+
id="sampleData"
38+
mat-list-item
39+
[routerLink]="['./data']"
40+
(click)="sidenav.close()"
41+
routerLinkActive="active"
42+
>
43+
<mat-icon matListAvatar>grid_on</mat-icon>
44+
<h3 matLine>Data</h3>
45+
<p matLine>sample data page</p>
46+
</a>
47+
</mat-nav-list>
48+
</mat-sidenav>
49+
<mat-sidenav-content>
50+
<router-outlet></router-outlet>
51+
</mat-sidenav-content>
52+
</mat-sidenav-container>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<mat-toolbar color="primary">
2+
<button mat-icon-button aria-label="menu" class="menu">
3+
<mat-icon>menu</mat-icon>
4+
</button>
5+
<button mat-button [matMenuTriggerFor]="submenu">Menu 1</button>
6+
<button mat-button>Menu 2</button>
7+
<button mat-button>Menu 3</button>
8+
9+
<mat-menu #submenu="matMenu">
10+
<button mat-menu-item>Sub-menu 1</button>
11+
<button mat-menu-item [matMenuTriggerFor]="submenu2">Sub-menu 2</button>
12+
</mat-menu>
13+
14+
<mat-menu #submenu2="matMenu">
15+
<button mat-menu-item>Menu Item 1</button>
16+
<button mat-menu-item>Menu Item 2</button>
17+
<button mat-menu-item>Menu Item 3</button>
18+
</mat-menu>
19+
20+
</mat-toolbar>
21+
<router-outlet></router-outlet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.menu {
2+
margin-right: auto;
3+
}
4+
mat-sidenav-container {
5+
position: absolute;
6+
top: 64px;
7+
left: 0;
8+
right: 0;
9+
bottom: 0;
10+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<mat-toolbar color="primary">
2+
<button mat-icon-button aria-label="menu" class="menu" (click)="sidenav.toggle()">
3+
<mat-icon>menu</mat-icon>
4+
</button>
5+
<button mat-button [matMenuTriggerFor]="submenu">Menu 1</button>
6+
<button mat-button>Menu 2</button>
7+
<button mat-button>Menu 3</button>
8+
9+
<mat-menu #submenu="matMenu">
10+
<button mat-menu-item>Sub-menu 1</button>
11+
<button mat-menu-item [matMenuTriggerFor]="submenu2">Sub-menu 2</button>
12+
</mat-menu>
13+
14+
<mat-menu #submenu2="matMenu">
15+
<button mat-menu-item>Menu Item 1</button>
16+
<button mat-menu-item>Menu Item 2</button>
17+
<button mat-menu-item>Menu Item 3</button>
18+
</mat-menu>
19+
20+
</mat-toolbar>
21+
<mat-sidenav-container>
22+
<mat-sidenav mode="over" [disableClose]="false" #sidenav>
23+
Sidenav
24+
</mat-sidenav>
25+
<mat-sidenav-content>
26+
<router-outlet></router-outlet>
27+
</mat-sidenav-content>
28+
</mat-sidenav-container>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.menu {
2+
margin-right: auto;
3+
}

0 commit comments

Comments
 (0)