How to use the @talend/react-components/lib/Actions/Action.DISPLAY_MODE_ICON_TOGGLE function in @talend/react-components

To help you get started, we’ve selected a few @talend/react-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Talend / data-prep / dataprep-webapp / src / app / services / playground / playground-service.spec.js View on Github external
it('should return dataset parameters', inject(($rootScope, state, PlaygroundService) => {
					state.playground.isReadOnly = false;
					state.playground.parameters.visible = false;
					state.playground.lookup.loading = false;

					const action = PlaygroundService.getDatasetParametersAction();

					expect(action[0].id).toEqual('playground-metadata');
					expect(action[0].icon).toEqual('talend-cog');
					expect(action[0].label).toEqual('Edit dataset parameters (encoding, separator, etc.)');
					expect(action[0].displayMode).toEqual(Action.DISPLAY_MODE_ICON_TOGGLE);
					expect(action[0].active).toEqual(false);
					expect(action[0].inProgress).toEqual(false);
				}));
github Talend / data-prep / dataprep-webapp / src / app / services / playground / playground-service.js View on Github external
function getDatasetParametersAction() {
		return state.playground.isReadOnly || SettingsService.isCatalog() ? [] : [{
			id: 'playground-metadata',
			label: $translate.instant('DATAGRID_PARAMETERS_GEAR'),
			icon: 'talend-cog',
			displayMode: Action.DISPLAY_MODE_ICON_TOGGLE,
			active: state.playground.parameters.visible,
			onClick: () => $timeout(StateService.toggleDatasetParameters),
			inProgress: state.playground.lookup.loading,
		}];
	}