diff --git a/composer.json b/composer.json index 9ebdb379462dccd07f66a89d80c5a2ade9756bd9..f89f4e5a8019b8a830af3902bfef1742f097102d 100644 --- a/composer.json +++ b/composer.json @@ -4,10 +4,10 @@ "description": "Sets up a site with useful authentication features.", "version": "dev-main", "require": { - "drupal/bpmn_io": "^2.0", + "drupal/bpmn_io": "2.1.x-dev", "drupal/core": ">=10.3", "drupal/eca": "2.1.x-dev", "drupal/login_emailusername": "^3", - "drupal/token": "^1.15" + "drupal/token": "^1" } } diff --git a/config/eca.eca.user_register.yml b/config/eca.eca.user_register.yml new file mode 100644 index 0000000000000000000000000000000000000000..f4e36fda68b514bd7ac995f0bfc498f86373383c --- /dev/null +++ b/config/eca.eca.user_register.yml @@ -0,0 +1,173 @@ +langcode: en +status: true +dependencies: + module: + - eca_base + - eca_form +id: user_register +modeller: bpmn_io +label: 'User registration' +version: 0.0.0 +weight: 0 +events: + Event_build_user_reg_form: + plugin: 'form:form_build' + label: 'Build user register form' + configuration: + form_id: user-register-form + entity_type_id: '' + bundle: '' + operation: '' + successors: + - + id: Activity_set_weight_mail + condition: '' + Event_validate_user_reg_form: + plugin: 'form:form_validate' + label: 'Validate user register form' + configuration: + form_id: user-register-form + entity_type_id: '' + bundle: '' + operation: '' + successors: + - + id: Activity_get_random_string + condition: Flow_notify_on +conditions: + Flow_notify_on: + plugin: eca_form_field_value + configuration: + negate: false + case: false + field_value: '1' + field_name: notify + strip_tags: true + trim: true + xss_filter: true + operator: equal + type: numeric +gateways: { } +actions: + Activity_password_field_not_required: + plugin: eca_form_field_require + label: 'Set password as not required' + configuration: + flag: false + field_name: pass + successors: + - + id: Activity_invisible_state_password + condition: '' + Activity_get_random_string: + plugin: eca_token_set_random_value + label: 'Get random string' + configuration: + token_name: password + mode: password + length: true + successors: + - + id: Activity_set_password + condition: '' + Activity_set_password: + plugin: eca_form_field_set_value + label: 'Set password' + configuration: + field_value: '[password]' + use_yaml: false + field_name: pass + strip_tags: false + trim: false + xss_filter: false + successors: + - + id: Activity_set_status + condition: '' + Activity_set_weight_mail: + plugin: eca_form_field_set_weight + label: 'Set weight for mail' + configuration: + weight: '-10' + field_name: mail + successors: + - + id: Activity_set_weight_name + condition: '' + Activity_set_weight_name: + plugin: eca_form_field_set_weight + label: 'Set weight for name' + configuration: + weight: '-9' + field_name: name + successors: + - + id: Activity_set_weight_notify + condition: '' + Activity_set_weight_notify: + plugin: eca_form_field_set_weight + label: 'Set weight for notify' + configuration: + weight: '-8' + field_name: notify + successors: + - + id: Activity_set_weight_password + condition: '' + - + id: Activity_enable_notify + condition: '' + Activity_set_weight_password: + plugin: eca_form_field_set_weight + label: 'Set weight for password' + configuration: + weight: '-7' + field_name: pass + successors: + - + id: Activity_password_field_not_required + condition: '' + - + id: Activity_invisible_state_status + condition: '' + Activity_enable_notify: + plugin: eca_form_field_default_value + label: 'Enable notify by default' + configuration: + value: '1' + field_name: notify + strip_tags: true + trim: true + xss_filter: true + successors: { } + Activity_invisible_state_status: + plugin: eca_form_field_add_state + label: 'Add invisible state for status' + configuration: + selector: ':input[name="notify"]' + state: invisible + condition: checked + value: '' + field_name: status + successors: { } + Activity_invisible_state_password: + plugin: eca_form_field_add_state + label: 'Add invisible state for password' + configuration: + selector: ':input[name="notify"]' + state: invisible + condition: checked + value: '' + field_name: pass + successors: { } + Activity_set_status: + plugin: eca_form_field_set_value + label: 'Set status' + configuration: + field_value: '1' + use_yaml: false + field_name: status + strip_tags: true + trim: true + xss_filter: true + successors: { } diff --git a/config/eca.model.user_register.yml b/config/eca.model.user_register.yml new file mode 100644 index 0000000000000000000000000000000000000000..abfde2379a8a0d24f56bb4fbeff74af97c4c6de8 --- /dev/null +++ b/config/eca.model.user_register.yml @@ -0,0 +1,425 @@ +langcode: en +status: true +dependencies: + config: + - eca.eca.user_register +id: user_register +label: 'User registration' +tags: + - untagged +documentation: '' +filename: '' +modeldata: | + <?xml version="1.0" encoding="UTF-8"?> + <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:qa="http://some-company/schema/bpmn/qa" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> + <bpmn2:process id="user_register" name="User registration" isExecutable="true" camunda:versionTag="0.0.0"> + <bpmn2:startEvent id="Event_build_user_reg_form" name="Build user register form" camunda:modelerTemplate="org.drupal.event.form:form_build"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="form:form_build" /> + </camunda:properties> + <camunda:field name="form_id"> + <camunda:string>user-register-form</camunda:string> + </camunda:field> + <camunda:field name="entity_type_id"> + <camunda:string></camunda:string> + </camunda:field> + <camunda:field name="bundle"> + <camunda:string></camunda:string> + </camunda:field> + <camunda:field name="operation"> + <camunda:string></camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:outgoing>Flow_11o0sdv</bpmn2:outgoing> + </bpmn2:startEvent> + <bpmn2:task id="Activity_password_field_not_required" name="Set password as not required" camunda:modelerTemplate="org.drupal.action.eca_form_field_require"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_require" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>pass</camunda:string> + </camunda:field> + <camunda:field name="flag"> + <camunda:string>no</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_06up9ti</bpmn2:incoming> + <bpmn2:outgoing>Flow_0zlktex</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:task id="Activity_get_random_string" name="Get random string" camunda:modelerTemplate="org.drupal.action.eca_token_set_random_value"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_token_set_random_value" /> + </camunda:properties> + <camunda:field name="token_name"> + <camunda:string>password</camunda:string> + </camunda:field> + <camunda:field name="mode"> + <camunda:string>password</camunda:string> + </camunda:field> + <camunda:field name="length"> + <camunda:string>32</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_notify_on</bpmn2:incoming> + <bpmn2:outgoing>Flow_0hnx9gz</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:task id="Activity_set_password" name="Set password" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_value"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_value" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>pass</camunda:string> + </camunda:field> + <camunda:field name="field_value"> + <camunda:string>[password]</camunda:string> + </camunda:field> + <camunda:field name="use_yaml"> + <camunda:string>no</camunda:string> + </camunda:field> + <camunda:field name="strip_tags"> + <camunda:string>no</camunda:string> + </camunda:field> + <camunda:field name="trim"> + <camunda:string>no</camunda:string> + </camunda:field> + <camunda:field name="xss_filter"> + <camunda:string>no</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_0hnx9gz</bpmn2:incoming> + <bpmn2:outgoing>Flow_1j0dzck</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:startEvent id="Event_validate_user_reg_form" name="Validate user register form" camunda:modelerTemplate="org.drupal.event.form:form_validate"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="form:form_validate" /> + </camunda:properties> + <camunda:field name="form_id"> + <camunda:string>user-register-form</camunda:string> + </camunda:field> + <camunda:field name="entity_type_id"> + <camunda:string></camunda:string> + </camunda:field> + <camunda:field name="bundle"> + <camunda:string></camunda:string> + </camunda:field> + <camunda:field name="operation"> + <camunda:string></camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:outgoing>Flow_notify_on</bpmn2:outgoing> + </bpmn2:startEvent> + <bpmn2:task id="Activity_set_weight_mail" name="Set weight for mail" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_weight"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_weight" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>mail</camunda:string> + </camunda:field> + <camunda:field name="weight"> + <camunda:string>-10</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_11o0sdv</bpmn2:incoming> + <bpmn2:outgoing>Flow_15exqlf</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:task id="Activity_set_weight_name" name="Set weight for name" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_weight"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_weight" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>name</camunda:string> + </camunda:field> + <camunda:field name="weight"> + <camunda:string>-9</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_15exqlf</bpmn2:incoming> + <bpmn2:outgoing>Flow_0h7yuqs</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_15exqlf" sourceRef="Activity_set_weight_mail" targetRef="Activity_set_weight_name" /> + <bpmn2:task id="Activity_set_weight_notify" name="Set weight for notify" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_weight"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_weight" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>notify</camunda:string> + </camunda:field> + <camunda:field name="weight"> + <camunda:string>-8</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_0h7yuqs</bpmn2:incoming> + <bpmn2:outgoing>Flow_0hdsmjk</bpmn2:outgoing> + <bpmn2:outgoing>Flow_10m8xkv</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_0h7yuqs" sourceRef="Activity_set_weight_name" targetRef="Activity_set_weight_notify" /> + <bpmn2:task id="Activity_set_weight_password" name="Set weight for password" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_weight"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_weight" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>pass</camunda:string> + </camunda:field> + <camunda:field name="weight"> + <camunda:string>-7</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_0hdsmjk</bpmn2:incoming> + <bpmn2:outgoing>Flow_06up9ti</bpmn2:outgoing> + <bpmn2:outgoing>Flow_1lbfwr3</bpmn2:outgoing> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_0hdsmjk" sourceRef="Activity_set_weight_notify" targetRef="Activity_set_weight_password" /> + <bpmn2:sequenceFlow id="Flow_06up9ti" sourceRef="Activity_set_weight_password" targetRef="Activity_password_field_not_required" /> + <bpmn2:sequenceFlow id="Flow_11o0sdv" sourceRef="Event_build_user_reg_form" targetRef="Activity_set_weight_mail" /> + <bpmn2:sequenceFlow id="Flow_10m8xkv" sourceRef="Activity_set_weight_notify" targetRef="Activity_enable_notify" /> + <bpmn2:task id="Activity_enable_notify" name="Enable notify by default" camunda:modelerTemplate="org.drupal.action.eca_form_field_default_value"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_default_value" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>notify</camunda:string> + </camunda:field> + <camunda:field name="value"> + <camunda:string>1</camunda:string> + </camunda:field> + <camunda:field name="strip_tags"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="trim"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="xss_filter"> + <camunda:string>yes</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_10m8xkv</bpmn2:incoming> + </bpmn2:task> + <bpmn2:task id="Activity_invisible_state_status" name="Add invisible state for status" camunda:modelerTemplate="org.drupal.action.eca_form_field_add_state"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_add_state" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>status</camunda:string> + </camunda:field> + <camunda:field name="selector"> + <camunda:string>:input[name="notify"]</camunda:string> + </camunda:field> + <camunda:field name="state"> + <camunda:string>invisible</camunda:string> + </camunda:field> + <camunda:field name="condition"> + <camunda:string>checked</camunda:string> + </camunda:field> + <camunda:field name="value"> + <camunda:string></camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_1lbfwr3</bpmn2:incoming> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_1lbfwr3" sourceRef="Activity_set_weight_password" targetRef="Activity_invisible_state_status" /> + <bpmn2:task id="Activity_invisible_state_password" name="Add invisible state for password" camunda:modelerTemplate="org.drupal.action.eca_form_field_add_state"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_add_state" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>pass</camunda:string> + </camunda:field> + <camunda:field name="selector"> + <camunda:string>:input[name="notify"]</camunda:string> + </camunda:field> + <camunda:field name="state"> + <camunda:string>invisible</camunda:string> + </camunda:field> + <camunda:field name="condition"> + <camunda:string>checked</camunda:string> + </camunda:field> + <camunda:field name="value"> + <camunda:string></camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_0zlktex</bpmn2:incoming> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_0zlktex" sourceRef="Activity_password_field_not_required" targetRef="Activity_invisible_state_password" /> + <bpmn2:sequenceFlow id="Flow_notify_on" name="notify?" camunda:modelerTemplate="org.drupal.condition.eca_form_field_value" sourceRef="Event_validate_user_reg_form" targetRef="Activity_get_random_string"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_value" /> + </camunda:properties> + <camunda:field name="operator"> + <camunda:string>equal</camunda:string> + </camunda:field> + <camunda:field name="field_value"> + <camunda:string>1</camunda:string> + </camunda:field> + <camunda:field name="type"> + <camunda:string>numeric</camunda:string> + </camunda:field> + <camunda:field name="field_name"> + <camunda:string>notify</camunda:string> + </camunda:field> + <camunda:field name="case"> + <camunda:string>no</camunda:string> + </camunda:field> + <camunda:field name="strip_tags"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="trim"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="xss_filter"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="negate"> + <camunda:string>no</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + </bpmn2:sequenceFlow> + <bpmn2:sequenceFlow id="Flow_0hnx9gz" sourceRef="Activity_get_random_string" targetRef="Activity_set_password" /> + <bpmn2:task id="Activity_set_status" name="Set status" camunda:modelerTemplate="org.drupal.action.eca_form_field_set_value"> + <bpmn2:extensionElements> + <camunda:properties> + <camunda:property name="pluginid" value="eca_form_field_set_value" /> + </camunda:properties> + <camunda:field name="field_name"> + <camunda:string>status</camunda:string> + </camunda:field> + <camunda:field name="field_value"> + <camunda:string>1</camunda:string> + </camunda:field> + <camunda:field name="use_yaml"> + <camunda:string>no</camunda:string> + </camunda:field> + <camunda:field name="strip_tags"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="trim"> + <camunda:string>yes</camunda:string> + </camunda:field> + <camunda:field name="xss_filter"> + <camunda:string>yes</camunda:string> + </camunda:field> + </bpmn2:extensionElements> + <bpmn2:incoming>Flow_1j0dzck</bpmn2:incoming> + </bpmn2:task> + <bpmn2:sequenceFlow id="Flow_1j0dzck" sourceRef="Activity_set_password" targetRef="Activity_set_status" /> + </bpmn2:process> + <bpmndi:BPMNDiagram id="sid-a8eb0b86-a2df-41a8-a587-447d1412f7af"> + <bpmndi:BPMNPlane id="sid-04236ce1-77b9-4afe-96b0-0f849f32f8c0" bpmnElement="user_register"> + <bpmndi:BPMNShape id="Event_0sao8cz_di" bpmnElement="Event_build_user_reg_form"> + <dc:Bounds x="552" y="272" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="540" y="315" width="62" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1s3bv3y_di" bpmnElement="Activity_password_field_not_required"> + <dc:Bounds x="1160" y="350" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1sjxc39_di" bpmnElement="Activity_set_weight_mail"> + <dc:Bounds x="680" y="250" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0ay482e_di" bpmnElement="Activity_set_weight_name"> + <dc:Bounds x="840" y="250" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1nvp61x_di" bpmnElement="Activity_set_weight_notify"> + <dc:Bounds x="1000" y="250" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1mym7hi_di" bpmnElement="Activity_set_weight_password"> + <dc:Bounds x="1160" y="250" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_17r27q0_di" bpmnElement="Activity_invisible_state_status"> + <dc:Bounds x="1310" y="250" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0zweeww_di" bpmnElement="Activity_invisible_state_password"> + <dc:Bounds x="1310" y="350" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0vrozi5_di" bpmnElement="Activity_enable_notify"> + <dc:Bounds x="1000" y="350" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0vk3zws_di" bpmnElement="Activity_get_random_string"> + <dc:Bounds x="680" y="470" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_15o78yd_di" bpmnElement="Activity_set_password"> + <dc:Bounds x="840" y="470" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Event_1hyon6h_di" bpmnElement="Event_validate_user_reg_form"> + <dc:Bounds x="552" y="492" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="538" y="535" width="67" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_12vnaim_di" bpmnElement="Activity_set_status"> + <dc:Bounds x="1000" y="470" width="100" height="80" /> + <bpmndi:BPMNLabel /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_15exqlf_di" bpmnElement="Flow_15exqlf"> + <di:waypoint x="780" y="290" /> + <di:waypoint x="840" y="290" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0h7yuqs_di" bpmnElement="Flow_0h7yuqs"> + <di:waypoint x="940" y="290" /> + <di:waypoint x="1000" y="290" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0hdsmjk_di" bpmnElement="Flow_0hdsmjk"> + <di:waypoint x="1100" y="290" /> + <di:waypoint x="1160" y="290" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_06up9ti_di" bpmnElement="Flow_06up9ti"> + <di:waypoint x="1210" y="330" /> + <di:waypoint x="1210" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_11o0sdv_di" bpmnElement="Flow_11o0sdv"> + <di:waypoint x="588" y="290" /> + <di:waypoint x="680" y="290" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_10m8xkv_di" bpmnElement="Flow_10m8xkv"> + <di:waypoint x="1050" y="330" /> + <di:waypoint x="1050" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1lbfwr3_di" bpmnElement="Flow_1lbfwr3"> + <di:waypoint x="1260" y="290" /> + <di:waypoint x="1310" y="290" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0zlktex_di" bpmnElement="Flow_0zlktex"> + <di:waypoint x="1260" y="390" /> + <di:waypoint x="1310" y="390" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1hmox9e_di" bpmnElement="Flow_notify_on"> + <di:waypoint x="588" y="510" /> + <di:waypoint x="680" y="510" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="633" y="492" width="33" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0hnx9gz_di" bpmnElement="Flow_0hnx9gz"> + <di:waypoint x="780" y="510" /> + <di:waypoint x="840" y="510" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1j0dzck_di" bpmnElement="Flow_1j0dzck"> + <di:waypoint x="940" y="510" /> + <di:waypoint x="1000" y="510" /> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> + </bpmn2:definitions> diff --git a/recipe.yml b/recipe.yml index 7a79eeea32cb9e6a40eb946fe0ae954e684afb97..eb5cab89435e6848eee8c733497d48b32dd6dc8f 100644 --- a/recipe.yml +++ b/recipe.yml @@ -4,6 +4,7 @@ type: Drupal CMS install: - bpmn_io - eca_base + - eca_form - eca_misc - eca_user - login_emailusername diff --git a/tests/e2e/spec.cy.js b/tests/e2e/spec.cy.js new file mode 100644 index 0000000000000000000000000000000000000000..aa8cca5ac09891df7ec3d7c8899a1faae8796fe4 --- /dev/null +++ b/tests/e2e/spec.cy.js @@ -0,0 +1,34 @@ +describe('Authentication tweaks', () => { + + beforeEach(() => { + cy.setUp('standard').applyRecipe(); + }); + + after(() => { + cy.tearDown(); + }); + + it('hides the password field if user will be notified of new account', () => { + cy.drupalLogin('admin'); + cy.visit('/admin/people/create'); + + const notifyCheckbox = cy.findByLabelText('Notify user of new account') + .should('be.checked'); + const passwordField = cy.findByLabelText('Password') + .should('exist') + .and('not.be.visible'); + notifyCheckbox.uncheck(); + passwordField.should('be.visible').and('be.empty'); + cy.findByLabelText('Confirm password') + .should('exist') + .and('be.empty') + .and('not.be.visible'); + notifyCheckbox.check(); + + cy.findByLabelText('Email address').type('chef@drupal.local'); + cy.findByLabelText('Username').type('chef'); + cy.findByDisplayValue('Create new account').click(); + cy.get('[data-drupal-messages]').should('contain.text', 'A welcome message with further instructions has been emailed to the new user chef.'); + }); + +}) diff --git a/tests/src/Functional/RedirectsTest.php b/tests/src/Functional/RedirectsTest.php index 2ee480990d126252f30efb0d9029a2146dcad938..a011511a472c6abf60c9c56a51697fa27adea7be 100644 --- a/tests/src/Functional/RedirectsTest.php +++ b/tests/src/Functional/RedirectsTest.php @@ -28,7 +28,6 @@ class RedirectsTest extends BrowserTestBase { // Apply the recipe again to prove that it's idempotent. $this->applyRecipe($dir); - $session = $this->getSession(); $assert_session = $this->assertSession(); // A 403 should redirect to the login page, forwarding to the original