Ghost/ghost/admin/app/helpers/onboarding-step-class.js
Kevin Ansfield 90d8b41f63
Wired up in-memory onboarding step completion (#19940)
ref https://linear.app/tryghost/issue/IPC-92/add-logic-for-completing-steps

- added in-memory step completion to `onboarding` service
- wired up the onboarding checklist to mark steps as completed when clicked
- extracted re-used step template and logic into components/helpers
2024-03-27 18:27:43 +00:00

17 lines
435 B
JavaScript

import Helper from '@ember/component/helper';
import {inject as service} from '@ember/service';
export default class OnboardingStepClasses extends Helper {
@service onboarding;
compute([step]) {
if (this.onboarding.isStepCompleted(step)) {
return 'gh-onboarding-item--completed';
}
if (this.onboarding.nextStep === step) {
return 'gh-onboarding-item--next';
}
}
}