Skip to content

feat: add relation column type#2248

Open
Koc wants to merge 1 commit intomainfrom
feature/add-relations-column-type
Open

feat: add relation column type#2248
Koc wants to merge 1 commit intomainfrom
feature/add-relations-column-type

Conversation

@Koc
Copy link
Contributor

@Koc Koc commented Jan 9, 2026

This PR introduces a basic relation type. It allows to connect few tables together. We will store row id as a column value and display selected column as a label for this values. Closes #172.

✔️ Implemented

🔍 Column create/edit

image

🔍 Row create/edit via popup/inline

image

🔍 Row display in table/view + handle relation row removal

image image

🔍 Filter for view

image

🔍 Filter for rows

image image

🔍 Import/Export

image image

🚧 Pending (help welcomed):

  • Behat tests
  • Cypress tests?

❎ What is out of scope:

  • Lookup columns to add an extra columns from the related table to the current one. It will be handled separately in upcoming PR.

@Koc Koc force-pushed the feature/add-relations-column-type branch from c3f6a2d to fdd744e Compare January 15, 2026 17:44
@Koc Koc force-pushed the bugfix/fix-loading-of-large-tables branch from f792683 to f599f40 Compare January 15, 2026 19:21
@Koc Koc force-pushed the feature/add-relations-column-type branch 6 times, most recently from 92af03c to 0f9416b Compare January 16, 2026 00:28
@Aveyron-RetD Aveyron-RetD mentioned this pull request Jan 16, 2026
@Koc Koc force-pushed the feature/add-relations-column-type branch 3 times, most recently from 6a4e073 to 5209182 Compare January 16, 2026 18:06
@Koc Koc changed the base branch from bugfix/fix-loading-of-large-tables to main January 16, 2026 18:06
@Koc Koc force-pushed the feature/add-relations-column-type branch 4 times, most recently from fb98364 to 198afa1 Compare January 16, 2026 18:43
@Koc Koc marked this pull request as ready for review January 16, 2026 19:12
@Koc Koc requested review from blizzz and enjeck as code owners January 16, 2026 19:12
@Koc Koc force-pushed the feature/add-relations-column-type branch from 198afa1 to ddc1bd1 Compare January 16, 2026 20:45
@juliusknorr juliusknorr added the enhancement New feature or request label Jan 21, 2026
@juliusknorr juliusknorr requested a review from samin-z January 21, 2026 20:49
@Koc Koc force-pushed the feature/add-relations-column-type branch 2 times, most recently from f34f8f9 to d406233 Compare January 25, 2026 12:47
@Koc Koc force-pushed the feature/add-relations-column-type branch 4 times, most recently from f092bad to 502b69b Compare February 12, 2026 23:24
@Koc Koc force-pushed the feature/add-relations-column-type branch from 502b69b to 8093d63 Compare February 15, 2026 16:40
@Koc Koc force-pushed the feature/add-relations-column-type branch 7 times, most recently from d45b95c to cb637bd Compare February 28, 2026 18:32
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@enjeck enjeck force-pushed the feature/add-relations-column-type branch from cb637bd to 9b36f43 Compare March 4, 2026 04:59
Copy link
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it works quite well already. A few comments for now. I have only tested the creation of columns and rows so far

})
this.availableLabelColumns = columns
.filter(column =>
column instanceof NumberColumn || column instanceof TextLineColumn,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why restrict to just these 2 column types?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like the relation should easily generalise to all column types

Comment on lines +167 to +177
$targetColumn = $this->columnMapper->find($settings[Column::RELATION_LABEL_COLUMN]);
if ($isView) {
$view = $this->viewMapper->find($targetId);
$rows = $this->row2Mapper->findAll(
[$targetColumn->getId()],
$view->getTableId(),
null,
null,
$view->getFilterArray(),
$view->getSortArray(),
$this->userId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we ever consider permissions such that the user must have access to the table/view before they can link to it?


public function formatRowData(Column $column, array $row) {
$value = $row['value'];
return (int)$value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int(null) is 0. Is 0 a valid id? Could this cause troube?

<div v-if="!isEditing" class="non-edit-mode" @click="handleStartEditing">
<div v-if="isDeleted">
<span class="deleted">{{ value }}</span>
<span class="cursor-help" :title="t('tables', 'This relation is not exists anymore.')">&nbsp;⚠️</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span class="cursor-help" :title="t('tables', 'This relation is not exists anymore.')">&nbsp;⚠️</span>
<span class="cursor-help" :title="t('tables', 'This relation does not exist anymore.')">&nbsp;⚠️</span>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relational properties

3 participants