Skip to content

Commit

Permalink
split survey doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Sispheor committed Sep 22, 2023
1 parent a3ce4d7 commit 7dd5733
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 57 deletions.
57 changes: 0 additions & 57 deletions docs/manual/service_catalog/operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,60 +62,3 @@ flowchart LR
**Default inventory ID** field is expecting an integer that correspond the the inventory ID in RHAAP/AWX.

**Default credential IDs** field is expecting a comma separated list of integer that correspond existings credentials ID in RHAAP/AWX.


## Survey

The survey of an operation can be edited to change the behavior of the generated form of a request.

!!! note

Surveys in Squest are actually surveys attached to each job templates in your RHAAP/AWX.
Squest can only disable the ones that you don't want to be filled by your end users.
Those fields, if declared as mandatory on RHAAP/AWX, will need to be filled anyway by the admin when approving a request.

### Is customer field

A **customer field** is a field that will be displayed into the end user survey.
By default, all fields are enabled when creating a new operation.

!!! note

If the field is set as **required** into the RHAAP/AWX job template survey config then the administrator
will have to fill it in any case during the review of the request.

### Default value


When set, the default value is pre-filled into the final form. It takes precedence over the default value set in RHAAP/AWX job template survey config.

Default value precedence:

```mermaid
flowchart LR
RHAAP/AWX(Default from RHAAP/AWX) --> squest(Default from Squest value) --> User(User's input) --> Admin(Admin's input)
```

!!! note

When used with a 'multiple select' or 'multiple select multiple' type of field, the value need to be a valid one from the RHAAP/AWX survey field options.

**Jinja templating**

Jinja templating can be used in the default value based on the current `{{ instance }}` and `{{ user }}` objects as context.
Examples can be retrieved in the [dedicated documentation section](../advanced/jinja.md).

Full `instance` and `user `object definition can be retrieved through the [API documentation](../../administration/api.md).

### Validators

Field validators are python modules that can be added as plugin to perform a custom check on a form field.
See related [documentation here](../advanced/validators.md).


### Attribute definition

Each field can be linked to an _Attribute definition_ from the resource tracking. This allows to automatically limit the field value to a [quota](../access.md#quota).
The available quota is shown in the form of the request so the end user know what he can still consume.

![survey_quota](../../images/survey_quota.png)
61 changes: 61 additions & 0 deletions docs/manual/service_catalog/survey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Survey

The survey of an operation in Squest is actually the one configured in the RHAAP/AWX job templates.

Squest administrator can select which fields will be exposed to the end users when requesting a service or a day 2 operation.

By default, the approval workflow is composed of 2 steps:

- Customer form (fields noted as 'customer field')
- Admin form (All fields of the job template)

If more steps are needed, you can create a dedicated [approval workflow](../administration/approval_workflow.md).


## Is customer field

A **customer field** is a field that will be displayed into the end user survey.
By default, all fields are enabled when creating a new operation.

Fields that are not **customer fields** can be filled by any users who have the **accept_request** permission.

!!! note

If the field is set as **required** into the RHAAP/AWX job template survey config then the administrator
will have to fill it in any case during the review of the request.

## Default value


When set, the default value is pre-filled into the final form. It takes precedence over the default value set in RHAAP/AWX job template survey config.

Default value precedence:

```mermaid
flowchart LR
RHAAP/AWX(Default from RHAAP/AWX) --> squest(Default from Squest value) --> User(User's input) --> Admin(Admin's input)
```

!!! note

When used with a 'multiple select' or 'multiple select multiple' type of field, the value need to be a valid one from the RHAAP/AWX survey field options.

**Jinja templating**

Jinja templating can be used in the default value based on the current `{{ instance }}` and `{{ user }}` objects as context.
Examples can be retrieved in the [dedicated documentation section](../advanced/jinja.md).

Full `instance` and `user `object definition can be retrieved through the [API documentation](../../administration/api.md).

## Validators

Field validators are python modules that can be added as plugin to perform a custom check on a form field.
See related [documentation here](../advanced/validators.md).


## Attribute definition

Each field can be linked to an _Attribute definition_ from the resource tracking. This allows to automatically limit the field value to a [quota](../access.md#quota).
The available quota is shown in the form of the request so the end user know what he can still consume.

![survey_quota](../../images/survey_quota.png)
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ nav:
- Concept: manual/service_catalog/concept.md
- Service: manual/service_catalog/service.md
- Operation: manual/service_catalog/operation.md
- Survey: manual/service_catalog/survey.md
- Resource tracking:
- Concept: manual/resource_tracking/concept.md
- Attribute: manual/resource_tracking/attributes.md
Expand Down

0 comments on commit 7dd5733

Please sign in to comment.