open-nomad/ui/app/components/das/dismissed.js
2023-04-10 15:36:59 +00:00

28 lines
730 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import localStorageProperty from 'nomad-ui/utils/properties/local-storage';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class DasDismissedComponent extends Component {
@localStorageProperty('nomadRecommendationDismssalUnderstood', false)
explanationUnderstood;
@tracked dismissInTheFuture = false;
@action
proceedAutomatically() {
this.args.proceed({ manuallyDismissed: false });
}
@action
understoodClicked() {
this.explanationUnderstood = this.dismissInTheFuture;
this.args.proceed({ manuallyDismissed: true });
}
}