mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 13:45:20 +01:00
Upgrade Clarity to 0.10.x and Angular To 4.3.0
This commit is contained in:
parent
7c510fa2c8
commit
3187dcb5ae
@ -79,7 +79,7 @@ script:
|
||||
- sudo mkdir -p /harbor
|
||||
- sudo mv ./VERSION /harbor/VERSION
|
||||
- sudo service mysql stop
|
||||
- sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.7
|
||||
- sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.3.0
|
||||
- cat ./src/ui_ng/lib/npm-ut-test-results
|
||||
- sudo ./tests/testprepare.sh
|
||||
- sudo make -f make/photon/Makefile -e MARIADBVERSION=10.2.10 -e VERSIONTAG=dev
|
||||
@ -106,7 +106,7 @@ script:
|
||||
- sudo rm -rf /data/config/*
|
||||
- sudo rm -rf /data/database/*
|
||||
- ls /data/cert
|
||||
- sudo make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.2.7 NOTARYFLAG=true CLAIRFLAG=true
|
||||
- sudo make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.3.0 NOTARYFLAG=true CLAIRFLAG=true
|
||||
- sleep 10
|
||||
- docker ps
|
||||
- ./tests/validatecontainers.sh
|
||||
|
@ -6,6 +6,12 @@ RUN mkdir -p /harbor_src
|
||||
COPY src/ui_ng/package.json /harbor_resources
|
||||
COPY make/dev/nodeclarity/entrypoint.sh /
|
||||
|
||||
# Install Chrome
|
||||
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
|
||||
RUN apt-get update && apt-get -y install google-chrome-stable
|
||||
|
||||
# Install npm package
|
||||
WORKDIR /harbor_resources
|
||||
|
||||
RUN npm __proxy__ install -g @angular/cli && \
|
||||
|
@ -7,7 +7,7 @@ module.exports = function (config) {
|
||||
frameworks: ['jasmine', 'angular-cli'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-phantomjs-launcher'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-mocha-reporter'),
|
||||
require('karma-remap-istanbul'),
|
||||
require('angular-cli/plugins/karma')
|
||||
@ -38,7 +38,13 @@ module.exports = function (config) {
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['PhantomJS'],
|
||||
browsers: ['ChromeHeadlessNoSandbox'],
|
||||
customLaunchers: {
|
||||
ChromeHeadlessNoSandbox: {
|
||||
base: 'ChromeHeadless',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
singleRun: true
|
||||
});
|
||||
};
|
||||
|
@ -7,7 +7,7 @@ module.exports = function (config) {
|
||||
frameworks: ['jasmine', '@angular/cli'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-phantomjs-launcher'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-mocha-reporter'),
|
||||
require('karma-remap-istanbul'),
|
||||
require('@angular/cli/plugins/karma')
|
||||
@ -38,7 +38,13 @@ module.exports = function (config) {
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['PhantomJS'],
|
||||
browsers: ['ChromeHeadlessNoSandbox'],
|
||||
customLaunchers: {
|
||||
ChromeHeadlessNoSandbox: {
|
||||
base: 'ChromeHeadless',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
singleRun: true
|
||||
});
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harbor-ui",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.2",
|
||||
"description": "Harbor shared UI components based on Clarity and Angular4",
|
||||
"scripts": {
|
||||
"start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json",
|
||||
@ -17,21 +17,21 @@
|
||||
"build": "npm run cleanup && npm run transpile && npm run package && npm run minify && npm run copy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "~4.1.3",
|
||||
"@angular/common": "~4.1.3",
|
||||
"@angular/compiler": "~4.1.3",
|
||||
"@angular/core": "~4.1.3",
|
||||
"@angular/forms": "~4.1.3",
|
||||
"@angular/http": "~4.1.3",
|
||||
"@angular/platform-browser": "~4.1.3",
|
||||
"@angular/platform-browser-dynamic": "~4.1.3",
|
||||
"@angular/router": "~4.1.3",
|
||||
"@angular/animations": "^4.3.0",
|
||||
"@angular/common": "^4.3.0",
|
||||
"@angular/compiler": "^4.3.0",
|
||||
"@angular/core": "^4.3.0",
|
||||
"@angular/forms": "^4.3.0",
|
||||
"@angular/http": "^4.3.0",
|
||||
"@angular/platform-browser": "^4.3.0",
|
||||
"@angular/platform-browser-dynamic": "^4.3.0",
|
||||
"@angular/router": "^4.3.0",
|
||||
"@ngx-translate/core": "^6.0.0",
|
||||
"@ngx-translate/http-loader": "0.0.3",
|
||||
"@webcomponents/custom-elements": "1.0.0-alpha.3",
|
||||
"clarity-angular": "^0.9.8",
|
||||
"clarity-icons": "^0.9.8",
|
||||
"clarity-ui": "^0.9.8",
|
||||
"@webcomponents/custom-elements": "^1.0.0",
|
||||
"clarity-angular": "^0.10.17",
|
||||
"clarity-icons": "^0.10.17",
|
||||
"clarity-ui": "^0.10.17",
|
||||
"core-js": "^2.4.1",
|
||||
"intl": "^1.2.5",
|
||||
"mutationobserver-shim": "^0.3.2",
|
||||
@ -42,31 +42,30 @@
|
||||
"zone.js": "^0.8.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "^1.0.0",
|
||||
"@angular/compiler-cli": "~4.1.3",
|
||||
"@angular/cli": "1.4.0",
|
||||
"@angular/compiler-cli": "^4.3.0",
|
||||
"@types/core-js": "^0.9.41",
|
||||
"@types/jasmine": "~2.2.30",
|
||||
"@types/node": "^6.0.42",
|
||||
"@types/jasmine": "~2.5.53",
|
||||
"@types/node": "~6.0.60",
|
||||
"bootstrap": "4.0.0-alpha.5",
|
||||
"codelyzer": "~2.0.0-beta.4",
|
||||
"codelyzer": "~3.1.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"enhanced-resolve": "^3.0.0",
|
||||
"jasmine-core": "2.4.1",
|
||||
"jasmine-spec-reporter": "2.5.0",
|
||||
"karma": "1.2.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-jasmine": "^1.0.2",
|
||||
"karma-mocha-reporter": "^2.2.1",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"jasmine-core": "~2.6.2",
|
||||
"jasmine-spec-reporter": "~4.1.0",
|
||||
"karma": "~1.7.0",
|
||||
"karma-chrome-launcher": "~2.1.1",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-mocha-reporter": "^2.2.4",
|
||||
"karma-remap-istanbul": "^0.2.1",
|
||||
"protractor": "^4.0.9",
|
||||
"rimraf": "^2.6.1",
|
||||
"rollup": "^0.41.6",
|
||||
"rollup-plugin-node-resolve": "^3.0.0",
|
||||
"ts-node": "1.2.1",
|
||||
"tslint": "^4.1.1",
|
||||
"typescript": "~2.2.0",
|
||||
"ts-node": "~3.2.0",
|
||||
"tslint": "~5.7.0",
|
||||
"typescript": "~2.3.3",
|
||||
"typings": "^1.4.0",
|
||||
"uglify-js": "^2.8.22",
|
||||
"webdriver-manager": "10.2.5"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harbor-ui",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.2",
|
||||
"description": "Harbor shared UI components based on Clarity and Angular4",
|
||||
"author": "VMware",
|
||||
"module": "index.js",
|
||||
@ -19,21 +19,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/vmware/harbor#readme",
|
||||
"peerDependencies": {
|
||||
"@angular/animations": "^4.0.1",
|
||||
"@angular/common": "^4.0.1",
|
||||
"@angular/compiler": "^4.0.1",
|
||||
"@angular/core": "^4.0.1",
|
||||
"@angular/forms": "^4.0.1",
|
||||
"@angular/http": "^4.0.1",
|
||||
"@angular/platform-browser": "^4.0.1",
|
||||
"@angular/platform-browser-dynamic": "^4.0.1",
|
||||
"@angular/router": "^4.0.1",
|
||||
"@angular/animations": "^4.3.0",
|
||||
"@angular/common": "^4.3.0",
|
||||
"@angular/compiler": "^4.3.0",
|
||||
"@angular/core": "^4.3.0",
|
||||
"@angular/forms": "^4.3.0",
|
||||
"@angular/http": "^4.3.0",
|
||||
"@angular/platform-browser": "^4.3.0",
|
||||
"@angular/platform-browser-dynamic": "^4.3.0",
|
||||
"@angular/router": "^4.3.0",
|
||||
"@ngx-translate/core": "^6.0.0",
|
||||
"@ngx-translate/http-loader": "0.0.3",
|
||||
"@webcomponents/custom-elements": "1.0.0-alpha.3",
|
||||
"clarity-angular": "^0.9.8",
|
||||
"clarity-icons": "^0.9.8",
|
||||
"clarity-ui": "^0.9.8",
|
||||
"@webcomponents/custom-elements": "^1.0.0",
|
||||
"clarity-angular": "^0.10.17",
|
||||
"clarity-icons": "^0.10.17",
|
||||
"clarity-ui": "^0.10.17",
|
||||
"core-js": "^2.4.1",
|
||||
"intl": "^1.2.5",
|
||||
"mutationobserver-shim": "^0.3.2",
|
||||
|
@ -4,23 +4,23 @@ export const VULNERABILITY_CONFIG_HTML: string = `
|
||||
<label class="section-title" *ngIf="showSubTitle">{{ 'CONFIG.SCANNING.TITLE' | translate }}</label>
|
||||
<div class="form-group">
|
||||
<label>{{ 'CONFIG.SCANNING.DB_REFRESH_TIME' | translate }}</label>
|
||||
<clr-tooltip *ngIf="!isClairDBFullyReady" [clrTooltipDirection]="'top-right'" [clrTooltipSize]="'md'">
|
||||
<clr-tooltip *ngIf="!isClairDBFullyReady">
|
||||
<clr-icon shape="warning" class="is-warning" size="22"></clr-icon>
|
||||
<clr-tooltip-content>
|
||||
<clr-tooltip-content [clrPosition]="'top-right'" [clrSize]="'md'" *clrIfOpen>
|
||||
<span>{{'CONFIG.SCANNING.DB_NOT_READY' | translate }}</span>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
<clr-dropdown *ngIf="isClairDBFullyReady && showScanningNamespaces" [clrMenuPosition]="'bottom-right'" style="margin-top:-8px;" class="clr-dropdown-override">
|
||||
<clr-dropdown *ngIf="isClairDBFullyReady && showScanningNamespaces" style="margin-top:-8px;" class="clr-dropdown-override">
|
||||
<button class="btn btn-link btn-font" clrDropdownToggle>
|
||||
{{ updatedTimestamp | date:'MM/dd/y HH:mm:ss' }}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<div class="dropdown-menu" style="min-width:300px;">
|
||||
<clr-dropdown-menu [clrPosition]="'bottom-right'" style="min-width:300px;">
|
||||
<div *ngFor="let nt of namespaceTimestamps" class="namespace">
|
||||
<span class="label label-info">{{nt.namespace}}</span>
|
||||
<span>{{ convertToLocalTime(nt.last_update) | date:'MM/dd/y HH:mm:ss'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</clr-dropdown-menu>
|
||||
</clr-dropdown>
|
||||
<span class="label label-blue" *ngIf="isClairDBFullyReady && !showScanningNamespaces">{{ updatedTimestamp | date:'MM/dd/y HH:mm:ss' }}</span>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@ export const CREATE_EDIT_ENDPOINT_TEMPLATE: string = `
|
||||
<hbr-inline-alert class="modal-title" (confirmEvt)="confirmCancel($event)"></hbr-inline-alert>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning" *ngIf="!editable">
|
||||
<div class="alert-item">
|
||||
<div class="alert-item static">
|
||||
<span class="alert-text">
|
||||
{{'DESTINATION.CANNOT_EDIT' | translate}}
|
||||
</span>
|
||||
|
@ -71,21 +71,21 @@ describe('CreateEditEndpointComponent (inline template)', () => {
|
||||
expect(comp).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should get endpoint be called', async(()=>{
|
||||
it('should get endpoint be called', ()=>{
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(()=>{
|
||||
fixture.detectChanges();
|
||||
expect(spy.calls.any()).toBeTruthy();
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
it('should get endpoint and open modal', async(()=>{
|
||||
it('should get endpoint and open modal', ()=>{
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(()=>{
|
||||
fixture.detectChanges();
|
||||
expect(comp.target.name).toEqual('target_01');
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
it('should endpoint be initialized', () => {
|
||||
fixture.detectChanges();
|
||||
|
@ -6,7 +6,10 @@ export const CREATE_EDIT_RULE_TEMPLATE: string = `
|
||||
<form #ruleForm="ngForm">
|
||||
<section class="form-block">
|
||||
<div class="alert alert-warning" *ngIf="!editable">
|
||||
<div class="alert-item">
|
||||
<div class="alert-item static">
|
||||
<div class="alert-icon-wrapper">
|
||||
<clr-icon class="alert-icon" shape="exclamation-circle"></clr-icon>
|
||||
</div>
|
||||
<span class="alert-text">
|
||||
{{'REPLICATION.CANNOT_EDIT' | translate}}
|
||||
</span>
|
||||
|
@ -1,4 +1,4 @@
|
||||
export const COPY_INPUT_HTML: string = `
|
||||
export const COPY_INPUT_HTML = `
|
||||
<div>
|
||||
<div class="command-title" *ngIf="!iconMode">
|
||||
{{headerTitle}}
|
||||
@ -14,6 +14,5 @@ export const COPY_INPUT_HTML: string = `
|
||||
<clr-icon shape="copy" [class.is-success]="isCopied" [class.is-error]="hasCopyError" class="info-tips-icon" size="24" [ngxClipboard]="inputTarget1" (cbOnSuccess)="onSuccess($event)" (cbOnError)="onError($event)"></clr-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`;
|
@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { DebugElement } from '@angular/core';
|
||||
@ -33,8 +33,8 @@ describe('PushImageButtonComponent (inline template)', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PushImageButtonComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.projectName = "testing";
|
||||
component.registryUrl = "https://testing.harbor.com"
|
||||
component.projectName = 'testing';
|
||||
component.registryUrl = 'https://testing.harbor.com'
|
||||
serviceConfig = TestBed.get(SERVICE_CONFIG);
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -44,7 +44,7 @@ describe('PushImageButtonComponent (inline template)', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should open the drop-down panel', async(() => {
|
||||
it('should open the drop-down panel', fakeAsync(() => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -54,10 +54,12 @@ describe('PushImageButtonComponent (inline template)', () => {
|
||||
|
||||
fixture.detectChanges();
|
||||
let copyInputs: HTMLInputElement[] = fixture.nativeElement.querySelectorAll('.command-input');
|
||||
expect(copyInputs.length).toEqual(2);
|
||||
|
||||
expect(copyInputs[0].value.trim()).toEqual(`docker tag SOURCE_IMAGE[:TAG] ${component.registryUrl}/${component.projectName}/IMAGE[:TAG]`);
|
||||
expect(copyInputs[1].value.trim()).toEqual(`docker push ${component.registryUrl}/${component.projectName}/IMAGE[:TAG]`);
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(copyInputs.length).toEqual(2);
|
||||
expect(copyInputs[0].value.trim()).toEqual(`docker tag SOURCE_IMAGE[:TAG] ${component.registryUrl}/${component.projectName}/IMAGE[:TAG]`);
|
||||
expect(copyInputs[1].value.trim()).toEqual(`docker push ${component.registryUrl}/${component.projectName}/IMAGE[:TAG]`);
|
||||
})
|
||||
});
|
||||
}));
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
export const PUSH_IMAGE_HTML: string = `
|
||||
<div>
|
||||
<clr-dropdown [clrMenuPosition]="'bottom-right'">
|
||||
<clr-dropdown>
|
||||
<button class="btn btn-link btn-font" clrDropdownToggle (click)="onclick()">
|
||||
{{ 'PUSH_IMAGE.TITLE' | translate | uppercase}}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<div class="dropdown-menu" style="min-width:500px;">
|
||||
{{ 'PUSH_IMAGE.TITLE' | translate | uppercase}}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<clr-dropdown-menu *clrIfOpen [clrPosition]="'bottom-right'" style="min-width:500px;">
|
||||
<div class="commands-container">
|
||||
<section>
|
||||
<span><h5 class="h5-override">{{ 'PUSH_IMAGE.TITLE' | translate }}</h5></span>
|
||||
<span>
|
||||
<clr-tooltip [clrTooltipDirection]="'top-right'" [clrTooltipSize]="'md'">
|
||||
<clr-icon shape="info-circle" class="info-tips-icon" size="24"></clr-icon>
|
||||
<clr-tooltip-content>
|
||||
<clr-tooltip>
|
||||
<clr-icon clrTooltipTrigger shape="info-circle" class="info-tips-icon" size="24"></clr-icon>
|
||||
<clr-tooltip-content [clrPosition]="'top-right'" [clrSize]="'md'" *clrIfOpen>
|
||||
{{ 'PUSH_IMAGE.TOOLTIP' | translate }}
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
</span>
|
||||
</section>
|
||||
@ -30,7 +30,7 @@ export const PUSH_IMAGE_HTML: string = `
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</clr-dropdown-menu>
|
||||
</clr-dropdown>
|
||||
</div>
|
||||
`;
|
@ -94,9 +94,10 @@ describe('ResultGridComponent (inline template)', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
|
||||
let de: DebugElement = fixture.debugElement.query(del => del.classes['datagrid-cell']);
|
||||
expect(de).toBeTruthy();
|
||||
let el: HTMLElement = de.nativeElement;
|
||||
// let de: DebugElement = fixture.debugElement.query(del => del.classes['datagrid-cell']);
|
||||
// expect(de).toBeTruthy();
|
||||
// let el: HTMLElement = de.nativeElement;
|
||||
let el: HTMLElement = fixture.nativeElement.querySelector('.datagrid-cell a');
|
||||
expect(el).toBeTruthy();
|
||||
expect(el.textContent.trim()).toEqual('CVE-2016-8859');
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ export const SCANNING_STYLES: string = `
|
||||
margin-left: -4px;
|
||||
}
|
||||
.tip-block {
|
||||
margin-left: -4px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
.bar-block-high {
|
||||
background-color: #e62700;
|
||||
|
@ -1,12 +1,14 @@
|
||||
export const TIP_COMPONENT_HTML: string = `
|
||||
<div class="tip-wrapper tip-position" [style.width]='maxWidth'>
|
||||
<clr-tooltip [clrTooltipDirection]="'top-right'" [clrTooltipSize]="'lg'">
|
||||
<clr-tooltip>
|
||||
<div clrTooltipTrigger>
|
||||
<div class="tip-wrapper tip-block bar-block-high" [style.width]='tipWidth(5)'></div>
|
||||
<div class="tip-wrapper tip-block bar-block-medium" [style.width]='tipWidth(4)'></div>
|
||||
<div class="tip-wrapper tip-block bar-block-low" [style.width]='tipWidth(3)'></div>
|
||||
<div class="tip-wrapper tip-block bar-block-unknown" [style.width]='tipWidth(2)'></div>
|
||||
<div class="tip-wrapper tip-block bar-block-none" [style.width]='tipWidth(1)'></div>
|
||||
<clr-tooltip-content>
|
||||
</div>
|
||||
<clr-tooltip-content [clrPosition]="'top-right'" [clrSize]="'lg'" *clrIfOpen>
|
||||
<div [ngSwitch]="scanLevel" class="bar-tooltip-font-larger">
|
||||
<ng-template [ngSwitchCase]="5">
|
||||
<clr-icon shape="exclamation-circle" class="is-error" size="32"></clr-icon>
|
||||
|
@ -18,14 +18,25 @@
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
false,
|
||||
140
|
||||
],
|
||||
"member-access": false,
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
{
|
||||
"order": [
|
||||
"public-static-field",
|
||||
"public-instance-field",
|
||||
"public-constructor",
|
||||
"private-static-field",
|
||||
"private-instance-field",
|
||||
"private-constructor",
|
||||
"public-instance-method",
|
||||
"protected-instance-method",
|
||||
"private-instance-method"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
|
@ -13,25 +13,25 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~4.1.3",
|
||||
"@angular/common": "~4.1.3",
|
||||
"@angular/compiler": "~4.1.3",
|
||||
"@angular/compiler-cli": "~4.1.3",
|
||||
"@angular/core": "~4.1.3",
|
||||
"@angular/forms": "~4.1.3",
|
||||
"@angular/http": "~4.1.3",
|
||||
"@angular/platform-browser": "~4.1.3",
|
||||
"@angular/platform-browser-dynamic": "~4.1.3",
|
||||
"@angular/router": "~4.1.3",
|
||||
"@angular/animations": "^4.3.0",
|
||||
"@angular/common": "^4.3.0",
|
||||
"@angular/compiler": "^4.3.0",
|
||||
"@angular/compiler-cli": "^4.3.0",
|
||||
"@angular/core": "^4.3.0",
|
||||
"@angular/forms": "^4.3.0",
|
||||
"@angular/http": "^4.3.0",
|
||||
"@angular/platform-browser": "^4.3.0",
|
||||
"@angular/platform-browser-dynamic": "^4.3.0",
|
||||
"@angular/router": "^4.3.0",
|
||||
"@ngx-translate/core": "^6.0.0",
|
||||
"@ngx-translate/http-loader": "0.0.3",
|
||||
"@types/jquery": "^2.0.41",
|
||||
"@webcomponents/custom-elements": "1.0.0-alpha.3",
|
||||
"clarity-angular": "^0.9.8",
|
||||
"clarity-icons": "^0.9.8",
|
||||
"clarity-ui": "^0.9.8",
|
||||
"@webcomponents/custom-elements": "^1.0.0",
|
||||
"clarity-angular": "^0.10.17",
|
||||
"clarity-icons": "^0.10.17",
|
||||
"clarity-ui": "^0.10.17",
|
||||
"core-js": "^2.4.1",
|
||||
"harbor-ui": "0.6.0",
|
||||
"harbor-ui": "0.6.2",
|
||||
"intl": "^1.2.5",
|
||||
"mutationobserver-shim": "^0.3.2",
|
||||
"ngx-cookie": "^1.0.0",
|
||||
@ -42,7 +42,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "^1.0.0",
|
||||
"@angular/compiler-cli": "~4.1.3",
|
||||
"@angular/compiler-cli": "^4.3.0",
|
||||
"@types/core-js": "^0.9.34",
|
||||
"@types/jasmine": "~2.2.30",
|
||||
"@types/node": "^6.0.42",
|
||||
@ -55,7 +55,6 @@
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-jasmine": "^1.0.2",
|
||||
"karma-mocha-reporter": "^2.2.1",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"karma-remap-istanbul": "^0.2.1",
|
||||
"protractor": "4.0.9",
|
||||
"rollup": "^0.41.6",
|
||||
|
@ -18,25 +18,25 @@
|
||||
<span style="padding-right: 8px;">{{currentLang}}</span>
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<clr-dropdown-menu *clrIfOpen>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)='switchLanguage("en-us")' [class.lang-selected]='matchLang("en-us")'>English</a>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)='switchLanguage("zh-cn")' [class.lang-selected]='matchLang("zh-cn")'>中文简体</a>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)='switchLanguage("es-es")' [class.lang-selected]='matchLang("es-es")'>Español</a>
|
||||
</div>
|
||||
</clr-dropdown-menu>
|
||||
</clr-dropdown>
|
||||
<clr-dropdown [clrMenuPosition]="'bottom-right'" class="dropdown" *ngIf="isSessionValid">
|
||||
<clr-dropdown class="dropdown" *ngIf="isSessionValid">
|
||||
<button class="nav-text" clrDropdownToggle>
|
||||
<clr-icon shape="user" class="is-inverse" size="24" style="left: -2px;"></clr-icon>
|
||||
<span>{{accountName}}</span>
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<clr-dropdown-menu [clrPosition]="'bottom-right'" *clrIfOpen>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)="openAccountSettingsModal()">{{'ACCOUNT_SETTINGS.PROFILE' | translate}}</a>
|
||||
<a *ngIf="canChangePassword" href="javascript:void(0)" clrDropdownItem (click)="openChangePwdModal()">{{'ACCOUNT_SETTINGS.CHANGE_PWD' | translate}}</a>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)="openAboutDialog()">{{'ACCOUNT_SETTINGS.ABOUT' | translate}}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="javascript:void(0)" clrDropdownItem (click)="logOut()">{{'ACCOUNT_SETTINGS.LOGOUT' | translate}}</a>
|
||||
</div>
|
||||
</clr-dropdown-menu>
|
||||
</clr-dropdown>
|
||||
<div class="nav-divider" *ngIf="!isSessionValid"></div>
|
||||
<a href="javascript:void(0)" id="aboutMenu" class="nav-link nav-text nav-about-link" (click)="openAboutDialog()" *ngIf="!isSessionValid">{{'ACCOUNT_SETTINGS.ABOUT' | translate}}</a>
|
||||
|
@ -10,18 +10,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row flex-items-xs-right option-right" [hidden]="currentOption === 0">
|
||||
<clr-dropdown [clrMenuPosition]="'bottom-left'">
|
||||
<clr-dropdown>
|
||||
<button class="btn btn-link" clrDropdownToggle>
|
||||
{{'AUDIT_LOG.OPERATIONS' | translate}}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
{{'AUDIT_LOG.OPERATIONS' | translate}}
|
||||
<clr-icon shape="caret down"></clr-icon>
|
||||
</button>
|
||||
<clr-dropdown-menu [clrPosition]="'bottom-left'" *clrIfOpen>
|
||||
<a href="javascript:void(0)" clrDropdownItem *ngFor="let f of filterOptions" (click)="toggleFilterOption(f.key)">
|
||||
<clr-icon shape="check" [hidden]="!f.checked"></clr-icon>
|
||||
<ng-template [ngIf]="!f.checked"><span style="display: inline-block;width: 16px;"></span></ng-template>
|
||||
{{f.description | translate}}
|
||||
</a>
|
||||
</div>
|
||||
</clr-dropdown-menu>
|
||||
</clr-dropdown>
|
||||
<div class="flex-xs-middle">
|
||||
<clr-icon shape="date"></clr-icon>
|
||||
|
@ -66,11 +66,11 @@ export class AuditLogComponent implements OnInit {
|
||||
new FilterOption('others', 'AUDIT_LOG.OTHERS', true)
|
||||
];
|
||||
|
||||
pageOffset: number = 1;
|
||||
pageSize: number = 15;
|
||||
totalRecordCount: number = 0;
|
||||
currentPage: number;
|
||||
totalPage: number;
|
||||
pageOffset = 1;
|
||||
pageSize = 15;
|
||||
totalRecordCount = 0;
|
||||
currentPage = 1;
|
||||
totalPage = 0;
|
||||
|
||||
@ViewChild('fromTime') fromTimeInput: NgModel;
|
||||
@ViewChild('toTime') toTimeInput: NgModel;
|
||||
|
@ -18,14 +18,25 @@
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
false,
|
||||
140
|
||||
],
|
||||
"member-access": false,
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
{
|
||||
"order": [
|
||||
"public-static-field",
|
||||
"public-instance-field",
|
||||
"public-constructor",
|
||||
"private-static-field",
|
||||
"private-instance-field",
|
||||
"private-constructor",
|
||||
"public-instance-method",
|
||||
"protected-instance-method",
|
||||
"private-instance-method"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
@ -67,7 +78,7 @@
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": [
|
||||
"always"
|
||||
true
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
|
@ -22,12 +22,12 @@ ${HARBOR_VERSION} v1.1.1
|
||||
*** Keywords ***
|
||||
Assign User Admin
|
||||
[Arguments] ${user}
|
||||
Click Element xpath=//clr-main-container//harbor-user//hbr-filter//clr-icon
|
||||
Input Text xpath=//harbor-shell/clr-main-container//harbor-user//hbr-filter//input ${user}
|
||||
Click Element xpath=//harbor-user//hbr-filter//clr-icon
|
||||
Input Text xpath=//harbor-user//hbr-filter//input ${user}
|
||||
Sleep 2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container/div/div/harbor-user/div/div/h2
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container//harbor-user//clr-datagrid//clr-dg-action-overflow
|
||||
Click Element xpath=//harbor-app/harbor-shell/clr-main-container//harbor-user//clr-datagrid//clr-dg-row//clr-dg-action-overflow//button[1]
|
||||
Click Element xpath=//harbor-user/div/div/h2
|
||||
Click Element xpath=//harbor-user//clr-datagrid//clr-dg-action-overflow
|
||||
Click Element xpath=//harbor-user//clr-dg-action-overflow//button[contains(.,'Admin')]
|
||||
Sleep 1
|
||||
|
||||
Switch to User Tag
|
||||
|
@ -39,8 +39,8 @@ Save Project Config
|
||||
Public Should Be Selected
|
||||
Checkbox Should Be Selected //hbr-project-policy-config//input[@name='public']
|
||||
Project Should Be Public
|
||||
[Arguments] ${projid}
|
||||
Page Should Contain Element //clr-dg-row-master[contains(.,'${projid}')]//clr-dg-cell[contains(.,'Public')]
|
||||
[Arguments] ${projectName}
|
||||
Page Should Contain Element //clr-dg-row[contains(.,'${projectName}')]//clr-dg-cell[contains(.,'Public')]
|
||||
Content Trust Should Be Selected
|
||||
Checkbox Should Be Selected //hbr-project-policy-config//input[@name='content-trust']
|
||||
Prevent Running Should Be Selected
|
||||
|
@ -28,28 +28,14 @@ Go Into Project
|
||||
Input Text xpath=//*[@id="search_input"] ${project}
|
||||
Sleep 8
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=//*[@id="results"]/list-project-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row[1]/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Click Element xpath=//*[@id="results"]/list-project-ro//clr-dg-cell[contains(.,"${project}")]/a
|
||||
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo_${project}.png
|
||||
|
||||
Go Into Project2
|
||||
[Arguments] ${project}
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo1_${project}.png
|
||||
# search icon
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/clr-icon/svg
|
||||
Sleep 2
|
||||
# text search project
|
||||
Input Text xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/div[2]/div[2]/hbr-filter/span/input ${project}
|
||||
Sleep 5
|
||||
Wait Until Page Contains ${project}
|
||||
Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/project/div/div/list-project/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[2]/a
|
||||
Sleep 3
|
||||
Capture Page Screenshot gointo2_${project}.png
|
||||
|
||||
Add User To Project Admin
|
||||
[Arguments] ${project} ${user}
|
||||
Go Into Project2
|
||||
Go Into Project
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
@ -79,7 +65,7 @@ Change Project Member Role
|
||||
Sleep 2
|
||||
Click Element xpath=${project_member_tag_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${user}')]//clr-dg-action-overflow
|
||||
Click Element xpath=//project-detail//clr-dg-row[contains(.,'${user}')]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//project-detail//clr-dg-action-overflow//button[contains(.,"${role}")]
|
||||
Sleep 2
|
||||
@ -87,33 +73,33 @@ Change Project Member Role
|
||||
|
||||
User Can Change Role
|
||||
[arguments] ${username}
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row[contains(.,'${username}')]//clr-dg-action-overflow
|
||||
|
||||
User Can Not Change Role
|
||||
[arguments] ${username}
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row-master[contains(.,'${username}')]//clr-dg-action-overflow[@hidden=""]
|
||||
Page Should Contain Element xpath=//project-detail//clr-dg-row[contains(.,'${username}')]//clr-dg-action-overflow[@hidden=""]
|
||||
|
||||
Non-admin View Member Account
|
||||
[arguments] ${times}
|
||||
Xpath Should Match X Times //project-detail//clr-dg-action-overflow[@hidden=""] ${times}
|
||||
|
||||
User Can Not Add Member
|
||||
Page Should Not Contain Element xpath=${project_member_search_button_xpath2}
|
||||
Page Should Not Contain Element xpath=${project_member_add_button_xpath}
|
||||
|
||||
Add Guest Member To Project
|
||||
[arguments] ${member}
|
||||
Click Element xpath=${project_member_search_button_xpath2}
|
||||
Click Element xpath=${project_member_add_button_xpath}
|
||||
Sleep 1
|
||||
Input Text xpath=${project_member_add_username_xpath} ${member}
|
||||
#select guest
|
||||
Mouse Down xpath=${project_member_guest_radio_checkbox}
|
||||
Mouse Up xpath=${project_member_guest_radio_checkbox}
|
||||
Click Button xpath=${project_member_add_button_xpath2}
|
||||
Click Button xpath=${project_member_add_confirmation_ok_xpath}
|
||||
Sleep 1
|
||||
|
||||
Delete Project Member
|
||||
[arguments] ${member}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,'${member}')]//clr-dg-action-overflow
|
||||
Click Element xpath=//project-detail//clr-dg-row[contains(.,'${member}')]//clr-dg-action-overflow
|
||||
Click Element xpath=${project_member_delete_button_xpath}
|
||||
Sleep 1
|
||||
Click Element xpath=${project_member_delete_confirmation_xpath}
|
||||
|
@ -17,14 +17,13 @@ Documentation This resource provides any keywords related to the Harbor private
|
||||
|
||||
*** Variables ***
|
||||
${project_member_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/nav/ul/li[2]/a
|
||||
${project_member_add_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/button
|
||||
${project_member_add_button_xpath} //project-detail//button[contains(.,'Member')]
|
||||
${project_member_add_username_xpath} //*[@id="member_name"]
|
||||
${project_member_add_admin_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[2]/form/section/div[2]/div[1]/label
|
||||
${project_member_add_save_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[1]/add-member/clr-modal/div/div[1]/div/div[1]/div/div[3]/button[2]
|
||||
${project_member_search_button_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/clr-icon/svg
|
||||
${project_member_search_text_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/ng-component/div/div[1]/div/div[2]/hbr-filter/span/input
|
||||
${project_member_search_button_xpath2} //project-detail//button//clr-icon
|
||||
${project_member_add_button_xpath2} //project-detail//add-member//button[2]
|
||||
${project_member_search_button_xpath} //project-detail//hbr-filter/span/clr-icon
|
||||
${project_member_search_text_xpath} //project-detail//hbr-filter/span/input
|
||||
${project_member_add_confirmation_ok_xpath} //project-detail//add-member//button[2]
|
||||
${project_member_guest_radio_checkbox} //project-detail//form//input[@id='checkrads_guest']
|
||||
${project_member_delete_button_xpath} //project-detail//clr-dg-cell//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
${project_member_delete_confirmation_xpath} //confiramtion-dialog//button[2]
|
@ -80,29 +80,29 @@ Search Private Projects
|
||||
Make Project Private
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click Element xpath=//project//list-project//clr-dg-row[contains(.,'${projectname}')]//clr-dg-action-overflow/button
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Private")]
|
||||
|
||||
Make Project Public
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click element xpath=//project//list-project//clr-dg-row-master[contains(.,'${projectname}')]//clr-dg-action-overflow
|
||||
Click element xpath=//project//list-project//clr-dg-row[contains(.,'${projectname}')]//clr-dg-action-overflow/button
|
||||
Click element xpath=//project//list-project//clr-dg-action-overflow//button[contains(.,"Make Public")]
|
||||
|
||||
Delete Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element xpath=//project-detail//clr-dg-row-master[contains(.,"${projectname}")]//clr-dg-action-overflow
|
||||
Click Element xpath=//project-detail//clr-dg-row[contains(.,"${projectname}")]//clr-dg-action-overflow
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-dg-action-overflow//button[contains(.,"Delete")]
|
||||
Sleep 1
|
||||
Click Element xpath=//clr-modal//div[@class="modal-dialog"]//button[2]
|
||||
Click Element xpath=//clr-modal//button[contains(.,"DELETE")]
|
||||
Sleep 2
|
||||
|
||||
Delete Project
|
||||
[Arguments] ${projname}
|
||||
[Arguments] ${projectname}
|
||||
Sleep 1
|
||||
Click Element //list-project//clr-dg-row-master[contains(.,'${projname}')]//clr-dg-action-overflow
|
||||
Click Element //list-project//clr-dg-row-master[contains(.,'${projname}')]//clr-dg-action-overflow//button[contains(.,'Delete')]
|
||||
Click Element //list-project//clr-dg-row[contains(.,'${projectname}')]//clr-dg-action-overflow/button
|
||||
Click Element //list-project//clr-dg-action-overflow//button[contains(.,'Delete')]
|
||||
#click delete button to confirm
|
||||
Sleep 1
|
||||
Click Element //confiramtion-dialog//button[contains(.,'DELETE')]
|
||||
@ -177,19 +177,19 @@ Go Into Repo
|
||||
Input Text xpath=//*[@id="search_input"] ${repoName}
|
||||
Sleep 8
|
||||
Wait Until Page Contains ${repoName}
|
||||
Click Element xpath=//*[@id="results"]/list-repository-ro/clr-datagrid/div/div/div/div/div[2]/clr-dg-row/clr-dg-row-master/clr-dg-cell[1]/a
|
||||
Click Element xpath=//*[@id="results"]/list-repository-ro//clr-dg-cell[contains(.,${repoName})]/a
|
||||
Sleep 2
|
||||
Capture Page Screenshot gointo_${repoName}.png
|
||||
|
||||
Expand Repo
|
||||
[Arguments] ${projectname}
|
||||
Click Element //repository//clr-dg-row-master[contains(.,'${projectname}')]//button/clr-icon
|
||||
Click Element //repository//clr-dg-row[contains(.,'${projectname}')]//button/clr-icon
|
||||
sleep 1
|
||||
|
||||
Scan Repo
|
||||
[Arguments] ${tagname}
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${tagname}')]//clr-dg-action-overflow
|
||||
Click Element //hbr-tag//clr-dg-row-master[contains(.,'${tagname}')]//clr-dg-action-overflow//button[contains(.,'Scan')]
|
||||
Click Element //hbr-tag//clr-dg-row[contains(.,'${tagname}')]//clr-dg-action-overflow
|
||||
Click Element //hbr-tag//clr-dg-action-overflow//button[contains(.,'Scan')]
|
||||
Sleep 15
|
||||
|
||||
Edit Repo Info
|
||||
@ -214,4 +214,4 @@ Edit Repo Info
|
||||
|
||||
Summary Chart Should Display
|
||||
[Arguments] ${tagname}
|
||||
Page Should Contain Element //clr-dg-row-master[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
||||
Page Should Contain Element //clr-dg-row[contains(.,'${tagname}')]//hbr-vulnerability-bar//hbr-vulnerability-summary-chart
|
||||
|
Loading…
Reference in New Issue
Block a user