Skip to content

Draft: POC: Allow using GLQL in Wikis

Himanshu Kapoor requested to merge 440857-glql-integration into master

What does this MR do and why?

Allow using GLQL in Wikis

Include the @gitlab/query-language library and integrate it with render_gfm to render any GLQL blocks into a table or a list of data.

This initial version supports presentation options: display, fields, limit and caption. Also includes various presenters to present GitLab references like issues, milestones, users and health status.

Changelog: added

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

image

image.png

Video demo

Screen Recording 2024-08-05 at 17.15.37.mov

How to set up and validate locally

  1. Enable feature flag :glql_integration.
  2. In a project, assign yourself some issues.
  3. Create a wiki page with the following content:
```glql
---
display: table
fields: title, state, author, assignees, createdAt, updatedAt, description, dueDate, epic, healthStatus, labels, milestone, weight
caption: Issues assigned to me
---
assignee = currentUser()
```

Presentation layer

The optional YAML front matter block above the query contains presentation options.

Currently supported options:

  • display: How to display the data. Currently supported options: table, list or numericList. Default: table.
  • limit: How many items to display. Current default: 100. Max limit is also 100.
  • fields: A comma separated value of fields. If not provided, only title field is included by default.
  • caption: An optional caption to render below the table (or above the list).

Currently supported fields: assignees, author, closedAt, createdAt, description, dueDate, epic, healthStatus, labels, milestone, state, timeEstimate, title, type, updatedAt, weight.

Examples of GLQL queries:

  • weight=1
  • assignee = currentUser()
  • label in ("devops::plan", "devops::create")
  • label != "backend" and author = currentUser() and weight = 1 and updated > today()
  • weight = 1 and updated > startOfDay("-7")
  • updated > today()

Sorting the table

You can sort the table by clicking any header cell. Click once to sort ascending. Click twice to sort descending. The sort options are saved in local storage for that particular query.

Resizing table columns

You can resize table columns by dragging the border between two columns. Column widths are also saved in local storage for that particular query.

Screen Recording 2024-08-04 at 17.09.22.mov

Related to #440857 (closed), #471837 (closed)

Edited by Vladimir Shushlin

Merge request reports

Loading