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

Add Prettier format script for consistent code formatting in UI files #20998

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ jobs:
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/ci/ui_ut_run.sh
df -h
- name: Fail if format changes are detected
if: ${{ failure() }}
run: |
echo "Code formatting issues detected. Please run 'npm run format' locally and commit the changes."
exit 1
- name: Codecov For UI
uses: codecov/codecov-action@v4
with:
Expand Down
27 changes: 19 additions & 8 deletions src/portal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"description": "Harbor UI with Clarity",
"angular-cli": {},
"scripts": {
"format": "prettier --write \"src/**/*.{ts,js,html,scss}\" && ng lint --fix",
"prettier:check": "prettier --check \"src/**/*.{ts,js,html,scss}\"",
"postinstall": "node scripts/convert-yaml-to-json.js && ng-swagger-gen -i ng-swagger-gen/swagger.json -o ng-swagger-gen && node scripts/delete-swagger-json.js",
"start": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0",
"start:prod": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0 --configuration production",
Expand Down Expand Up @@ -62,6 +64,7 @@
"@angular/cli": "^16.2.16",
"@angular/compiler-cli": "^16.2.9",
"@cypress/schematic": "^2.5.2",
"@types/eslint": "^9.6.1",
"@types/express": "^4.17.21",
"@types/jasmine": "~4.3.1",
"@types/node": "^16.18.108",
Expand Down
18 changes: 9 additions & 9 deletions src/portal/src/app/account/sign-in/sign-in.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
top: -9px;
}

.bg{
.bg {
position: absolute;
top: 60px;
top: 60px;
right: 0;
width: 100%;
height: 100%;
width: 100%;
height: 100%;
background-size: cover;
}

.login-wrapper {
flex-wrap: wrap;

.login {
background:transparent;
background: transparent;
}
}

.reset-label {
font-size:inherit;
color:inherit;
font-size: inherit;
color: inherit;
font-family: inherit;
}

Expand Down Expand Up @@ -90,13 +90,13 @@

.title {
position: absolute;
top: 10rem
top: 10rem;
}

.login-group {
width: 70%;
position: absolute;
top: 10rem
top: 10rem;
}

.more-info {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
.pop-repos {
margin-top: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ clr-modal {
padding-right: 3px;
}

bottom: 9px;
bottom: 9px;
}

.label-inner-text{
.label-inner-text {
margin: 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,36 @@
word-break: break-all;
}
/* stylelint-disable */
.batchInfoUl{
padding: 20px; list-style-type: none;
.batchInfoUl {
padding: 20px;
list-style-type: none;
}
.batchInfoUl li {
line-height: 24px;
border-bottom: 1px solid #e8e8e8;
}
.batchInfoUl li {line-height: 24px;border-bottom: 1px solid #e8e8e8;}

.batchInfoUl li span:first-child {padding-right: 20px; width: 240px; display: inline-block; color:#666;
text-overflow: ellipsis; overflow: hidden; vertical-align: middle;}
.batchInfoUl li span:last-child {width: 220px; display: inline-block; color:#666;}
.batchInfoUl li span i {display: inline-block; line-height: 1.2em; font-size: 0.8em; color: #999;}
.batchInfoUl li span a{cursor: pointer; text-decoration: underline;}
.batchInfoUl li span:first-child {
padding-right: 20px;
width: 240px;
display: inline-block;
color: #666;
text-overflow: ellipsis;
overflow: hidden;
vertical-align: middle;
}
.batchInfoUl li span:last-child {
width: 220px;
display: inline-block;
color: #666;
}
.batchInfoUl li span i {
display: inline-block;
line-height: 1.2em;
font-size: 0.8em;
color: #999;
}
.batchInfoUl li span a {
cursor: pointer;
text-decoration: underline;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
position: relative !important;
}

.content-container{
.content-container {
position: relative;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.history-header {
margin:20px 0 6px;
margin: 20px 0 6px;
display: inline-block;
width: 97%;
}
Expand All @@ -15,6 +15,6 @@
cursor: pointer;

&:hover {
color: #007CBB;
color: #007cbb;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.gc-start-btn {
width:150px;
width: 150px;
margin-top: 35px;
}

Expand Down Expand Up @@ -48,6 +48,6 @@
}

.p-06 {
padding-left: .6rem;
padding-right: .6rem;
padding-left: 0.6rem;
padding-right: 0.6rem;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.history-header {
margin:20px 0 6px;
margin: 20px 0 6px;
display: inline-block;
width: 97%;
}
Expand All @@ -15,7 +15,7 @@
cursor: pointer;

&:hover {
color: #007CBB;
color: #007cbb;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.gc-start-btn {
width:150px;
width: 150px;
margin-top: 35px;
}

Expand Down Expand Up @@ -32,8 +32,8 @@
}

.p-06 {
padding-left: .6rem;
padding-right: .6rem;
padding-left: 0.6rem;
padding-right: 0.6rem;
}

.worker-select {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.oidc-tip {
color: rgb(10 10 10);
margin-top: 1rem;
Expand All @@ -13,5 +12,5 @@
}

.clr-control-label {
width: 10.6rem !important;
width: 10.6rem !important;
}
Loading
Loading