* empty commit
* Add missing copyright headers
* chore: 🤖 update copywrite config file with correct year
* Add missing copyright headers
* empty commit (gh action merge checks are stuck)
44 lines
988 B
JavaScript
44 lines
988 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2021, 2026
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
|
|
/**
|
|
* A component that yields for each pending confirmation in the confirmations
|
|
* service, passing the confirmation instance, a confirm action, and a dismiss
|
|
* action. Useful for rendering confirm modals and awaiting user action.
|
|
*/
|
|
export default class PendingConfirmationsComponent extends Component {
|
|
// =services
|
|
|
|
@service confirm;
|
|
|
|
// =actions
|
|
|
|
/**
|
|
* Accepts the passed confirmation.
|
|
* @param {Confirmation} confirmation
|
|
* @return {Confirmation}
|
|
*/
|
|
@action
|
|
accept(confirmation) {
|
|
confirmation.confirm();
|
|
return confirmation;
|
|
}
|
|
|
|
/**
|
|
* Denies the passed confirmation.
|
|
* @param {Confirmation} confirmation
|
|
* @return {Confirmation}
|
|
*/
|
|
@action
|
|
deny(confirmation) {
|
|
confirmation.dismiss();
|
|
return confirmation;
|
|
}
|
|
}
|