Skip to content

Commit

Permalink
fix(settings/media-repurposing): prevent creating more than 20 rules …
Browse files Browse the repository at this point in the history
…per partner KMCNG-2635
  • Loading branch information
amirch1 committed May 19, 2024
1 parent 86117d2 commit 9423c79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/applications/settings-mr-app/rules/rules.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class RulesComponent implements OnInit, OnDestroy {
@ViewChild('deletePopup', { static: true }) public deletePopup: PopupWidgetComponent;
@ViewChild('actionsmenu', { static: true }) private _actionsMenu: Menu;

private MAX_ALLOWED_PROFILES = 20;
public _isBusy = false;
public _profiles: ManagedTasksProfile[] = [];
public _profilesCount = 0;
Expand Down Expand Up @@ -167,10 +168,14 @@ export class RulesComponent implements OnInit, OnDestroy {
}

public _addProfile(): void {
this._analytics.trackClickEvent('Add_ManagedTasksProfile');
this._logger.info(`handle add ManagedTasksProfile action by user`);
this._currentEditProfile = null;
this.newPopup.open();
if (this._profilesCount >= this.MAX_ALLOWED_PROFILES) {
this.displayError(this._appLocalization.get('applications.settings.mr.maxRulesErr'));
} else {
this._analytics.trackClickEvent('Add_ManagedTasksProfile');
this._logger.info(`handle add ManagedTasksProfile action by user`);
this._currentEditProfile = null;
this.newPopup.open();
}
}

public _editProfile(profile: ManagedTasksProfile): void {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,7 @@
},
"mr": {
"rules": "Rules",
"maxRulesErr": "You've reached the maximum number of rules for your license. To add additional rules, please delete one of the rules on your account or contact your Kaltura administrator.",
"review": "Review",
"logs": "Reports",
"settings": "Settings",
Expand Down

0 comments on commit 9423c79

Please sign in to comment.