wizard.ts 777 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ///<reference path="../../headers/common.d.ts" />
  2. import config from 'app/core/config';
  3. import _ from 'lodash';
  4. import $ from 'jquery';
  5. import coreModule from 'app/core/core_module';
  6. import appEvents from 'app/core/app_events';
  7. export class WizardSrv {
  8. /** @ngInject */
  9. constructor() {
  10. }
  11. }
  12. export class WizardStep {
  13. name: string;
  14. fn: any;
  15. }
  16. export class WizardFlow {
  17. name: string;
  18. steps: WizardStep[];
  19. constructor(name) {
  20. this.name = name;
  21. this.steps = [];
  22. }
  23. addStep(name, stepFn) {
  24. this.steps.push({
  25. name: name,
  26. fn: stepFn
  27. });
  28. }
  29. start() {
  30. appEvents.emit('show-modal', {
  31. src: 'public/app/features/plugins/partials/wizard.html',
  32. model: this
  33. });
  34. }
  35. }
  36. coreModule.service('wizardSrv', WizardSrv);