Content
View differences
Updated by Tobias Dillmann about 1 year ago
**Acceptance criteria:**
* A calculated value is added to the available as a new project attribute
* The project attribute can be displayed in
* the project overview
* the project list
* A calculated value has these details:
* Name
* Formula
* For all projects
* The formulas can include the following attributes from that project:
* Integer
* Float
* List factors (Project attribute of type list with values) factors)
* Mathematical operators: +, -, \*, /, /, ( and )
* Other calculated values
* In order to trigger the selection of the attributes in the field, the user can use the command "/" as implemented in the Automatically generated subjects.
* The command triggers a dropdown to open with sections for:
* Mathematical operators
* List Project factors
* Calculated values
* Error handling
* In calculations, there is error handling for **circular references**.
* In case the user includes text that is **not an integer or a float,** the field will display an inline error: "Only numeric values, project factors, calculated values and mathematical operators are allowed"
* In case the mathematical operation fails (e.g. because of a **division by zero error**), the field will display an inline error.
* **Open question**: are the factor list attributes required? If they _could_ be empty, we must consider error handling. For example, if the formula contains any attributes that are not set, the field will display an inline error: "The attributes foo and bar are not set. Please set all attributes required for the calculation."
* **Order of operations:** Automatic application of the mathematical rule where multiplication and division are performed before addition and subtraction, unless parentheses dictate otherwise
* Open questions
* Updating a modal showing a calculated value while its factors are being inserted by the user. E.g. a factored list being calculated of 2 custom fields. All are displayed in the same section of the overview page. -> the user opens the modal. inputs first one value, then the second. Then the calculated value is ideally displayed right away.
* \[Technical question\] Is the whole side menu of the overview page displaying the custom fields updated as one or in sections? Relevant for when the calculated value is not in the same section as the values factored in.
* \[Technical question\] Is the calculated value stored in the database or calculated on read?
* Hypothesis: Displayed in the database. Reasons:
* Lots of read access from multiple places.
* Difficulty to calculate a calculated value if it in turn includes a calculated value again.
* In which cases is the recalculation triggered? Cases affecting the value:
* A list value of a factor is inserted
* A list value of a factor is deleted
* A list value of a factor is changed
* A calculated value being a factor is recalculated (changed)
* The calculation formula is changed
* **\[open question\]** \[open question\] Is a specific cause mentioned in the project activity?
* A custom field being used as a factor is disabled in the project
* A calculated value is activated in a project/in multiple projects at the same time.
* Is a calculated value displayed in the activity? Assumption: Yes
* Are the activity messages from float custom field reused?
* What to display if the value cannot (yet) be calculated?
* Assumption: Only show the change from a value not being calculated to the value being calculated (and vice versa). Or if the calculated value changes.
* Idea: Display a tooltip on the calculated value (at least when it is erroneous) that displays the formula possible color coded to indicate the values already present (green) and the ones missing (red). (green/red).
* How to display that a calculated value is read only in the overview page's modals?
* Additional information on the label?
* Always display a tooltip (not only when the field is in erroneous)?
* A calculated value is added
* The project attribute can be displayed in
* the project overview
* the project list
* A calculated value has these details:
* Name
* Formula
* For all projects
* The formulas can include the following attributes from that project:
* Integer
* Float
* List factors (Project attribute of type list with values)
* Mathematical operators: +, -, \*, /,
* Other calculated values
* In order to trigger the selection of the attributes in the field, the user can use the command "/" as implemented in the Automatically generated subjects.
* The command triggers a dropdown to open with sections for:
* Mathematical operators
* List
* Calculated values
* Error handling
* In calculations, there is error handling for **circular references**.
* In case the user includes text that is **not an integer or a float,** the field will display an inline error: "Only numeric values, project factors, calculated values and mathematical operators are allowed"
* In case the mathematical operation fails (e.g. because of a **division by zero error**), the field will display an inline error.
* **Open question**: are the factor list attributes required? If they _could_ be empty, we must consider error handling. For example, if the formula contains any attributes that are not set, the field will display an inline error: "The attributes foo and bar are not set. Please set all attributes required for the calculation."
* **Order of operations:** Automatic application of the mathematical rule where multiplication and division are performed before addition and subtraction, unless parentheses dictate otherwise
* Open questions
* Updating a modal showing a calculated value while its factors are being inserted by the user. E.g. a factored list being calculated of 2 custom fields. All are displayed in the same section of the overview page. -> the user opens the modal. inputs first one value, then the second. Then the calculated value is ideally displayed right away.
* \[Technical question\] Is the whole side menu of the overview page displaying the custom fields updated as one or in sections? Relevant for when the calculated value is not in the same section as the values factored in.
* \[Technical question\] Is the calculated value stored in the database or calculated on read?
* Hypothesis: Displayed in the database. Reasons:
* Lots of read access from multiple places.
* Difficulty to calculate a calculated value if it in turn includes a calculated value again.
* In which cases is the recalculation triggered? Cases affecting the value:
* A list value of a factor is inserted
* A list value of a factor is deleted
* A list value of a factor is changed
* A calculated value being a factor is recalculated (changed)
* The calculation formula is changed
* **\[open question\]**
* A custom field being used as a factor is disabled in the project
* A calculated value is activated in a project/in multiple projects at the same time.
* Is a calculated value displayed in the activity? Assumption: Yes
* Are the activity messages from float custom field reused?
* What to display if the value cannot (yet) be calculated?
* Assumption: Only show the change from a value not being calculated to the value being calculated (and vice versa). Or if the calculated value changes.
* Idea: Display a tooltip on the calculated value (at least when it is erroneous) that displays the formula possible color coded to indicate the values already present (green) and the ones missing (red).
* How to display that a calculated value is read only in the overview page's modals?
* Additional information on the label?
* Always display a tooltip (not only when the field is