Fix some UI bugs (#15486)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-08-26 15:24:45 +08:00 committed by GitHub
parent 9aab74d382
commit b58158c30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

View File

@ -214,7 +214,10 @@ export class CreateEditEndpointComponent
this.endpointService.getEndpoint(targetId).subscribe(
target => {
this.target = target;
this.urlDisabled = this.target.type === 'docker-hub';
this.urlDisabled = this.adapterInfo &&
this.adapterInfo[this.target.type] &&
this.adapterInfo[this.target.type].endpoint_pattern &&
this.adapterInfo[this.target.type].endpoint_pattern.endpoint_type === FIXED_PATTERN_TYPE;
// Keep data cache
this.initVal = clone(target);
this.initVal.credential.access_secret = this.target.type === 'google-gcr' ? FAKE_JSON_KEY : FAKE_PASSWORD;

View File

@ -207,7 +207,7 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
get isValid() {
if (this.ruleForm.controls["dest_namespace"].value) {
if (this.ruleForm.controls["dest_namespace"].invalid) {
if (this.ruleForm.controls["dest_namespace"].invalid) {this.ruleForm.get('trigger').get('trigger_settings').get('cron').value
return false;
}
}
@ -567,6 +567,7 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
&& this.ruleForm.get('trigger').get('trigger_settings').get('cron')
&& (this.ruleForm.get('trigger').get('trigger_settings').get('cron').touched
|| this.ruleForm.get('trigger').get('trigger_settings').get('cron').dirty)
&& this.ruleForm.get('trigger').get('trigger_settings').get('cron').value
&& !cronRegex(this.ruleForm.get('trigger').get('trigger_settings').get('cron').value);
}
stickLabel(value, index) {

View File

@ -77,7 +77,7 @@
<button class="btn btn-link" (click)="goToRepos()">{{'SUMMARY.SEE_ALL' | translate}}</button>
</div>
</div>
<div class="card clickable" *ngIf="hasReadChartPermission">
<div class="card clickable" *ngIf="hasReadChartPermission && withHelmChart">
<div class="card-header">
<div>{{"PROJECT_DETAIL.HELMCHART" | translate}}</div>
<div class="clr-row number">{{summaryInformation?.chart_count ? summaryInformation?.chart_count : 0}}</div>

View File

@ -132,13 +132,13 @@ describe('SummaryComponent', () => {
expect(container).toBeTruthy();
});
it('should show three cards', async () => {
it('should show two cards', async () => {
component.summaryInformation = mockedSummaryInformation;
component.isCardView = true;
component.hasReadChartPermission = true;
fixture.detectChanges();
await fixture.whenStable();
const cards = fixture.nativeElement.querySelectorAll(".card");
expect(cards.length).toEqual(3);
expect(cards.length).toEqual(2);
});
});