mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-7757] Fix delete message
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
</ds-alert>
|
</ds-alert>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-muted" *ngIf="showDeleteInfo">{{'subscriptions.modal.delete-info' | translate}}</p>
|
<p class="text-muted" *ngIf="(showDeleteInfo$ | async)">{{'subscriptions.modal.delete-info' | translate}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline-secondary"
|
<button type="button" class="btn btn-outline-secondary"
|
||||||
|
@@ -49,6 +49,11 @@ export class SubscriptionModalComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
public processing$ = new BehaviorSubject<boolean>(false);
|
public processing$ = new BehaviorSubject<boolean>(false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, show a message explaining how to delete a subscription
|
||||||
|
*/
|
||||||
|
public showDeleteInfo$ = new BehaviorSubject<boolean>(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reactive form group that will be used to add/edit subscriptions
|
* Reactive form group that will be used to add/edit subscriptions
|
||||||
*/
|
*/
|
||||||
@@ -69,8 +74,6 @@ export class SubscriptionModalComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
frequencyDefaultValues = ['D', 'W', 'M'];
|
frequencyDefaultValues = ['D', 'W', 'M'];
|
||||||
|
|
||||||
showDeleteInfo: boolean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if form status has changed and at least one frequency is checked
|
* True if form status has changed and at least one frequency is checked
|
||||||
*/
|
*/
|
||||||
@@ -103,10 +106,8 @@ export class SubscriptionModalComponent implements OnInit {
|
|||||||
this.ePersonId = ePersonId;
|
this.ePersonId = ePersonId;
|
||||||
if (isNotEmpty(this.subscription)) {
|
if (isNotEmpty(this.subscription)) {
|
||||||
this.initFormByGivenSubscription();
|
this.initFormByGivenSubscription();
|
||||||
this.showDeleteInfo = true;
|
|
||||||
} else {
|
} else {
|
||||||
this.initFormByAllSubscriptions();
|
this.initFormByAllSubscriptions();
|
||||||
this.showDeleteInfo = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -153,8 +154,8 @@ export class SubscriptionModalComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get subscription for the eperson & dso object relation
|
* Get subscriptions for the current ePerson & dso object relation.
|
||||||
* If no subscription start with an empty form
|
* If there are no subscriptions then start with an empty form.
|
||||||
*/
|
*/
|
||||||
initFormDataBySubscriptions(): void {
|
initFormDataBySubscriptions(): void {
|
||||||
this.processing$.next(true);
|
this.processing$.next(true);
|
||||||
@@ -163,6 +164,7 @@ export class SubscriptionModalComponent implements OnInit {
|
|||||||
).subscribe({
|
).subscribe({
|
||||||
next: (res: PaginatedList<Subscription>) => {
|
next: (res: PaginatedList<Subscription>) => {
|
||||||
if (res.pageInfo.totalElements > 0) {
|
if (res.pageInfo.totalElements > 0) {
|
||||||
|
this.showDeleteInfo$.next(true);
|
||||||
for (let subscription of res.page) {
|
for (let subscription of res.page) {
|
||||||
const type = subscription.subscriptionType;
|
const type = subscription.subscriptionType;
|
||||||
const subscriptionGroup: FormGroup = this.subscriptionForm.get(type) as FormGroup;
|
const subscriptionGroup: FormGroup = this.subscriptionForm.get(type) as FormGroup;
|
||||||
|
Reference in New Issue
Block a user