Move lib into src for better UI building

Signed-off-by: sshijun <sshijun@vmware.com>
This commit is contained in:
sshijun 2019-11-25 17:48:51 +08:00
parent d41fb07b08
commit c692f5c67e
407 changed files with 880 additions and 6625 deletions

3
.gitignore vendored
View File

@ -15,7 +15,6 @@ src/common/dao/dao.test
jobservice/test
src/portal/coverage/
src/portal/lib/coverage/
src/portal/dist/
src/portal/html-report/
src/portal/node_modules/
@ -33,7 +32,7 @@ src/portal/typings/
src/portal/src/**/*.js
src/portal/src/**/*.js.map
src/portal/lib/coverage
src/portal/src/lib/coverage
**/npm*.log
**/*ngsummary.json

View File

@ -84,17 +84,11 @@ If you already have a harbor backend environment, you can build a frontend devel
npm install
```
3. Compile the frontend code by the following command.
```
npm run build_all
```
4. Execute the following commandserve Harbor locally.
3. Execute the following commandserve Harbor locally.
```
npm run start
```
5. Then you can visit the Harbor by address: https://localhost:4200.
4. Then you can visit the Harbor by address: https://localhost:4200.

View File

@ -18,10 +18,7 @@ RUN apt-get update \
COPY ./LICENSE /build_dir
COPY src/portal /build_dir
RUN ls -la \
&& npm run build_lib \
&& npm run link_lib \
&& node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
RUN node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
FROM goharbor/harbor-portal-base:${harbor_base_image_version}

View File

@ -107,20 +107,6 @@
"src/i18n"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json",
"lib/tsconfig.lib.json"
],
"exclude": [
"**/node_modules/**"
],
"fix": true
}
}
}
},
@ -144,67 +130,6 @@
}
}
}
},
"lib": {
"root": "lib",
"sourceRoot": "lib/src",
"projectType": "library",
"prefix": "enl",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "lib/tsconfig.lib.json",
"project": "lib/ng-package.json"
},
"configurations": {
"production": {
"project": "lib/ng-package.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "lib/src/test.ts",
"tsConfig": "lib/tsconfig.lib.json",
"karmaConfig": "lib/karma.conf.js"
},
"scripts": [
"node_modules/core-js/client/shim.min.js",
"node_modules/mutationobserver-shim/dist/mutationobserver.min.js",
"node_modules/@webcomponents/custom-elements/custom-elements.min.js",
"node_modules/@clr/icons/clr-icons.min.js",
"node_modules/web-animations-js/web-animations.min.js",
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-yaml.min.js"
],
"styles": [
"node_modules/@clr/icons/clr-icons.min.css",
"node_modules/@clr/ui/clr-ui.min.css",
"node_modules/prismjs/themes/prism-solarizedlight.css",
"src/styles.css"
],
"assets": [
"src/images",
"src/favicon.ico",
"src/setting.json",
"src/i18n"
]
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"lib/tsconfig.lib.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "harbor-portal",

View File

@ -1,5 +0,0 @@
# This file lists all individuals having contributed content to the repository.
Mia Zhou <meinaz@vmware.com>
Qian Deng<dengq@vmware.com>
Steven zou <szou@vmware.com>

File diff suppressed because it is too large Load Diff

View File

@ -1,847 +0,0 @@
# Harbor UI library
**NOTES: Odd version is development version and may be not stable. Even version is release version which should be stable.**
![Harbor UI Library](../../../docs/img/harbor_logo.png)
Wrap the following Harbor UI components into a sharable library and published as npm package for other third-party applications to import and reuse.
* Repository and tag management view
* Replication rules and jobs management view
* Replication endpoints management view
* Access log list view
* Vulnerability scanning result bar chart and list view (Embedded in tag management view)
* Registry(Harbor) related configuration options
The Harbor UI library is built on **[Angular ](https://angular.io/)** 6.x and **[Clarity ](https://vmware.github.io/clarity/)** 0.12.x .
The library is published to the public npm repository with name **[@harbor/ui](https://www.npmjs.com/package/@harbor/ui)**.
## Build & Test
Build library with command:
```
npm run build
```
Execute the testing specs with command:
```
npm run test
```
Install the package
```
npm install @harbor/ui[@version]
```
## Usage
**Add dependency to application**
Execute install command to add dependency to package.json
```
npm install @harbor/ui
//OR
npm install @harbor/ui@1.0.0
```
The latest version of the library will be installed.
**Import the library module into the root Angular module**
```
import { HarborLibraryModule } from '@harbor/ui';
@NgModule({
declarations: [...],
imports: [
HarborLibraryModule.forRoot()
],
providers: [...],
bootstrap: [...]
})
export class AppModule {
}
```
If no parameters are passed to **'forRoot'**, the module will be initialized with default configurations. If re-configuration required, please refer the **'Configurations'** parts.
**Enable components via tags**
* **Registry log view**
Use **withTitle** to set whether self-contained a header with title or not. Default is **false**, that means no header is existing.
```
<hbr-log [withTitle]="..."></hbr-log>
```
* **Replication Management View**
Support two different display scope mode: under specific project or whole system.
If **projectId** is set to the id of specified project, then only show the replication rules bound with the project. Otherwise, show all the rules of the whole system.
On specific project mode, without need projectId, but also need to provide projectName for display.
**withReplicationJob** is used to determine whether or not show the replication jobs which are relevant with the selected replication rule.
**isSystemAdmin** is for judgment if user has administrator privilege, if true, user can do the create/edit/delete/replicate actions.
```
<hbr-replication [projectId]="..." [projectName]="..." [withReplicationJob]='...' [isSystemAdmin]="..."></hbr-replication>
```
* **Endpoint Management View**
```
//No @Input properties
<hbr-endpoint></hbr-endpoint>
```
* **Repository and Tag Management View**
The `hbr-repository-stackview` directive is deprecated. Using `hbr-repository-listview` and `hbr-repository` instead. You should define two routers one for render
`hbr-repository-listview` the other is for `hbr-repository`. `hbr-repository-listview` will output an event, you need catch this event and redirect to related
page contains `hbr-repository`.
**hbr-repository-listview Directive**
**projectId** is used to specify which projects the repositories are from.
**projectName** is used to generate the related commands for pushing images.
**hasSignedIn** is a user session related property to determined whether a valid user signed in session existing. This component supports anonymous user.
**hasProjectAdminRole** is a user session related property to determined whether the current user has project administrator role. Some action menus might be disabled based on this property.
**repoClickEvent** is an @output event emitter for you to catch the repository click events.
```
<hbr-repository-listview [projectId]="" [projectName]="" [hasSignedIn]="" [hasProjectAdminRole]=""
(repoClickEvent)="watchRepoClickEvent($event)"></hbr-repository-listview>
...
watchRepoClickEvent(repo: RepositoryItem): void {
//Process repo
...
}
```
**hbr-repository-gridview Directive**
**projectId** is used to specify which projects the repositories are from.
**projectName** is used to generate the related commands for pushing images.
**hasSignedIn** is a user session related property to determined whether a valid user signed in session existing. This component supports anonymous user.
**hasProjectAdminRole** is a user session related property to determined whether the current user has project administrator role. Some action menus might be disabled based on this property.
**repoClickEvent** is an @output event emitter for you to catch the repository click events.
**repoProvisionEvent** is an @output event emitter for you to catch the deploy button click event.
**addInfoEvent** is an @output event emitter for you to catch the add additional info button event.
@Output() repoProvisionEvent = new EventEmitter<RepositoryItem>();
@Output() addInfoEvent = new EventEmitter<RepositoryItem>();
**hbr-repository Directive**
**projectId** is used to specify which projects the repositories are from.
**repoName** is used to generate the related commands for pushing images.
**hasSignedIn** is a user session related property to determined whether a valid user signed in session existing. This component supports anonymous user.
**hasProjectAdminRole** is a user session related property to determined whether the current user has project administrator role. Some action menus might be disabled based on this property.
**withNotary** is Notary installed
**tagClickEvent** is an @output event emitter for you to catch the tag click events.
**goBackClickEvent** is an @output event emitter for you to catch the go back events.
```
<hbr-repository [projectId]="" [repoName]="" [hasSignedIn]="" [hasProjectAdminRole]="" [withNotary]=""
(tagClickEvent)="watchTagClickEvt($event)" (backEvt)="watchGoBackEvt($event)" ></hbr-repository>
watchTagClickEvt(tagEvt: TagClickEvent): void {
...
}
watchGoBackEvt(projectId: string): void {
...
}
```
<hbr-repository-gridview [projectId]="" [projectName]="" [hasSignedIn]="" [hasProjectAdminRole]=""
(repoClickEvent)="watchRepoClickEvent($event)"
(repoProvisionEvent)="watchRepoProvisionEvent($event)"
(addInfoEvent)="watchAddInfoEvent($event)"></hbr-repository-gridview>
...
watchRepoClickEvent(repo: RepositoryItem): void {
//Process repo
...
}
watchRepoProvisionEvent(repo: RepositoryItem): void {
//Process repo
...
}
watchAddInfoEvent(repo: RepositoryItem): void {
//Process repo
...
}
```
**hbr-repository Directive**
**projectId** is used to specify which projects the repositories are from.
**repoName** is used to generate the related commands for pushing images.
**hasSignedIn** is a user session related property to determined whether a valid user signed in session existing. This component supports anonymous user.
**hasProjectAdminRole** is a user session related property to determined whether the current user has project administrator role. Some action menus might be disabled based on this property.
**tagClickEvent** is an @output event emitter for you to catch the tag click events.
**goBackClickEvent** is an @output event emitter for you to catch the go back events.
```
<hbr-repository [projectId]="" [repoName]="" [hasSignedIn]="" [hasProjectAdminRole]="" [withNotary]=""
(tagClickEvent)="watchTagClickEvt($event)" (backEvt)="watchGoBackEvt($event)" ></hbr-repository>
watchTagClickEvt(tagEvt: TagClickEvent): void {
...
}
watchGoBackEvt(projectId: string): void {
...
}
```
* **Tag detail view**
This view is linked by the repository stack view only when the Clair is enabled in Harbor.
**tagId** is an @Input property and used to specify the tag of which details are displayed.
**repositoryId** is an @Input property and used to specified the repository to which the tag is belonged.
**backEvt** is an @Output event emitter and used to distribute the click event of the back arrow in the detail page.
```
<hbr-tag-detail (backEvt)="goBack($event)" [tagId]="..." [repositoryId]="..."></hbr-tag-detail>
```
* **Registry related configuration**
This component provides some options for registry(Harbor) related configurations.
**hasAdminRole** is an @Input property to indicate if the current logged user has administrator role.
```
<hbr-registry-config [hasAdminRole]="***"></hbr-registry-config>
```
## Configurations
All the related configurations are defined in the **HarborModuleConfig** interface.
**1. config**
The base configuration for the module. Mainly used to define the relevant endpoints of services which are in charge of retrieving data from backend APIs. It's a 'InjectionToken' and defined by 'IServiceConfig' interface. If **config** is not set, the default value will be used.
```
export const DefaultServiceConfig: IServiceConfig = {
systemInfoEndpoint: "/api/systeminfo",
repositoryBaseEndpoint: "/api/repositories",
logBaseEndpoint: "/api/logs",
targetBaseEndpoint: "/api/registries",
replicationRuleEndpoint: "/api/policies/replication",
replicationBaseEndpoint: "/api/replication/executions",
vulnerabilityScanningBaseEndpoint: "/api/repositories",
configurationEndpoint: "/api/configurations",
enablei18Support: false,
defaultLang: DEFAULT_LANG, //'en-us'
langCookieKey: DEFAULT_LANG_COOKIE_KEY, //'harbor-lang'
supportedLangs: DEFAULT_SUPPORTING_LANGS,//['en-us','zh-cn','es-es']
langMessageLoader: "local",
langMessagePathForHttpLoader: "i18n/langs/",
langMessageFileSuffixForHttpLoader: "-lang.json",
localI18nMessageVariableMap: {}
};
```
If you want to override the related items, declare your own 'IServiceConfig' interface and define the configuration value. E.g: Override 'repositoryBaseEndpoint'
```
export const MyServiceConfig: IServiceConfig = {
repositoryBaseEndpoint: "/api/wrap/repositories"
}
...
HarborLibraryModule.forRoot({
config: { provide: SERVICE_CONFIG, useValue: MyServiceConfig }
})
...
```
It supports partially overriding. For the items not overridden, default values will be adopted. The items contained in **config** are:
* **systemInfoEndpoint:** The base endpoint of the service used to get the related system configurations. Default value is "/api/systeminfo".
* **repositoryBaseEndpoint:** The base endpoint of the service used to handle the repositories of registry and/or tags of repository. Default value is "/api/repositories".
* **logBaseEndpoint:** The base endpoint of the service used to handle the recent access logs. Default is "/api/logs".
* **targetBaseEndpoint:** The base endpoint of the service used to handle the registry endpoints. Default is "/api/registries".
* **replicationRuleEndpoint:** The base endpoint of the service used to handle the replication rules. Default is "/api/policies/replication".
* **replicationBaseEndpoint:** The base endpoint of the service used to handle the replication executions. Default is "/api/replication/executions".
* **vulnerabilityScanningBaseEndpoint:** The base endpoint of the service used to handle the vulnerability scanning results.Default value is "/api/repositories".
* **configurationEndpoint:** The base endpoint of the service used to configure registry related options. Default is "/api/configurations".
* **langCookieKey:** The cookie key used to store the current used language preference. Default is "harbor-lang".
* **supportedLangs:** Declare what languages are supported. Default is ['en-us', 'zh-cn', 'es-es'].
* **enablei18Support:** To determine whether or not to enable the i18 multiple languages supporting. Default is false.
* **langMessageLoader:** To determine which loader will be used to load the required lang messages. Support two loaders: One is **'http'**, use async http to load json files with the specified url/path. Another is **'local'**, use local json variable to store the lang message.
* **langMessagePathForHttpLoader:** Define the basic url/path prefix for the loader to find the json files if the 'langMessageLoader' is set to **'http'**. E.g: 'src/i18n/langs'.
* **langMessageFileSuffixForHttpLoader:** Define the suffix of the json file names without lang name if 'langMessageLoader' is set to **'http'**. For example, '-lang.json' is suffix of message file 'en-us-lang.json'.
* **localI18nMessageVariableMap:** If configuration property 'langMessageLoader' is set to **'local'** to load the i18n messages, this property must be defined to tell local JSON loader where to get the related messages. E.g: If declare the following messages storage variables,
```
export const EN_US_LANG: any = {
"APP_TITLE": {
"VMW_HARBOR": "VMware Harbor",
"HARBOR": "Harbor"
}
}
export const ZH_CN_LANG: any = {
"APP_TITLE": {
"VMW_HARBOR": "VMware Harbor中文版",
"HARBOR": "Harbor"
}
}
```
then this property should be set to:
```
{
"en-us": EN_US_LANG,
"zh-cn": ZH_CN_LANG
};
```
**2. errorHandler**
UI components in the library use this interface to pass the errors/warnings/infos/logs to the top component or page. The top component or page can display those information in their message panel or notification system.
If not set, the console will be used as default output approach.
```
@Injectable()
export class MyErrorHandler extends ErrorHandler {
public error(error: any): void {
...
}
public warning(warning: any): void {
...
}
public info(info: any): void {
...
}
public log(log: any): void {
...
}
}
...
HarborLibraryModule.forRoot({
errorHandler: { provide: ErrorHandler, useClass: MyErrorHandler }
})
...
```
**3. user session**
Some components may need the user authorization and authentication information to display different views. The following way of handing user session is supported by the library.
* Use @Input properties or interface to let top component or page to pass the required user session information in.
```
//In the above repository stack view, the user session informations are passed via @input properties.
[hasSignedIn]="..." [hasProjectAdminRole]="..."
```
**4. services**
The library has its own service implementations to communicate with backend APIs and transfer data. If you want to use your own data handling logic, you can implement your own services based on the defined interfaces.
* **AccessLogService:** Define service methods to handle the access log related things.
```
@Injectable()
export class MyAccessLogService extends AccessLogService {
/**
* Get the audit logs for the specified project.
* Set query parameters through 'queryParams', support:
* - page
* - pageSize
*
* @param {(number | string)} projectId
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<AccessLog[]>)}
*
* @memberOf AccessLogService
*/
getAuditLogs(projectId: number | string, queryParams?: RequestQueryParams): Observable<AccessLog[]> {
...
}
/**
* Get the recent logs.
*
* @param {number} lines : Specify how many lines should be returned.
* @returns {(Observable<AccessLog[]>)}
*
* @memberOf AccessLogService
*/
getRecentLogs(lines: number): Observable<AccessLog[]>{
...
}
}
...
HarborLibraryModule.forRoot({
logService: { provide: AccessLogService, useClass: MyAccessLogService }
})
...
```
* **EndpointService:** Define the service methods to handle the endpoint related things.
```
@Injectable()
export class MyEndpointService extends EndpointService {
/**
* Get all the endpoints.
* Set the argument 'endpointName' to return only the endpoints match the name pattern.
*
* @param {string} [endpointName]
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<Endpoint[]> | Endpoint[])}
*
* @memberOf EndpointService
*/
getEndpoints(endpointName?: string, queryParams?: RequestQueryParams): Observable<Endpoint[]> {
...
}
/**
* Get the specified endpoint.
*
* @param {(number | string)} endpointId
* @returns {(Observable<Endpoint> | Endpoint)}
*
* @memberOf EndpointService
*/
getEndpoint(endpointId: number | string): Observable<Endpoint>{
...
}
/**
* Create new endpoint.
*
* @param {Endpoint} endpoint
* @returns {(Observable<any> | any)}
*
* @memberOf EndpointService
*/
createEndpoint(endpoint: Endpoint): Observable<any> {
...
}
/**
* Update the specified endpoint.
*
* @param {(number | string)} endpointId
* @param {Endpoint} endpoint
* @returns {(Observable<any> | any)}
*
* @memberOf EndpointService
*/
updateEndpoint(endpointId: number | string, endpoint: Endpoint): Observable<any> {
...
}
/**
* Delete the specified endpoint.
*
* @param {(number | string)} endpointId
* @returns {(Observable<any> | any)}
*
* @memberOf EndpointService
*/
deleteEndpoint(endpointId: number | string): Observable<any> {
...
}
/**
* Ping the specified endpoint.
*
* @param {Endpoint} endpoint
* @returns {(Observable<any> | any)}
*
* @memberOf EndpointService
*/
pingEndpoint(endpoint: Endpoint): Observable<any> {
...
}
/**
* Check endpoint whether in used with specific replication rule.
*
* @param {{number | string}} endpointId
* @returns {{Observable<any> | any}}
*/
getEndpointWithReplicationRules(endpointId: number | string): Observable<any> {
...
}
}
...
HarborLibraryModule.forRoot({
endpointService: { provide: EndpointService, useClass: MyEndpointService }
})
...
```
* **ReplicationService:** Define the service methods to handle the replication (rule and job) related things.
```
@Injectable()
export class MyReplicationService extends ReplicationService {
/**
* Get the replication rules.
* Set the argument 'projectId' to limit the data scope to the specified project;
* set the argument 'ruleName' to return the rule only match the name pattern;
* if pagination needed, use the queryParams to add query parameters.
*
* @param {(number | string)} [projectId]
* @param {string} [ruleName]
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<ReplicationRule[]>)}
*
* @memberOf ReplicationService
*/
getReplicationRules(projectId?: number | string, ruleName?: string, queryParams?: RequestQueryParams): Observable<ReplicationRule[]> {
...
}
/**
* Get the specified replication rule.
*
* @param {(number | string)} ruleId
* @returns {(Observable<ReplicationRule>)}
*
* @memberOf ReplicationService
*/
getReplicationRule(ruleId: number | string): Observable<ReplicationRule> {
...
}
/**
* Create new replication rule.
*
* @param {ReplicationRule} replicationRule
* @returns {(Observable<any>)}
*
* @memberOf ReplicationService
*/
createReplicationRule(replicationRule: ReplicationRule): Observable<any> {
...
}
/**
* Update the specified replication rule.
*
* @param {ReplicationRule} replicationRule
* @returns {(Observable<any>)}
*
* @memberOf ReplicationService
*/
updateReplicationRule(replicationRule: ReplicationRule): Observable<any> {
...
}
/**
* Delete the specified replication rule.
*
* @param {(number | string)} ruleId
* @returns {(Observable<any>)}
*
* @memberOf ReplicationService
*/
deleteReplicationRule(ruleId: number | string): Observable<any> {
...
}
/**
* Enable the specified replication rule.
*
* @param {(number | string)} ruleId
* @returns {(Observable<any>)}
*
* @memberOf ReplicationService
*/
enableReplicationRule(ruleId: number | string, enablement: number): Observable<any> {
...
}
/**
* Disable the specified replication rule.
*
* @param {(number | string)} ruleId
* @returns {(Observable<any>)}
*
* @memberOf ReplicationService
*/
disableReplicationRule(ruleId: number | string): Observable<any> {
...
}
/**
* Get the jobs for the specified replication rule.
* Set query parameters through 'queryParams', support:
* - status
* - repository
* - startTime and endTime
* - page
* - pageSize
*
* @param {(number | string)} ruleId
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<ReplicationJob>)}
*
* @memberOf ReplicationService
*/
getJobs(ruleId: number | string, queryParams?: RequestQueryParams): Observable<ReplicationJob[]> {
...
}
}
...
HarborLibraryModule.forRoot({
replicationService: { provide: ReplicationService, useClass: MyReplicationService }
})
...
```
* **RepositoryService:** Define service methods for handling the repository related things.
```
@Injectable()
export class MyRepositoryService extends RepositoryService {
/**
* List all the repositories in the specified project.
* Specify the 'repositoryName' to only return the repositories which match the name pattern.
* If pagination needed, set the following parameters in queryParams:
* 'page': current page,
* 'page_size': page size.
*
* @param {(number | string)} projectId
* @param {string} repositoryName
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<Repository[]>)}
*
* @memberOf RepositoryService
*/
getRepositories(projectId: number | string, repositoryName?: string, queryParams?: RequestQueryParams): Observable<Repository[]> {
...
}
/**
* DELETE the specified repository.
*
* @param {string} repositoryName
* @returns {(Observable<any>)}
*
* @memberOf RepositoryService
*/
deleteRepository(repositoryName: string): Observable<any> {
...
}
}
...
HarborLibraryModule.forRoot({
repositoryService: { provide: RepositoryService, useClass: MyRepositoryService }
})
...
```
```
@Injectable()
export class MyTagService extends TagService {
/**
* Get all the tags under the specified repository.
* NOTES: If the Notary is enabled, the signatures should be included in the returned data.
*
* @param {string} repositoryName
* @param {RequestQueryParams} [queryParams]
* @returns {(Observable<Tag[]>)}
*
* @memberOf TagService
*/
getTags(repositoryName: string, queryParams?: RequestQueryParams): Observable<Tag[]> {
...
}
/**
* Delete the specified tag.
*
* @param {string} repositoryName
* @param {string} tag
* @returns {(Observable<any> | any)}
*
* @memberOf TagService
*/
deleteTag(repositoryName: string, tag: string): Observable<any> {
...
}
}
...
HarborLibraryModule.forRoot({
tagService: { provide: TagService, useClass: MyTagService }
})
...
```
* **ScanningResultService:** Get the vulnerabilities scanning results for the specified tag.
```
@Injectable()
/**
* Get the vulnerabilities scanning results for the specified tag.
*
* @export
* @class ScanningResultService
*/
export class MyScanningResultService extends ScanningResultService {
/**
* Get the summary of vulnerability scanning result.
*
* @param {string} tagId
* @returns {(Observable<VulnerabilitySummary>)}
*
* @memberOf ScanningResultService
*/
getVulnerabilityScanningSummary(repoName: string, tagId: string, queryParams?: RequestQueryParams): Observable<VulnerabilitySummary> {
...
}
/**
* Get the detailed vulnerabilities scanning results.
*
* @param {string} tagId
* @returns {(Observable<VulnerabilityItem[]>)}
*
* @memberOf ScanningResultService
*/
getVulnerabilityScanningResults(repoName: string, tagId: string, queryParams?: RequestQueryParams): Observable<VulnerabilityItem[]> {
...
}
/**
* Start a new vulnerability scanning
*
* @param {string} repoName
* @param {string} tagId
* @returns {(Observable<any>)}
*
* @memberOf ScanningResultService
*/
startVulnerabilityScanning(repoName: string, tagId: string): Observable<any> {
...
}
}
...
HarborLibraryModule.forRoot({
scanningService: { provide: ScanningResultService, useClass: MyScanningResultService }
})
...
```
* **SystemInfoService:** Get related system configurations.
```
/**
* Get System information about current backend server.
* @class
*/
export class MySystemInfoService extends SystemInfoService {
/**
* Get global system information.
* @returns
*/
getSystemInfo(): Observable<SystemInfo> {
...
}
}
...
HarborLibraryModule.forRoot({
systemInfoService: { provide: SystemInfoService, useClass: MySystemInfoService }
})
...
```
* **ConfigurationService:** Get and save the registry related configuration options.
```
/**
* Service used to get and save registry-related configurations.
*
* @export
* @class MyConfigurationService
*/
export class MyConfigurationService extends ConfigurationService{
/**
* Get configurations.
*
* @returns {(Observable<Configuration>)}
*
* @memberOf ConfigurationService
*/
getConfigurations(): Observable<Configuration> {
...
}
/**
* Save configurations.
*
* @returns {(Observable<Configuration>)}
*
* @memberOf ConfigurationService
*/
saveConfigurations(changedConfigs: any | { [key: string]: any | any[] }): Observable<any> {
...
}
}
...
HarborLibraryModule.forRoot({
config.configService || { provide: ConfigurationService, useClass: ConfigurationDefaultService }
})
...
```

View File

@ -1 +0,0 @@
export * from './src/index';

View File

@ -1,87 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const path = require('path');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-mocha-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
// reports can be any that are listed here: https://github.com/istanbuljs/istanbuljs/tree/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib
reports: ['html', 'lcovonly', 'text-summary'],
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name
dir: path.join(__dirname, 'coverage'),
// Combines coverage information from multiple browsers into one report rather than outputting a report
// for each browser.
combineBrowserReports: true,
// if using webpack and pre-loaders, work around webpack breaking the source path
fixWebpackSourcePaths: true,
// Omit files with no statements, no functions and no branches from the report
skipFilesWithNoCoverage: false,
// Most reporters accept additional config options. You can pass these through the `report-config` option
'report-config': {
// all options available at: https://github.com/istanbuljs/istanbuljs/blob/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib/html/index.js#L135-L137
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}
},
// enforce percentage thresholds
// anything under these percentages will cause karma to fail with an exit code of 1 if not running in watch mode
thresholds: {
emitWarning: true, // set to `true` to not fail the test command when thresholds are not met
// thresholds for all files
global: {
statements: 37,
branches: 19,
functions: 28,
lines: 36
},
// thresholds per file
each: {
statements: 0,
lines: 0,
branches: 0,
functions: 0
}
}
},
reporters: ['progress', 'mocha','coverage-istanbul'],
mochaReporter: {
output: 'minimal'
},
reportSlowerThan: 100,
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: true,
browsers: ['ChromeHeadlessNoSandbox'],
browserDisconnectTolerance: 2,
browserNoActivityTimeout: 50000,
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
restartOnFileChange: true
});
};

View File

@ -1,15 +0,0 @@
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist",
"deleteDestPath": false,
"lib": {
"entryFile": "index.ts",
"umdModuleIds": {
"@clr/angular" : "angular",
"ngx-markdown" : "ngxMarkdown",
"@ngx-translate/http-loader" : "httpLoader",
"ngx-cookie" : "ngxCookie",
"@ngx-translate/core" : "core$1"
}
}
}

View File

@ -1,14 +0,0 @@
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist",
"lib": {
"entryFile": "index.ts",
"umdModuleIds": {
"@clr/angular" : "angular",
"ngx-markdown" : "ngxMarkdown",
"@ngx-translate/http-loader" : "httpLoader",
"ngx-cookie" : "ngxCookie",
"@ngx-translate/core" : "core$1"
}
}
}

View File

@ -1,5 +0,0 @@
{
"name": "@harbor/ui",
"version": "1.10.0",
"lockfileVersion": 1
}

View File

@ -1,48 +0,0 @@
{
"name": "@harbor/ui",
"version": "1.10.0",
"description": "Harbor shared UI components based on Clarity and Angular8",
"author": "CNCF",
"module": "index.js",
"main": "bundles/harborui.umd.min.js",
"jsnext:main": "index.js",
"typings": "index.d.ts",
"keywords": [
"Harbor",
"Clarity",
"Angular7"
],
"license": "Apache 2.0",
"repository": {
"type": "git",
"url": "https://github.com/vmware/harbor.git"
},
"homepage": "https://github.com/vmware/harbor#readme",
"peerDependencies": {
"@angular/animations": "^8.2.0",
"@angular/common": "^8.2.0",
"@angular/compiler": "^8.2.0",
"@angular/core": "^8.2.0",
"@angular/forms": "^8.2.0",
"@angular/http": "^8.2.0",
"@angular/platform-browser": "^8.2.0",
"@angular/platform-browser-dynamic": "^8.2.0",
"@angular/router": "^8.2.0",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@webcomponents/custom-elements": "^1.1.3",
"@clr/angular": "^2.1.0",
"@clr/icons": "^2.1.0",
"@clr/ui": "^2.1.0",
"core-js": "^2.5.4",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0",
"ngx-markdown": "^8.1.0",
"rxjs": "^6.3.3",
"ts-helpers": "^1.1.1",
"web-animations-js": "^2.2.1",
"zone.js": "^0.8.26",
"tslib": "^1.9.0"
}
}

View File

@ -1,2 +0,0 @@
export * from './fade-in.animation';
export * from './slide-in-out.animation';

View File

@ -1,22 +0,0 @@
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ClarityModule } from '@clr/angular';
import { HarborLibraryModule } from './harbor-library.module';
@NgModule({
declarations: [],
imports: [
BrowserAnimationsModule,
BrowserModule,
FormsModule,
ClarityModule,
HarborLibraryModule.forRoot()
],
providers: [],
bootstrap: []
})
export class AppModule {
}

View File

@ -1 +0,0 @@
export * from './channel.service';

View File

@ -1,8 +0,0 @@
export * from "./gc.component";
export * from "./gc.const";
export * from "./gc.api.repository";
export * from "./gc.service";
export * from "./gc.viewmodel.factory";
export * from "./gcLog";
export * from "./gc-history/gc-history.component";

View File

@ -1,28 +0,0 @@
import { Type } from '@angular/core';
import { ReplicationConfigComponent } from './replication/replication-config.component';
import { SystemSettingsComponent } from './system/system-settings.component';
import { VulnerabilityConfigComponent } from './vulnerability/vulnerability-config.component';
import { RegistryConfigComponent } from './registry-config.component';
import { GcComponent } from './gc/gc.component';
import { GcHistoryComponent } from './gc/gc-history/gc-history.component';
import { ProjectQuotasComponent } from './project-quotas/project-quotas.component';
import { EditProjectQuotasComponent } from './project-quotas/edit-project-quotas/edit-project-quotas.component';
export * from './config';
export * from './replication/replication-config.component';
export * from './system/system-settings.component';
export * from './vulnerability/vulnerability-config.component';
export * from './registry-config.component';
export * from './gc/index';
export const CONFIGURATION_DIRECTIVES: Type<any>[] = [
ReplicationConfigComponent,
GcHistoryComponent,
GcComponent,
SystemSettingsComponent,
VulnerabilityConfigComponent,
RegistryConfigComponent,
ProjectQuotasComponent,
EditProjectQuotasComponent
];

View File

@ -1,7 +0,0 @@
import { Type } from '@angular/core';
import { CreateEditEndpointComponent } from './create-edit-endpoint.component';
export const CREATE_EDIT_ENDPOINT_DIRECTIVES: Type<any>[] = [
CreateEditEndpointComponent
];

View File

@ -1,6 +0,0 @@
import { Type } from "@angular/core";
import { CreateEditLabelComponent } from "./create-edit-label.component";
export const CREATE_EDIT_LABEL_DIRECTIVES: Type<any>[] = [
CreateEditLabelComponent
];

View File

@ -1,9 +0,0 @@
import { Type } from "@angular/core";
import { CreateEditRuleComponent } from "./create-edit-rule.component";
import {FilterLabelComponent} from "./filter-label.component";
export const CREATE_EDIT_RULE_DIRECTIVES: Type<any>[] = [
CreateEditRuleComponent,
FilterLabelComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import { DatePickerComponent } from "./datetime-picker.component";
import { DateValidatorDirective } from "./date-validator.directive";
export const DATETIME_PICKER_DIRECTIVES: Type<any>[] = [
DatePickerComponent,
DateValidatorDirective
];

View File

@ -1,4 +0,0 @@
import { Type } from "@angular/core";
import { EndpointComponent } from "./endpoint.component";
export const ENDPOINT_DIRECTIVES: Type<any>[] = [EndpointComponent];

View File

@ -1,3 +0,0 @@
export const environment = {
production: true
};

View File

@ -1,8 +0,0 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`.
export const environment = {
production: false
};

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import { FilterComponent } from './filter.component';
export * from "./filter.component";
export const FILTER_DIRECTIVES: Type<any>[] = [
FilterComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import { GridViewComponent } from './grid-view.component';
export * from "./grid-view.component";
export const HBR_GRIDVIEW_DIRECTIVES: Type<any>[] = [
GridViewComponent
];

View File

@ -1,4 +0,0 @@
import { Type } from "@angular/core";
import { ImageNameInputComponent } from "./image-name-input.component";
export const IMAGE_NAME_INPUT_DIRECTIVES: Type<any>[] = [ImageNameInputComponent];

View File

@ -1,33 +0,0 @@
export * from "./harbor-library.module";
export * from "./service.config";
export * from "./service/index";
export * from "./error-handler/index";
export * from "./shared/shared.const";
export * from "./shared/shared.utils";
export * from "./shared/shared.module";
export * from "./utils";
export * from "./log/index";
export * from "./filter/index";
export * from "./endpoint/index";
export * from "./repository/index";
export * from "./create-edit-endpoint/index";
export * from "./create-edit-rule/index";
export * from "./tag/index";
export * from "./list-replication-rule/index";
export * from "./replication/index";
export * from "./vulnerability-scanning/index";
export * from "./i18n/index";
export * from "./push-image/index";
export * from "./third-party/index";
export * from "./config/index";
export * from "./channel/index";
export * from "./project-policy-config/index";
export * from "./label/index";
export * from "./create-edit-label/index";
export * from "./gridview/index";
export * from "./repository-gridview/index";
export * from "./operation/index";
export * from "./_animations/index";
export * from "./cron-schedule/index";
export * from "./cache/index";

View File

@ -1,7 +0,0 @@
import { Type } from '@angular/core';
import { InlineAlertComponent } from './inline-alert.component';
export const INLINE_ALERT_DIRECTIVES: Type<any>[] = [
InlineAlertComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import {LabelPieceComponent} from './label-piece.component';
/*export * from "./filter.component";*/
export const LABEL_PIECE_DIRECTIVES: Type<any>[] = [
LabelPieceComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from '@angular/core';
import { LabelComponent} from "./label.component";
import { LabelSignPostComponent } from './label-signpost/label-signpost.component';
export const LABEL_DIRECTIVES: Type<any>[] = [
LabelComponent,
LabelSignPostComponent,
];

View File

@ -1,9 +0,0 @@
import { Type } from '@angular/core';
import { ListReplicationRuleComponent } from './list-replication-rule.component';
export * from './list-replication-rule.component';
export const LIST_REPLICATION_RULE_DIRECTIVES: Type<any>[] = [
ListReplicationRuleComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import { RecentLogComponent } from './recent-log.component';
export * from "./recent-log.component";
export const LOG_DIRECTIVES: Type<any>[] = [
RecentLogComponent
];

View File

@ -1,12 +0,0 @@
import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app.module';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,13 +0,0 @@
/**
* Created by pengf on 5/11/2018.
*/
import {Type} from "@angular/core";
import {OperationComponent} from "./operation.component";
export * from "./operation.component";
export * from './operate';
export * from './operation.service';
export const OPERATION_DIRECTIVES: Type<any>[] = [
OperationComponent
];

View File

@ -1,26 +0,0 @@
// This file includes polyfills needed by Angular 2 and is loaded before
// the app. You can add your own extra polyfills to this file.
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'intl';
import 'intl/locale-data/jsonp/en';
import 'intl/locale-data/jsonp/es';
import 'intl/locale-data/jsonp/zh';
import 'zone.js/dist/zone';

View File

@ -1,8 +0,0 @@
import { Type } from '@angular/core';
import { ProjectPolicyConfigComponent } from './project-policy-config.component';
export * from './project-policy-config.component';
export const PROJECT_POLICY_CONFIG_DIRECTIVES: Type<any>[] = [
ProjectPolicyConfigComponent
];

View File

@ -1,11 +0,0 @@
import { Type } from "@angular/core";
import { PushImageButtonComponent } from './push-image.component';
import { CopyInputComponent } from './copy-input.component';
export * from "./push-image.component";
export * from './copy-input.component';
export const PUSH_IMAGE_BUTTON_DIRECTIVES: Type<any>[] = [
CopyInputComponent,
PushImageButtonComponent
];

View File

@ -1,11 +0,0 @@
import { Type } from '@angular/core';
import { ReplicationComponent } from './replication.component';
import { ReplicationTasksComponent } from './replication-tasks/replication-tasks.component';
export * from './replication.component';
export * from './replication-tasks/replication-tasks.component';
export const REPLICATION_DIRECTIVES: Type<any>[] = [
ReplicationComponent,
ReplicationTasksComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from "@angular/core";
import { RepositoryGridviewComponent } from './repository-gridview.component';
export * from "./repository-gridview.component";
export const REPOSITORY_GRIDVIEW_DIRECTIVES: Type<any>[] = [
RepositoryGridviewComponent
];

View File

@ -1,8 +0,0 @@
import { Type } from '@angular/core';
import { RepositoryComponent } from './repository.component';
export * from "./repository.component";
export const REPOSITORY_DIRECTIVES: Type<any>[] = [
RepositoryComponent
];

View File

@ -1,14 +0,0 @@
import { Type } from "@angular/core";
import { TagComponent } from "./tag.component";
import { TagDetailComponent } from "./tag-detail.component";
import { TagHistoryComponent } from "./tag-history.component";
export * from "./tag.component";
export * from "./tag-detail.component";
export * from "./tag-history.component";
export const TAG_DIRECTIVES: Type<any>[] = [
TagComponent,
TagDetailComponent,
TagHistoryComponent
];

View File

@ -1,32 +0,0 @@
import './polyfills.ts';
import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var require: any;
// Prevent Karma from running prematurely.
__karma__.loaded = function () {};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
let context = require.context('./', true, /\.spec\.ts/);
// And load the modules.
context.keys().map(context);
// Finally, start Karma to run the tests.
__karma__.start();

View File

@ -1,2 +0,0 @@
export * from './ngx-window-token/index';
export * from './ngx-clipboard/index';

View File

@ -1 +0,0 @@
export { WindowTokenModule, WINDOW } from './window-token';

View File

@ -1,20 +0,0 @@
import { Type } from "@angular/core";
import { ResultGridComponent } from './result-grid.component';
import { ResultBarChartComponent } from './result-bar-chart.component';
import { ResultTipComponent } from './result-tip.component';
import { HistogramChartComponent } from "./histogram-chart/histogram-chart.component";
import { ResultTipHistogramComponent } from "./result-tip-histogram/result-tip-histogram.component";
export * from './result-tip.component';
export * from "./result-grid.component";
export * from './result-bar-chart.component';
export * from './histogram-chart/histogram-chart.component';
export * from './result-tip-histogram/result-tip-histogram.component';
export const VULNERABILITY_DIRECTIVES: Type<any>[] = [
ResultGridComponent,
ResultTipComponent,
ResultBarChartComponent,
HistogramChartComponent,
ResultTipHistogramComponent
];

View File

@ -1,42 +0,0 @@
{
"compilerOptions": {
"outDir": "../out-tsc/lib",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"baseUrl": "./",
"typeRoots": [
"../node_modules/@types"
],
"lib": [
"dom",
"es2015"
],
"paths": {
"lib": [
"dist/lib"
],
"lib/*": [
"dist/lib/*"
],
"@angular/*": [ "./node_modules/@angular/*"]
}
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"flatModuleId": "AUTOGENERATED",
"flatModuleOutFile": "AUTOGENERATED"
},
"exclude": [
]
}

View File

@ -10674,9 +10674,9 @@
}
},
"ngx-clipboard": {
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-12.0.0.tgz",
"integrity": "sha512-uN5KMNIiRT7uVHfJ5lgDSb7AvfkHvMrPjIKSaptWFl+z9AsMQq7/5IW6hfxx11AUPXY/yfoP4PWHsJ9KBwfv+g==",
"version": "12.2.1",
"resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-12.2.1.tgz",
"integrity": "sha512-9TzgVUKcVHGMYRa/DIit05+uVieiQhd8UEo7f97HTDiDeC1iXFgJjdHSGYyVWfVEQ5WuoryXmk6uYkgugf0y2g==",
"requires": {
"ngx-window-token": "^2.0.0",
"tslib": "^1.9.0"

View File

@ -6,9 +6,7 @@
"scripts": {
"start": "ng serve --ssl true --ssl-key ssl/server.key --ssl-cert ssl/server.crt --host 0.0.0.0 --proxy-config proxy.config.json",
"lint": "tslint \"src/**/*.ts\"",
"lint:lib": "tslint \"lib/**/*.ts\" -e \"lib/dist/**/*\" ",
"lint_fix": "tslint --fix \"src/**/*.ts\"",
"lint:lib_fix": "tslint --fix \"lib/**/*.ts\" -e \"lib/dist/**/*\" ",
"test": "ng test --code-coverage",
"test:watch": "ng test --code-coverage --watch",
"test:debug": "ng test --code-coverage --source-map false",
@ -18,12 +16,7 @@
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"build": "ng build --aot",
"release": "ng build --prod",
"build_lib": "ng build --prod lib",
"npm_pack": "cd lib/dist && npm pack",
"package": "npm run build_lib && npm run npm_pack",
"link_lib": "cd lib/dist && npm link && cd ../../ && npm link @harbor/ui",
"build_all": "npm run build_lib && npm run link_lib && npm run build"
"release": "ng build --prod"
},
"private": true,
"dependencies": {

View File

@ -22,7 +22,6 @@ import { SessionService } from "../../shared/session.service";
import { InlineAlertComponent } from "../../shared/inline-alert/inline-alert.component";
import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
import { SearchTriggerService } from "../../base/global-search/search-trigger.service";
import { CopyInputComponent, CommonRoutes } from "@harbor/ui";
import { AccountSettingsModalService } from './account-settings-modal-service.service';
import { ConfirmationDialogComponent } from "../../shared/confirmation-dialog/confirmation-dialog.component";
import {
@ -31,6 +30,8 @@ import {
} from "../../shared/shared.const";
import { randomWord } from '../../shared/shared.utils';
import { ResetSecret } from './account';
import { CopyInputComponent } from "../../../lib/components/push-image/copy-input.component";
import { CommonRoutes } from "../../../lib/entities/shared.const";
@Component({
selector: "account-settings-modal",
templateUrl: "account-settings-modal.component.html",

View File

@ -15,11 +15,8 @@ import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { map, catchError } from "rxjs/operators";
import { Observable, throwError as observableThrowError } from "rxjs";
import { PasswordSetting } from './password-setting';
import {HTTP_FORM_OPTIONS, HTTP_JSON_OPTIONS, HTTP_GET_OPTIONS} from "@harbor/ui";
import { HTTP_FORM_OPTIONS, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../../lib/utils/utils";
const passwordChangeEndpoint = "/api/users/:user_id/password";
const sendEmailEndpoint = "/c/sendEmail";

View File

@ -18,7 +18,7 @@ import { NgForm } from '@angular/forms';
import { PasswordSettingService } from '../password-setting.service';
import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component';
import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service';
import { CommonRoutes } from '@harbor/ui';
import { CommonRoutes } from "../../../../lib/entities/shared.const";
@Component({
selector: 'reset-password',

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, Output, ViewChild, EventEmitter } from '@angular/core';
import { Modal } from '../../../../lib/src/service/interface';
import { Modal } from '../../../lib/services/interface';
import { NewUserFormComponent } from '../../shared/new-user-form/new-user-form.component';
import { User } from '../../user/user';

View File

@ -13,15 +13,14 @@
// limitations under the License.
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { CookieService } from 'ngx-cookie';
import { AppConfig } from './app-config';
import { CookieKeyOfAdmiral, HarborQueryParamKey } from './shared/shared.const';
import { maintainUrlQueryParmas } from './shared/shared.utils';
import { HTTP_GET_OPTIONS , CONFIG_AUTH_MODE} from '@harbor/ui';
import { map, catchError } from "rxjs/operators";
import { Observable, throwError as observableThrowError } from "rxjs";
import { HTTP_GET_OPTIONS } from "../lib/utils/utils";
import { CONFIG_AUTH_MODE } from "../lib/entities/shared.const";
export const systemInfoEndpoint = "/api/systeminfo";
/**
* Declare service to handle the bootstrap options

View File

@ -11,7 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { ClairDBStatus } from '@harbor/ui';
import { ClairDBStatus } from "../lib/services";
export class AppConfig {
with_notary: boolean;

View File

@ -42,6 +42,7 @@ import { LicenseModule } from './license/license.module';
import { InterrogationServicesComponent } from "./interrogation-services/interrogation-services.component";
import { LabelsComponent } from './labels/labels.component';
import { ProjectQuotasComponent } from './project-quotas/project-quotas.component';
import { HarborLibraryModule } from "../lib/harbor-library.module";
registerLocaleData(zh, 'zh-cn');
registerLocaleData(es, 'es-es');
@ -80,7 +81,8 @@ export function getCurrentLanguage(translateService: TranslateService) {
ConfigurationModule,
DeveloperCenterModule,
OidcOnboardModule,
LicenseModule
LicenseModule,
HarborLibraryModule
],
exports: [
],

View File

@ -15,9 +15,8 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, catchError } from "rxjs/operators";
import { Observable, throwError as observableThrowError } from "rxjs";
import { SearchResults } from './search-results';
import { HTTP_GET_OPTIONS } from "@harbor/ui";
import { HTTP_GET_OPTIONS } from "../../../lib/utils/utils";
const searchEndpoint = "/api/search";
/**

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { Project } from "../../project/project";
import { Repository } from "@harbor/ui";
import { HelmChartSearchResultItem } from "../../project/helm-chart/helm-chart.interface.service";
import { Repository } from "../../../lib/services";
export class SearchResults {
constructor() {

View File

@ -14,7 +14,7 @@
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Subscription } from "rxjs";
import { AppConfigService } from '../..//app-config.service';
import { AppConfigService } from '../../app-config.service';
import { ModalEvent } from '../modal-event';
import { modalEvents } from '../modal-events.const';
@ -23,10 +23,9 @@ import { AccountSettingsModalComponent } from '../../account/account-settings/ac
import { PasswordSettingComponent } from '../../account/password-setting/password-setting.component';
import { NavigatorComponent } from '../navigator/navigator.component';
import { SessionService } from '../../shared/session.service';
import { AboutDialogComponent } from '../../shared/about-dialog/about-dialog.component';
import { SearchTriggerService } from '../global-search/search-trigger.service';
import { CommonRoutes } from '@harbor/ui';
import { CommonRoutes } from "../../../lib/entities/shared.const";
@Component({
selector: 'harbor-shell',

View File

@ -18,16 +18,14 @@ import { TranslateService } from '@ngx-translate/core';
import { PlatformLocation } from '@angular/common';
import { ModalEvent } from '../modal-event';
import { modalEvents } from '../modal-events.const';
import { SessionService } from '../../shared/session.service';
import { CookieService, CookieOptions } from 'ngx-cookie';
import { supportedLangs, enLang, languageNames } from '../../shared/shared.const';
import { CommonRoutes } from '@harbor/ui';
import { AppConfigService } from '../../app-config.service';
import { SearchTriggerService } from '../global-search/search-trigger.service';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { SkinableConfig } from "../../skinable-config.service";
import { CommonRoutes } from "../../../lib/entities/shared.const";
@Component({
selector: 'navigator',

View File

@ -3,12 +3,13 @@ import { MessageHandlerService } from '../../shared/message-handler/message-hand
import { ConfirmMessageHandler } from '../config.msg.utils';
import { AppConfigService } from '../../app-config.service';
import { ConfigurationService } from '../config.service';
import { ErrorHandler, SystemInfoService } from '@harbor/ui';
import { ConfigurationAuthComponent } from './config-auth.component';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { of } from 'rxjs';
import { ErrorHandler } from "../../../lib/utils/error-handler";
import { SystemInfoService } from "../../../lib/services";
describe('ConfigurationAuthComponent', () => {
let component: ConfigurationAuthComponent;

View File

@ -14,14 +14,15 @@
import { Component, Input, ViewChild, SimpleChanges, OnChanges, OnInit, Output, EventEmitter } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Subscription } from "rxjs";
import { Configuration, clone, isEmpty, getChanges, StringValueItem, BoolValueItem, SystemInfoService, ErrorHandler
, CONFIG_AUTH_MODE } from '@harbor/ui';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { ConfirmMessageHandler } from '../config.msg.utils';
import { AppConfigService } from '../../app-config.service';
import { ConfigurationService } from '../config.service';
import { catchError } from 'rxjs/operators';
import { Configuration } from "../../../lib/components/config/config";
import { ErrorHandler } from "../../../lib/utils/error-handler";
import { SystemInfoService } from "../../../lib/services";
import { clone, isEmpty, getChanges as getChangesFunc } from "../../../lib/utils/utils";
import { CONFIG_AUTH_MODE } from "../../../lib/entities/shared.const";
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';
@Component({
@ -179,7 +180,7 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit {
}
public getChanges() {
let allChanges = getChanges(this.originalConfig, this.currentConfig);
let allChanges = getChangesFunc(this.originalConfig, this.currentConfig);
let changes = {};
for (let prop in allChanges) {
if (prop.startsWith('ldap_')

View File

@ -13,19 +13,17 @@
// limitations under the License.
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subscription } from "rxjs";
import {
Configuration, StringValueItem, SystemSettingsComponent,
isEmpty, clone } from '@harbor/ui';
import { ConfirmationTargets, ConfirmationState } from '../shared/shared.const';
import { SessionService } from '../shared/session.service';
import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service';
import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
import { AppConfigService } from '../app-config.service';
import { ConfigurationAuthComponent } from './auth/config-auth.component';
import { ConfigurationEmailComponent } from './email/config-email.component';
import { ConfigurationService } from './config.service';
import { Configuration, StringValueItem } from "../../lib/components/config/config";
import { SystemSettingsComponent } from "../../lib/components/config/system/system-settings.component";
import { clone, isEmpty } from "../../lib/utils/utils";
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';
const TabLinkContentMap = {

View File

@ -15,9 +15,8 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, catchError } from "rxjs/operators";
import { Observable, throwError as observableThrowError } from "rxjs";
import { Configuration, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from '@harbor/ui';
import { Configuration } from "../../lib/components/config/config";
import { HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../lib/utils/utils";
const configEndpoint = "/api/configurations";
const emailEndpoint = "/api/email/ping";

View File

@ -13,11 +13,12 @@
// limitations under the License.
import { Component, Input, ViewChild, SimpleChanges, OnChanges, Output, EventEmitter } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Configuration, clone, isEmpty, getChanges, StringValueItem} from '@harbor/ui';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { ConfirmMessageHandler } from '../config.msg.utils';
import { ConfigurationService } from '../config.service';
import { Configuration } from "../../../lib/components/config/config";
import { isEmpty, getChanges as getChangesFunc, clone } from "../../../lib/utils/utils";
import { errorHandler } from "../../../lib/utils/shared/shared.utils";
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';
@Component({
selector: 'config-email',
@ -56,7 +57,7 @@ export class ConfigurationEmailComponent implements OnChanges {
}
public getChanges() {
let allChanges = getChanges(this.originalConfig, this.currentConfig);
let allChanges = getChangesFunc(this.originalConfig, this.currentConfig);
let changes = {};
for (let prop in allChanges) {
if (prop.startsWith('email_')) {
@ -106,7 +107,7 @@ export class ConfigurationEmailComponent implements OnChanges {
this.msgHandler.showSuccess('CONFIG.TEST_MAIL_SUCCESS');
}, error => {
this.testingMailOnGoing = false;
let err = error.error;
let err = errorHandler(error);
if (!err) {
err = 'UNKNOWN';
}

View File

@ -2,7 +2,6 @@ import { async, ComponentFixture, ComponentFixtureAutoDetect, TestBed } from '@a
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { ClarityModule } from "@clr/angular";
import { of } from "rxjs";
import { ErrorHandler } from "@harbor/ui";
import { ConfigurationScannerComponent } from "./config-scanner.component";
import { ConfigScannerService } from "./config-scanner.service";
import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
@ -12,6 +11,7 @@ import { ScannerMetadataComponent } from "./scanner-metadata/scanner-metadata.co
import { NewScannerModalComponent } from "./new-scanner-modal/new-scanner-modal.component";
import { NewScannerFormComponent } from "./new-scanner-form/new-scanner-form.component";
import { TranslateService } from "@ngx-translate/core";
import { ErrorHandler } from "../../../lib/utils/error-handler";
describe('ConfigurationScannerComponent', () => {
let mockScannerMetadata = {

View File

@ -2,12 +2,13 @@ import { Component, ViewChild, OnInit, OnDestroy } from "@angular/core";
import { Scanner } from "./scanner";
import { NewScannerModalComponent } from "./new-scanner-modal/new-scanner-modal.component";
import { ConfigScannerService } from "./config-scanner.service";
import { clone, ErrorHandler } from "@harbor/ui";
import { finalize } from "rxjs/operators";
import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../shared/shared.const";
import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service";
import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message';
import { ErrorHandler } from "../../../lib/utils/error-handler";
import { clone } from "../../../lib/utils/utils";
@Component({
selector: 'config-scanner',

View File

@ -26,7 +26,7 @@ describe('NewScannerFormComponent', () => {
return of([mockScanner1]).pipe(delay(500));
}
};
beforeEach(async(() => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
SharedModule,
@ -41,9 +41,8 @@ describe('NewScannerFormComponent', () => {
// open auto detect
{ provide: ComponentFixtureAutoDetect, useValue: true }
]
})
.compileComponents();
}));
});
});
beforeEach(() => {
fixture = TestBed.createComponent(NewScannerFormComponent);
component = fixture.componentInstance;

View File

@ -7,9 +7,9 @@ import { NewScannerFormComponent } from "../new-scanner-form/new-scanner-form.co
import { FormBuilder } from "@angular/forms";
import { of, Subscription } from "rxjs";
import { delay } from "rxjs/operators";
import { SharedModule } from "@harbor/ui";
import { SharedModule as AppSharedModule } from "../../../shared/shared.module";
import { Scanner } from "../scanner";
import { SharedModule } from "../../../../lib/utils/shared/shared.module";
describe('NewScannerModalComponent', () => {
let component: NewScannerModalComponent;

View File

@ -5,7 +5,7 @@ import { SharedModule } from "../../../shared/shared.module";
import { ConfigScannerService } from "../config-scanner.service";
import { of } from "rxjs";
import { ScannerMetadataComponent } from "./scanner-metadata.component";
import { ErrorHandler } from "@harbor/ui";
import { ErrorHandler } from "../../../../lib/utils/error-handler";
describe('ScannerMetadataComponent', () => {
let mockScannerMetadata = {

View File

@ -4,10 +4,11 @@ import {
} from "@angular/core";
import { ConfigScannerService } from "../config-scanner.service";
import { finalize } from "rxjs/operators";
import { ErrorHandler, DATABASE_UPDATED_PROPERTY } from "@harbor/ui";
import { ScannerMetadata } from "../scanner-metadata";
import { DatePipe } from "@angular/common";
import { TranslateService } from "@ngx-translate/core";
import { ErrorHandler } from "../../../../lib/utils/error-handler";
import { DATABASE_UPDATED_PROPERTY } from "../../../../lib/utils/utils";
@Component({
selector: 'scanner-metadata',

View File

@ -15,11 +15,10 @@ import { Component, Input, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { Router } from '@angular/router';
import { Subscription } from "rxjs";
import { TranslateService } from '@ngx-translate/core';
import { Message } from './message';
import { MessageService } from './message.service';
import { CommonRoutes, dismissInterval, httpStatusCode } from "../../lib/entities/shared.const";
import { dismissInterval, httpStatusCode, CommonRoutes } from '@harbor/ui';
@Component({
selector: 'global-message',

View File

@ -3,13 +3,12 @@ import { finalize } from 'rxjs/operators';
import { Subscription } from "rxjs";
import { Component, OnInit, EventEmitter, Output, ChangeDetectorRef, OnDestroy, ViewChild } from "@angular/core";
import { NgForm } from "@angular/forms";
import { GroupType } from "@harbor/ui";
import { GroupService } from "../group.service";
import { MessageHandlerService } from "./../../shared/message-handler/message-handler.service";
import { SessionService } from "./../../shared/session.service";
import { UserGroup } from "./../group";
import { AppConfigService } from "../../app-config.service";
import { GroupType } from "../../../lib/entities/shared.const";
@Component({
selector: "hbr-add-group-modal",

View File

@ -4,13 +4,13 @@ import { ClarityModule } from '@clr/angular';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { FormsModule } from '@angular/forms';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { OperationService } from "@harbor/ui";
import { SessionService } from "./../shared/session.service";
import { GroupService } from "./group.service";
import { of } from "rxjs";
import { ConfirmationDialogService } from "./../shared/confirmation-dialog/confirmation-dialog.service";
import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
import { AppConfigService } from '../app-config.service';
import { OperationService } from "../../lib/components/operation/operation.service";
describe('GroupComponent', () => {
let component: GroupComponent;

View File

@ -1,11 +1,8 @@
import { of, Subscription, forkJoin } from "rxjs";
import { flatMap, catchError } from "rxjs/operators";
import { SessionService } from "./../shared/session.service";
import { TranslateService } from "@ngx-translate/core";
import { Component, OnInit, ViewChild, OnDestroy } from "@angular/core";
import { operateChanges, OperateInfo, OperationService, OperationState, errorHandler as errorHandFn, GroupType } from "@harbor/ui";
import {
ConfirmationTargets,
ConfirmationState,
@ -20,6 +17,10 @@ import { GroupService } from "./group.service";
import { MessageHandlerService } from "../shared/message-handler/message-handler.service";
import { throwError as observableThrowError } from "rxjs";
import { AppConfigService } from '../app-config.service';
import { OperationService } from "../../lib/components/operation/operation.service";
import { operateChanges, OperateInfo, OperationState } from "../../lib/components/operation/operate";
import { errorHandler } from "../../lib/utils/shared/shared.utils";
import { GroupType } from "../../lib/entities/shared.const";
@Component({
selector: "app-group",
@ -138,7 +139,7 @@ export class GroupComponent implements OnInit, OnDestroy {
}));
}))
.pipe(catchError(error => {
const message = errorHandFn(error);
const message = errorHandler(error);
this.translateService.get(message).subscribe(res =>
operateChanges(operMessage, OperationState.failure, res)
);

View File

@ -1,11 +1,9 @@
import {throwError as observableThrowError, Observable} from "rxjs";
import {catchError, map} from 'rxjs/operators';
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { UserGroup } from "./group";
import { HTTP_JSON_OPTIONS, HTTP_GET_OPTIONS } from "@harbor/ui";
import { HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../lib/utils/utils";
const userGroupEndpoint = "/api/usergroups";
const ldapGroupSearchEndpoint = "/api/ldap/groups/search?groupname=";

View File

@ -62,12 +62,13 @@ import { LicenseComponent } from './license/license.component';
import { SummaryComponent } from './project/summary/summary.component';
import { TagRetentionComponent } from './project/tag-retention/tag-retention.component';
import { ImmutableTagComponent } from './project/immutable-tag/immutable-tag.component';
import { USERSTATICPERMISSION, VulnerabilityConfigComponent } from '@harbor/ui';
import { ScannerComponent } from "./project/scanner/scanner.component";
import { InterrogationServicesComponent } from "./interrogation-services/interrogation-services.component";
import { ConfigurationScannerComponent } from "./config/scanner/config-scanner.component";
import { LabelsComponent } from "./labels/labels.component";
import { ProjectQuotasComponent } from "./project-quotas/project-quotas.component";
import { VulnerabilityConfigComponent } from "../lib/components/config/vulnerability/vulnerability-config.component";
import { USERSTATICPERMISSION } from "../lib/services";
const harborRoutes: Routes = [

View File

@ -10,8 +10,8 @@ import { of } from 'rxjs';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { HarborLibraryModule } from '@harbor/ui';
import { delay } from 'rxjs/operators';
import { HarborLibraryModule } from "../../lib/harbor-library.module";
describe('AuditLogComponent', () => {
let component: AuditLogComponent;

View File

@ -21,7 +21,7 @@ import { SessionUser } from '../shared/session-user';
import { AuditLogService } from './audit-log.service';
import { MessageHandlerService } from '../shared/message-handler/message-handler.service';
import { State } from '../../../lib/src/service/interface';
import { State } from '../../lib/services/interface';
const optionalSearch: {} = { 0: 'AUDIT_LOG.ADVANCED', 1: 'AUDIT_LOG.SIMPLE' };

View File

@ -17,9 +17,9 @@ import {map, catchError} from 'rxjs/operators';
// limitations under the License.
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
import { AuditLog } from './audit-log';
import {RequestQueryParams, buildHttpRequestOptions, buildHttpRequestOptionsWithObserveResponse} from '@harbor/ui';
import { buildHttpRequestOptions, buildHttpRequestOptionsWithObserveResponse } from "../../lib/utils/utils";
import { RequestQueryParams } from "../../lib/services";
export const logEndpoint = '/api/logs';

View File

@ -2,7 +2,8 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { OidcOnboardService } from './oidc-onboard.service';
import { FormControl } from '@angular/forms';
import { errorHandler, CommonRoutes } from "@harbor/ui";
import { CommonRoutes } from "../../lib/entities/shared.const";
import { errorHandler } from "../../lib/utils/shared/shared.utils";
@Component({
selector: 'app-oidc-onboard',

View File

@ -6,8 +6,8 @@ import { MessageHandlerService } from "../shared/message-handler/message-handler
import { SessionService } from "../shared/session.service";
import { SessionUser } from "../shared/session-user";
import { ConfigurationService } from "../config/config.service";
import { Configuration } from "@harbor/ui";
import { of } from "rxjs";
import { Configuration } from "../../lib/components/config/config";
describe('ProjectQuotasComponent', () => {
let component: ProjectQuotasComponent;

View File

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { Configuration } from "@harbor/ui";
import { SessionService } from "../shared/session.service";
import { ConfigurationService } from "../config/config.service";
import { MessageHandlerService } from "../shared/message-handler/message-handler.service";
import { finalize } from "rxjs/operators";
import { Configuration } from "../../lib/components/config/config";
@Component({
selector: 'app-project-quotas',

View File

@ -5,8 +5,8 @@ import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.com
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { ProjectService } from '@harbor/ui';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import { ProjectService } from "../../../lib/services";
describe('CreateProjectComponent', () => {
let component: CreateProjectComponent;

View File

@ -1,5 +1,3 @@
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -13,6 +11,7 @@ import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
import {
Component,
EventEmitter,
@ -25,16 +24,15 @@ import {
SimpleChanges
} from "@angular/core";
import { NgForm, Validators, AbstractControl } from "@angular/forms";
import { Subject } from "rxjs";
import { TranslateService } from "@ngx-translate/core";
import { MessageHandlerService } from "../../shared/message-handler/message-handler.service";
import { InlineAlertComponent } from "../../shared/inline-alert/inline-alert.component";
import { Project } from "../project";
import { ProjectService, QuotaUnits, QuotaHardInterface, QuotaUnlimited, getByte
, GetIntegerAndUnit, clone, validateLimit, validateCountLimit} from "@harbor/ui";
import { QuotaUnits, QuotaUnlimited } from "../../../lib/entities/shared.const";
import { ProjectService, QuotaHardInterface } from "../../../lib/services";
import { clone, getByte, GetIntegerAndUnit, validateCountLimit, validateLimit } from "../../../lib/utils/utils";
@Component({
selector: "create-project",

View File

@ -1,10 +1,8 @@
import { RoleMapping } from './../../../shared/shared.const';
import { ActivatedRoute, Router } from '@angular/router';
import { Component, OnInit } from "@angular/core";
import { Project } from '../../project';
import { SessionService } from './../../../shared/session.service';
import { SessionUser } from './../../../shared/session-user';
import {finalize} from "rxjs/operators";
@Component({
selector: "project-chart-detail",

View File

@ -5,7 +5,7 @@ import {
ChangeDetectionStrategy
} from "@angular/core";
import { HelmChartDependency } from "./../../helm-chart.interface.service";
import { HelmChartDependency } from "../../helm-chart.interface.service";
@Component({
selector: "hbr-chart-detail-dependency",

View File

@ -5,8 +5,8 @@ import { ClarityModule } from '@clr/angular';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MarkedOptions, MarkdownModule, MarkdownService } from 'ngx-markdown';
import { ErrorHandler, DefaultErrorHandler } from '@harbor/ui';
import { HelmChartService } from '../../helm-chart.service';
import { DefaultErrorHandler, ErrorHandler } from "../../../../../lib/utils/error-handler";
describe('ChartDetailSummaryComponent', () => {
let component: ChartDetailSummaryComponent;
let fixture: ComponentFixture<ChartDetailSummaryComponent>;

View File

@ -4,10 +4,11 @@ import {
ChangeDetectionStrategy,
Input
} from "@angular/core";
import { HelmChartMetaData, HelmChartSecurity } from "./../../helm-chart.interface.service";
import { downloadFile, Label, ErrorHandler } from '@harbor/ui';
import { HelmChartService } from "../../helm-chart.service";
import { Label } from "../../../../../lib/services";
import { ErrorHandler } from "../../../../../lib/utils/error-handler";
import { downloadFile } from "../../../../../lib/utils/utils";
@Component({
selector: "hbr-chart-detail-summary",

View File

@ -1,4 +1,4 @@
@import "./../../../../../../lib/src/mixin";
@import "../../../../../lib/mixin";
.title-container {
display: flex;

View File

@ -5,11 +5,9 @@ import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { HelmChartService } from "../../helm-chart.service";
import {
ErrorHandler, SystemInfoService
} from "@harbor/ui";
import { of } from 'rxjs';
import { ErrorHandler } from "../../../../../lib/utils/error-handler";
import { SystemInfoService } from "../../../../../lib/services";
describe('ChartDetailComponent', () => {
let component: ChartDetailComponent;
let fixture: ComponentFixture<ChartDetailComponent>;

View File

@ -1,4 +1,3 @@
import { downloadFile, SystemInfoService, SystemInfo, ErrorHandler } from "@harbor/ui";
import {
Component,
OnInit,
@ -11,6 +10,9 @@ import { Project } from "../../../project";
import { HelmChartService } from "../../helm-chart.service";
import { HelmChartDetail } from "../../helm-chart.interface.service";
import { finalize } from "rxjs/operators";
import { SystemInfo, SystemInfoService } from "../../../../../lib/services";
import { ErrorHandler } from "../../../../../lib/utils/error-handler";
import { downloadFile } from "../../../../../lib/utils/utils";
@Component({
selector: "hbr-chart-detail",

View File

@ -1,6 +1,4 @@
import { Type } from '@angular/core';
import { Label } from '@harbor/ui';
import { Label } from "../../../lib/services";
export interface HelmChartSearchResultItem {
Name: string;

View File

@ -1,13 +1,12 @@
import {throwError as observableThrowError, Observable } from "rxjs";
import { Injectable, Inject } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { map, catchError } from "rxjs/operators";
import {HttpErrorResponse} from "@angular/common/http";
import { HelmChartItem, HelmChartVersion, HelmChartDetail } from "./helm-chart.interface.service";
import { HTTP_JSON_OPTIONS, HTTP_GET_OPTIONS, SERVICE_CONFIG, IServiceConfig, RequestQueryParams } from "@harbor/ui";
import { RequestQueryParams } from "../../../lib/services";
import { IServiceConfig, SERVICE_CONFIG } from "../../../lib/entities/service.config";
import { HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../../lib/utils/utils";
/**
* Define service methods for handling the helmchart related things.

View File

@ -2,10 +2,9 @@ import { OnInit, Input, EventEmitter, Component, ViewChild, ElementRef, ChangeDe
import {ClrDatagridFilterInterface} from "@clr/angular";
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { Label, Tag } from '@harbor/ui';
import { HelmChartVersion } from '../helm-chart.interface.service';
import { ResourceType } from '../../../shared/shared.const';
import { Label, Tag } from "../../../../lib/services";
@Component({
selector: "hbr-chart-version-label-filter",

View File

@ -4,8 +4,9 @@ import { LabelMarkerComponent } from './label-marker.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { Label, LabelService, ErrorHandler } from '@harbor/ui';
import { of } from 'rxjs';
import { LabelService } from "../../../../lib/services";
import { ErrorHandler } from "../../../../lib/utils/error-handler";
describe('LabelMarkerComponent', () => {
const mockErrorHandler = null;

View File

@ -1,10 +1,10 @@
import { Component, Input, Output, OnInit, EventEmitter, ChangeDetectorRef, ViewChild, ElementRef } from '@angular/core';
import { fromEvent, Subject } from 'rxjs';
import { debounceTime, finalize } from 'rxjs/operators';
import { HelmChartVersion } from '../helm-chart.interface.service';
import { Label, LabelService, ErrorHandler } from '@harbor/ui';
import { ResourceType } from '../../../shared/shared.const';
import { Label, LabelService } from "../../../../lib/services";
import { ErrorHandler } from "../../../../lib/utils/error-handler";
@Component({
selector: 'hbr-resource-label-marker',

View File

@ -44,7 +44,7 @@
</button>
<button type="button" class="btn btn-sm btn-secondary"
[disabled]="selectedRows.length<=0 || !hasDeleteHelmChartVersionPermission"
(click)="openVersionDeleteModal(selectedRows)">
(click)="openVersionDeleteModal()">
<clr-icon shape="times" size="16"></clr-icon>&nbsp;{{'BUTTON.DELETE' | translate}}
</button>
<clr-dropdown>

View File

@ -1,4 +1,4 @@
@import "../../../../../../lib/src/mixin";
@import "../../../../../lib/mixin";
.title-container {
display: flex;

Some files were not shown because too many files have changed in this diff Show More