•  
     
    story #38263 Choose my own columns based on field name (numeric, text, dates)
Summary
Empty
Choose my own columns based on field name (numeric, text, dates)

I can see relevant information for me in cross-tracker search widget

The TQL grammar is extended with a SELECT keyword that precedes the previously existing "filtering" conditions. I can write several field names (separated by commas ,) from the selected trackers.

SELECT is optional (to maintain backwards-compatibility of TQL language). When it is absent, the default set of columns is shown: Tracker badge and artifact title, Project label, Status, Last update date, Submitted by, Assigned to.

SELECT i_want_to, remaining_effort WHERE @last_update_date > NOW() -1m

The previous example will show two columns i_want_to and remaining_effort. Those columns will show the artifact values for fields with the same name (respectively i_want_to and remaining_effort). "Duck-typing" rules are applied to those fields for each of the selected trackers: if a field with the same name exists AND it's of a compatible type, then it is selected and will show up in the column.

Duck-typing rules:

  1. For selected trackers that do not have a field named i_want_to, it will show a blank cell in the column.
  2. For selected trackers where the current user does not have permission to read the field, it will show a blank cell.
  3. If NONE of the selected trackers have a field named i_want_to or current user has permission to read NONE of the fields, the query will fail with an error message explaining that the i_want_to field does not exist.
  4. If any one of the selected trackers has a field named i_want_to but its type is not compatible with the others (see below), the query will fail with an error message explaining that the i_want_to fields are not compatible in the selected trackers.
  5. For selected trackers that have a field named i_want_to that current user can see, the column cell will show the field's value for the artifacts of that tracker that match the query

Compatible field types:

  • numeric fields (int and float fields)
  • text fields (string and text)
  • date and date "with time" fields

Other types of fields will be supported in later user stories.

A given field (for example i_want_to) can only be selected once. For example SELECT i_want_to, description, i_want_to will raise an error.

Figma mockup: https://www.figma.com/design/oDjT4tC3fDGP5P4JdKfkdE/Columns-choices---ST?node-id=67-21319

Empty
Empty
Status
Cross tracker search
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#38263
Joris MASSON (jmasson)
2024-10-17 10:17
2024-05-27 11:39
39882

References
Referencing story #38263

Git commit

tuleap/tuleap/stable

refactor: Replace translate directives by gettext a80b01940e
feat: Introduce Query and Selectable 86438bc8d8
refactor: Convert reading mode to composition API 527a01f09f
feat: Selected fields are checked with DuckTyping method 71b6c19a63
fix: Unselecting trackers should be accessible by keyboard 32987be79c
chore: Add base structure to build TQL select SQL fa6aa30862
refactor: Finish conversion to composition API d798c68d82
refactor: Switch cross-tracker search widget to Vue 3 94f575d8bb
fix: User cannot select same field multiple times 2c329e06b8
refacto: put cross tracker report permission checks in dedicated class abde99d4bb
feat: Add select builder for Date[time] fields 69cfe79e08
fix: s/print_r/json_encode/ in CrossTracker TQL 0d06d06c70
refacto: avoid useless instanciation in cross tracker ressource 6b9a683d6d
feat: Add select builder for Text fields 9bb13b519b
feat: Add select builder for Numeric (int+float) fields ef165c8944
refactor: Use fetch-result to retrieve and save report c4687f7123
refactor: Use fetch-result to get projects 0a6bd7a1c3
feat: Add select builder for List fields fields 6b5436d585
feat: Add select builder for User Group List fields fields 2496f739ea
feat: Add select builder for User List fields fields 643150b4d0
feat: Introduce structure to create XTS API return 3475662f51
refactor: Replace tlp-fetch by fetch-result 99a2328db7
feat: Build Date field API return d40bee8d87
feat: Build Text field API return fb2bdeea5b
refacto: Remove the usage of SQL_CALC_FOUND_ROWS 6844e708b6
feat: Build numeric field API return 48b81316c4
refactor: Switch eslint to vue 3 and load styles through Vite assets 46cf1016db
feat: Branch table depending on feature flag 1912f87c27
feat: Show selected date columns cd2b03eec1
feat: Show selected numeric columns 61d3d7dac0
feat: Show selected text columns 1041109887
feat: Be able to write and save a selectable query directly in the widget 2c069e6ef5
fix: DateResultBuilder cannot find field d1c04bddbc
feat: Display the inital report if the user does not want to save the f7c3b153a8
feat: Add pagination in XTS selectable widget 1392182f81
feat: Empty state when no artifact is displayed 1579f750c1
feat: Simplify DOM structure 72780a24f2
feat: Pagination should be accessible ed63a765ca
refactor: vuex store -> provide/inject for report state 2ef48cc33c
refactor: vuex store -> provide/inject for feedbacks bb602bcefc
feat: Improve context of error messages 1e96820fd3
refactor: vuex store -> provide/inject for report data 2c75e53e90
refactor: extendable-error -> Result 322feb6dc1
feat: show CSV export button on the new table 5867ee6333
refactor: Text fields and metadata return empty string instead of null bc977412c5
feat: Text values are not nullable e0c52686e0
Referenced by story #38263

Follow-ups

User avatar
Joris MASSON (jmasson)2024-08-01 15:27
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Status changed from On going to Done
User avatar
Joris MASSON (jmasson)2024-06-11 17:20
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-06-03 12:01
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-05-27 16:27

Apply the same rule as story #10710: if only a single field is not compatible with other fields with the same name, the query will result in an error. We may relax this constraint later if needed.


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-05-27 16:04

Reworded Duck-typing rules. Added numbered list to make it easier to refer to one of the rules.


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-05-27 11:42
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes