Skip to content

Commit bbc3700

Browse files
committed
fix: not use pug
1 parent e0ad2b2 commit bbc3700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+657
-477
lines changed

jest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module.exports = {
88
testMatch: ['**/__tests__/**/*.+(ts|js)?(x)', '**/+(*.)+(spec|test).+(ts|js)?(x)'],
99
setupTestFrameworkScriptFile: '<rootDir>/node_modules/@angular-builders/jest/src/jest-config/setup.js',
1010
transform: {
11-
'^.+\\.(ts|html)$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
12-
'\\.(pug)$': '<rootDir>/node_modules/pug-jest'
11+
'^.+\\.(ts|html)$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js'
1312
},
1413
transformIgnorePatterns: ['node_modules/(?!@ngrx)'],
1514
moduleDirectories: [

package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
"test": "ng test",
1010
"lint": "npm run lint:ts && npm run lint:style",
1111
"e2e": "ng e2e",
12-
"postinstall": "node ./scripts/pug-rule-insert.js",
1312
"color-less": "node scripts/color-less.js",
1413
"lint:ts": "ng lint",
1514
"lint:style": "stylelint \"{src}/**/*.less\" --syntax less",
1615
"lint-staged": "lint-staged",
17-
"tslint-check": "tslint-config-prettier-check ./tslint.json",
1816
"hmr": "npm run color-less && ng serve -c=hmr",
1917
"test:coverage": "jest --runInBand --coverage",
2018
"test:snapshot": "jest --coverage -u",
@@ -44,6 +42,7 @@
4442
"ng-zorro-antd": "7.0.0-rc.3",
4543
"rxjs": "6.3.3",
4644
"screenfull": "4.0.0",
45+
"tslib": "1.9.3",
4746
"zone.js": "0.8.26"
4847
},
4948
"devDependencies": {
@@ -71,15 +70,12 @@
7170
"prettier": "1.15.3",
7271
"prettier-stylelint": "0.4.2",
7372
"protractor": "5.4.2",
74-
"pug": "2.0.3",
75-
"pug-jest": "1.0.1",
76-
"pug-loader": "2.4.0",
7773
"stylelint": "9.9.0",
7874
"stylelint-config-prettier": "4.0.0",
7975
"ts-node": "7.0.1",
80-
"tslint": "5.12.0",
76+
"tslint": "5.12.1",
8177
"typescript": "3.2.2",
82-
"webpack": "4.28.2"
78+
"webpack": "4.28.4"
8379
},
8480
"husky": {
8581
"hooks": {
@@ -93,12 +89,12 @@
9389
"git add"
9490
],
9591
"*.ts": [
96-
"ng lint --fix",
92+
"tslint --fix",
9793
"prettier --write",
9894
"git add"
9995
],
10096
"*.less": [
101-
"stylelint \"{src}/**/*.less\" --syntax less",
97+
"stylelint --fix --syntax less",
10298
"prettier --write",
10399
"git add"
104100
],

scripts/pug-rule-insert.js

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
<div class="alain-default__content-title">
3+
<h1>Page Name<small>Welcome !</small></h1>
4+
</div>

src/app/components/dashboard/dashboard.component.pug

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/components/dashboard/dashboard.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ import { _HttpClient } from '@delon/theme';
33

44
@Component({
55
selector: 'app-dashboard',
6-
templateUrl: './dashboard.component.pug',
6+
templateUrl: './dashboard.component.html'
77
})
88
export class DashboardComponent implements OnInit {
9+
constructor(private http: _HttpClient) {}
910

10-
constructor(
11-
private http: _HttpClient
12-
) { }
13-
14-
ngOnInit() {
15-
}
16-
11+
ngOnInit() {}
1712
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
<div class="ant-card width-lg" style="margin: 0 auto;">
3+
<div class="ant-card-body">
4+
<div class="avatar">
5+
<nz-avatar [nzSrc]="settings.user.avatar" nzIcon="anticon anticon-user" nzSize="large"></nz-avatar>
6+
</div>
7+
<form class="mt-md" nz-form="nz-form" [formGroup]="f" (ngSubmit)="submit()" role="form">
8+
<nz-form-item>
9+
<nz-form-control>
10+
<nz-input-group nzsuffixicon="anticon anticon-lock">
11+
<input type="password" nz-input="nz-input" formControlName="password"/>
12+
</nz-input-group>
13+
<nz-form-explain *ngIf="f.get('password').dirty &amp;&amp; f.get('password').errors">请输入密码!</nz-form-explain>
14+
</nz-form-control>
15+
</nz-form-item>
16+
<nz-row nzType="flex" nzAlign="middle">
17+
<nz-col [nzOffset]="12" [nzSpan]="12" style="text-align:right;">
18+
<button nz-button="nz-button" [disabled]="!f.valid" nzType="primary">锁屏</button>
19+
</nz-col>
20+
</nz-row>
21+
</form>
22+
</div>
23+
</div>

src/app/components/passport/lock/lock.component.pug

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/app/components/passport/lock/lock.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import { SettingsService } from '@delon/theme';
55

66
@Component({
77
selector: 'passport-lock',
8-
templateUrl: './lock.component.pug',
9-
styleUrls: [ './lock.component.less' ]
8+
templateUrl: './lock.component.html',
9+
styleUrls: ['./lock.component.less']
1010
})
1111
export class UserLockComponent {
1212
f: FormGroup;
1313

1414
constructor(
1515
fb: FormBuilder,
1616
public settings: SettingsService,
17-
private router: Router,
17+
private router: Router
1818
) {
1919
this.f = fb.group({
20-
password: [null, Validators.required],
20+
password: [null, Validators.required]
2121
});
2222
}
2323

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
<form nz-form="nz-form" [formGroup]="form" (ngSubmit)="submit()" role="form">
3+
<nz-tabset class="tabs" [nzAnimated]="false" (nzSelectChange)="switch($event)">
4+
<nz-tab nzTitle="账户密码登录">
5+
<nz-alert class="mb-lg" *ngIf="error" nzType="error" nzMessage="error" nzShowIcon="true"></nz-alert>
6+
<nz-form-item>
7+
<nz-form-control>
8+
<nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-user">
9+
<input nz-input="nz-input" formControlName="userName" placeholder="username: admin or user"/>
10+
</nz-input-group>
11+
<nz-form-explain *ngIf="userName.dirty &amp;&amp; userName.errors">Please enter mobile number!</nz-form-explain>
12+
</nz-form-control>
13+
</nz-form-item>
14+
<nz-form-item>
15+
<nz-form-control>
16+
<nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-lock">
17+
<input nz-input="nz-input" type="password" formControlName="password" placeholder="password: ng-alain.com"/>
18+
</nz-input-group>
19+
<nz-form-explain *ngIf="password.dirty &amp;&amp; password.errors">Please enter password!</nz-form-explain>
20+
</nz-form-control>
21+
</nz-form-item>
22+
</nz-tab>
23+
<nz-tab nzTitle="手机号登录">
24+
<nz-form-item>
25+
<nz-form-control>
26+
<nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-user">
27+
<input nz-input="nz-input" formControlName="mobile" placeholder="mobile number"/>
28+
</nz-input-group>
29+
<nz-form-explain *ngIf="mobile.dirty &amp;&amp; mobile.errors">
30+
<ng-container *ngIf="mobile.errors.required">请输入手机号</ng-container>
31+
<ng-container *ngIf="mobile.errors.pattern">手机号格式错误</ng-container>
32+
</nz-form-explain>
33+
</nz-form-control>
34+
</nz-form-item>
35+
<nz-form-item>
36+
<nz-form-control>
37+
<nz-row [nzGutter]="8">
38+
<nz-col [nzSpan]="16">
39+
<nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-mail">
40+
<input nz-input="nz-input" formControlName="captcha" placeholder="captcha"/>
41+
</nz-input-group>
42+
<nz-form-explain *ngIf="captcha.dirty &amp;&amp; captcha.errors">请输入验证码!</nz-form-explain>
43+
</nz-col>
44+
<nz-col [nzSpan]="8">
45+
<button type="button" nz-button="nz-button" nzSize="large" (click)="getCaptcha()" [disabled]="count" nzblock="nzblock" [nzLoading]="http.loading">{{ count ? count + 's' : '获取验证码'}}</button>
46+
</nz-col>
47+
</nz-row>
48+
</nz-form-control>
49+
</nz-form-item>
50+
</nz-tab>
51+
</nz-tabset>
52+
<nz-form-item>
53+
<nz-col [nzSpan]="12">
54+
<label nz-checkbox="nz-checkbox" formControlName="remember">自动登录</label>
55+
</nz-col>
56+
<nz-col class="text-right" [nzSpan]="12"><a class="forgot" (click)="msg.error('请找欧阳锋')">忘记密码</a></nz-col>
57+
</nz-form-item>
58+
<nz-form-item>
59+
<button nz-button="nz-button" type="submit" nzType="primary" nzSize="large" [nzLoading]="http.loading" nzblock="nzblock">登录</button>
60+
</nz-form-item>
61+
</form>
62+
<div class="other">其他登录方式<i class="icon" title="in fact Auth0 via window" (click)="open('auth0', 'window')" nz-icon="nz-icon" type="alipay-circle"></i><i class="icon" title="in fact Github via redirect" (click)="open('taobao')" nz-icon="nz-icon" type="taobao-circle"></i><i class="icon" title="真的是微博" (click)="open('weibo', 'window')" nz-icon="nz-icon" type="weibo-circle"></i><a class="register" routerLink="/passport/register">注册账户</a></div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy