fix: subscription (#1918)

* fix: disable button until redirect is ready

* fix: hide unnecessary button

* fix: format audit log retention

* fix: enable descriptions to be empty

* fix: enable descriptions to be empty
This commit is contained in:
Livio Amstutz 2021-06-21 17:35:00 +02:00 committed by GitHub
parent 5d5c15ca9c
commit 796cbc8998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 8 deletions

View File

@ -35,7 +35,7 @@
<p class="error" *ngIf="(stripeCustomer || stripeCustomer == null) && !customerValid">{{'FEATURES.TIER.CUSTOMERINVALID' | translate}}</p>
<div class="current-tier">
<a [disabled]="!org.id || !customerValid" mat-raised-button [href]="stripeURL" target="_blank"
<a [disabled]="!org.id || !customerValid || !stripeURL" mat-raised-button [href]="stripeURL" target="_blank"
alt="change tier">{{'FEATURES.TIER.BTN' | translate}}</a>
</div>
</ng-container>
@ -152,8 +152,8 @@
</div>
</div>
<div class="btn-container">
<button (click)="savePolicy()" [disabled]="(['iam.features.write'] | hasRole | async) == false" color="primary"
<div class="btn-container" *ngIf="(['iam.features.write'] | hasRole | async) == true">
<button (click)="savePolicy()" color="primary"
type="submit" mat-raised-button>{{ 'ACTIONS.SAVE' | translate
}}</button>
</div>

View File

@ -115,7 +115,6 @@ export class FeaturesComponent implements OnDestroy {
this.subService.getLink(this.org.id, window.location.href)
.then(payload => {
this.stripeLoading = false;
console.log(payload);
this.stripeURL = payload.redirect_url;
})
.catch(error => {

View File

@ -18,7 +18,7 @@ export class TimestampToRetentionPipe implements PipeTransform {
if (date?.seconds !== undefined && date?.nanos !== undefined) {
const ms = (date.seconds * 1000 + date.nanos / 1000 / 1000);
const mins = ms / 1000 / 60;
return mins / 60 / 24;
return +(mins / 60 / 24).toFixed(2);
}
}
}

View File

@ -73,13 +73,13 @@ func (wm *IAMFeaturesWriteModel) NewSetEvent(
if tierName != "" && wm.TierName != tierName {
changes = append(changes, features.ChangeTierName(tierName))
}
if tierDescription != "" && wm.TierDescription != tierDescription {
if wm.TierDescription != tierDescription {
changes = append(changes, features.ChangeTierDescription(tierDescription))
}
if wm.State != state {
changes = append(changes, features.ChangeState(state))
}
if stateDescription != "" && wm.StateDescription != stateDescription {
if wm.StateDescription != stateDescription {
changes = append(changes, features.ChangeStateDescription(stateDescription))
}
if auditLogRetention != 0 && wm.AuditLogRetention != auditLogRetention {

View File

@ -80,7 +80,7 @@ func (wm *OrgFeaturesWriteModel) NewSetEvent(
if tierName != "" && wm.TierName != tierName {
changes = append(changes, features.ChangeTierName(tierName))
}
if tierDescription != "" && wm.TierDescription != tierDescription {
if wm.TierDescription != tierDescription {
changes = append(changes, features.ChangeTierDescription(tierDescription))
}
if wm.State != state {