mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
Merge pull request #4139 from ninjadq/fix_description_too_long
Fix description too long
This commit is contained in:
commit
02554204e4
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harbor-ui",
|
||||
"version": "0.6.30",
|
||||
"version": "0.6.37",
|
||||
"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",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "harbor-ui",
|
||||
"version": "0.6.30",
|
||||
"version": "0.6.37",
|
||||
"description": "Harbor shared UI components based on Clarity and Angular4",
|
||||
"author": "VMware",
|
||||
"module": "index.js",
|
||||
|
@ -0,0 +1,2 @@
|
||||
export const LIST_REPLICATION_RULE_CSS = `
|
||||
`
|
@ -18,7 +18,15 @@ export const LIST_REPLICATION_RULE_TEMPLATE: string = `
|
||||
<clr-dg-cell *ngIf="!projectScope">
|
||||
<a href="javascript:void(0)" (click)="redirectTo(p)">{{p.projects?.length>0 ? p.projects[0].name : ''}}</a>
|
||||
</clr-dg-cell>
|
||||
<clr-dg-cell>{{p.description ? p.description : '-'}}</clr-dg-cell>
|
||||
<clr-dg-cell>
|
||||
{{p.description ? trancatedDescription(p.description) : '-'}}
|
||||
<clr-tooltip>
|
||||
<clr-icon *ngIf="p.description && p.description.length > 35" clrTooltipTrigger shape="ellipsis-horizontal" size="18"></clr-icon>
|
||||
<clr-tooltip-content clrPosition="bottom-right" clrSize="md" *clrIfOpen>
|
||||
<span>{{p.description}}</span>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
</clr-dg-cell>
|
||||
<clr-dg-cell>{{p.targets?.length>0 ? p.targets[0].name : ''}}</clr-dg-cell>
|
||||
<clr-dg-cell>{{p.trigger ? p.trigger.kind : ''}}</clr-dg-cell>
|
||||
</clr-dg-row>
|
||||
|
@ -42,12 +42,14 @@ import { toPromise, CustomComparator } from '../utils';
|
||||
import { State, Comparator } from 'clarity-angular';
|
||||
|
||||
import { LIST_REPLICATION_RULE_TEMPLATE } from './list-replication-rule.component.html';
|
||||
import { LIST_REPLICATION_RULE_CSS } from './list-replication-rule.component.css';
|
||||
import {BatchInfo, BathInfoChanges} from "../confirmation-dialog/confirmation-batch-message";
|
||||
import {Observable} from "rxjs/Observable";
|
||||
|
||||
@Component({
|
||||
selector: 'hbr-list-replication-rule',
|
||||
template: LIST_REPLICATION_RULE_TEMPLATE,
|
||||
styles: [LIST_REPLICATION_RULE_CSS],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ListReplicationRuleComponent implements OnInit, OnChanges {
|
||||
@ -102,6 +104,14 @@ export class ListReplicationRuleComponent implements OnInit, OnChanges {
|
||||
return !this.readonly && !this.projectId ? true : false;
|
||||
}
|
||||
|
||||
trancatedDescription(desc: string): string {
|
||||
if (desc.length > 35 ) {
|
||||
return desc.substr(0, 35);
|
||||
} else {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
//Global scope
|
||||
if (!this.projectScope) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
<clr-icon clrTooltipTrigger shape="info-circle" size="24"></clr-icon>
|
||||
</button>
|
||||
<clr-tooltip-content clrPosition="bottom-left" clrSize="md" *clrIfOpen>
|
||||
<span (click)="openRenameAlert()"> {{'PROFILE.ADMIN_RENAME_TIP'}}</span>
|
||||
<span (click)="openRenameAlert()"> {{'PROFILE.ADMIN_RENAME_TIP' | translate}}</span>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user