Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arrow misalignment in M2A relation settings #22350

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/unlucky-bugs-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

Check warning on line 1 in .changeset/unlucky-bugs-refuse.md

View workflow job for this annotation

GitHub Actions / Lint

File ignored by default.
'@directus/app': patch
---

Fixed arrow alignment when selecting 5 or more collections in the "Relationship" tab of M2A interface settings
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ const unsortableJunctionFields = computed(() => {
/>
</div>

<v-input disabled :model-value="currentPrimaryKey" />
<div class="primary-key">
<div class="field-wrapper">
<v-input disabled :model-value="currentPrimaryKey" />
<v-icon class="arrow" name="arrow_forward" />
</div>
</div>

<related-field-select
v-model="junctionFieldCurrent"
Expand All @@ -104,24 +109,29 @@ const unsortableJunctionFields = computed(() => {

<div class="spacer" />

<related-field-select
v-model="oneCollectionField"
:collection="junctionCollection"
:placeholder="t('collection_key') + '...'"
:disabled="autoGenerateJunctionRelation || isExisting"
/>
<div class="junction-field-related">
<div class="field-wrapper">
<related-field-select
v-model="oneCollectionField"
:collection="junctionCollection"
:placeholder="t('collection_key') + '...'"
:disabled="autoGenerateJunctionRelation || isExisting"
/>
<v-icon class="arrow" name="arrow_back" />
</div>
</div>

<div class="spacer" />

<related-field-select v-model="junctionFieldRelated" :disabled="autoGenerateJunctionRelation || isExisting" />
<div class="field-wrapper">
<related-field-select v-model="junctionFieldRelated" :disabled="autoGenerateJunctionRelation || isExisting" />
<v-icon class="arrow" name="arrow_back" />
</div>

<v-input disabled :model-value="t('primary_key')" />

<div class="spacer" />
<v-checkbox v-if="!isExisting" v-model="autoGenerateJunctionRelation" block :label="t('auto_fill')" />
<v-icon class="arrow" name="arrow_forward" />
<v-icon class="arrow" name="arrow_back" />
<v-icon class="arrow" name="arrow_back" />
</div>

<div class="sort-field">
Expand Down Expand Up @@ -229,27 +239,30 @@ const unsortableJunctionFields = computed(() => {
gap: 12px 28px;
margin-top: 48px;

.v-icon.arrow {
--v-icon-color: var(--theme--primary);
.field-wrapper {
display: flex;
flex: 1;
position: relative;

position: absolute;
transform: translateX(-50%);
pointer-events: none;
.v-icon.arrow {
--v-icon-color: var(--theme--primary);
position: absolute;
pointer-events: none;

&:first-of-type {
top: 117px;
left: 32.5%;
top: 50%;
transform: translateY(-50%);
right: -26px; // moves it to the center of the column-gap ( icon-width + (gap - icon-width) / 2 )
}
}

&:nth-of-type(2) {
top: 190px;
left: 67.4%;
}
.junction-field-related {
display: flex;
align-items: flex-end;
}

&:last-of-type {
top: 261px;
left: 67.4%;
}
.primary-key {
display: flex;
align-items: flex-start;
}
}

Expand Down