mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	 5eda22da7a
			
		
	
	5eda22da7a
	
	
	
		
			
			* add storybook * add storybook files * add ToggleButton and AlertBanner stories * add knobs addon * add notes addon * add ToggleButton and AlertsBanner notes * move panel to right * add ICon * create story blueprint * add header to blueprint * upgrade to storybook 5.0.1 * add confirm-action stories * move addon panel to bottom * update ConfirmAction * add jsdoc comments to alert banner component * add AlertInline * set showPanel to true in blueprint * include newly generated markdown for stories * adjust code example for toggle button * add json-to-markdown to package.json * update AuthForm * add Storybook readme * add AlertPopup * add story markdown custom template * make storybook dependencies optional * center all stories * use message-types helper to dynamically render alerts * hide panel * nest alert stories * move icons into table * separate homelink into multiple stories * add homelink with nav example * remove see links from alert-banner * add script to autogenerate markdown from component and add it to stories * add viewport addon and remove centered addon * update README to include markdown generation * remove @see links from jsdoc comments * update README to include jsdoc example * update alert banner md * get rid of trailing ###### * update jsdoc and regenerate notes files * update i-con md * Update ui/scripts/gen-story-md.js Co-Authored-By: noelledaley <noelledaley@users.noreply.github.com> * Update ui/scripts/gen-story-md.js Co-Authored-By: noelledaley <noelledaley@users.noreply.github.com> * add storybook docs to vault ui readme * add jsdoc comments to component blueprint, automatically import md file in story blueprint * add template template to component blueprint override * apply basic theme to storybook * remove comment * make sure all stories are using auto generated md * storybook: show optional props in brackets * storybook: 🔪 HomeLink * storybook: show AuthConfigForm stories with knobs
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import AuthConfigComponent from './config';
 | |
| import { inject as service } from '@ember/service';
 | |
| import { task } from 'ember-concurrency';
 | |
| import DS from 'ember-data';
 | |
| 
 | |
| /**
 | |
|  * @module AuthConfigForm/Options
 | |
|  * The `AuthConfigForm/Options` is options portion of the auth config form.
 | |
|  *
 | |
|  * @example
 | |
|  * ```js
 | |
|  * {{auth-config-form/options model.model}}
 | |
|  * ```
 | |
|  *
 | |
|  * @property model=null {String} - The corresponding auth model that is being configured.
 | |
|  *
 | |
|  */
 | |
| 
 | |
| export default AuthConfigComponent.extend({
 | |
|   router: service(),
 | |
|   wizard: service(),
 | |
|   saveModel: task(function*() {
 | |
|     let data = this.model.config.serialize();
 | |
|     data.description = this.model.description;
 | |
|     try {
 | |
|       yield this.model.tune(data);
 | |
|     } catch (err) {
 | |
|       // AdapterErrors are handled by the error-message component
 | |
|       // in the form
 | |
|       if (err instanceof DS.AdapterError === false) {
 | |
|         throw err;
 | |
|       }
 | |
|       return;
 | |
|     }
 | |
|     if (this.wizard.currentMachine === 'authentication' && this.wizard.featureState === 'config') {
 | |
|       this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE');
 | |
|     }
 | |
|     this.router.transitionTo('vault.cluster.access.methods').followRedirects();
 | |
|     this.flashMessages.success('The configuration was saved successfully.');
 | |
|   }),
 | |
| });
 |