Skip to content

Commit

Permalink
fix(design): edit columns
Browse files Browse the repository at this point in the history
- add column info popover
- don't show -1 as maxTextLength, which just means unlimited
- visual fixes

Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
  • Loading branch information
Florian Steffens committed Sep 8, 2023
1 parent c809170 commit dc5a2fb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 20 deletions.
28 changes: 18 additions & 10 deletions src/modules/main/partials/ColumnInfoPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@
</template>
<table>
<tr>
<td>
<td class="key">
{{ t('tables', 'Last edit') }}
</td>
<td>
{{ updateTime }}<br>
<td class="value">
{{ updateTime }}&nbsp;
<NcUserBubble :user="column.lastEditBy" :display-name="column.lastEditBy" />
</td>
</tr>
<tr>
<td>
<td class="key">
{{ t('tables', 'Create') }}
</td>
<td>
{{ createTime }}<br>
<td class="value">
{{ createTime }}&nbsp;
<NcUserBubble :user="column.createdBy" :display-name="column.createdBy" />
</td>
</tr>
<tr>
<td>
<td class="key">
{{ t('tables', 'Column ID') }}
</td>
<td>
<td class="value">
{{ column.id }}
</td>
</tr>
<tr>
<td>
<td class="key">
{{ t('tables', 'Table ID') }}
</td>
<td>
<td class="value">
{{ column.tableId }}
</td>
</tr>
Expand Down Expand Up @@ -80,4 +80,12 @@ export default {
vertical-align: text-top;
}
td {
vertical-align: top;
}
td.value {
text-align: end;
}
</style>
22 changes: 14 additions & 8 deletions src/modules/modals/EditColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
</div>
</div>
<div class="buttons">
<ColumnInfoPopover v-if="debug" :column="column" />
<div class="last-edit-info">
{{ t('tables', 'Last edit') + ': ' }}
{{ updateTime }}
<NcUserBubble :user="column.lastEditBy" :display-name="column.lastEditBy" />
<div class="flex">
<ColumnInfoPopover :column="column" />&nbsp;
<div class="last-edit-info">
{{ t('tables', 'Last edit') + ': ' }}
{{ updateTime }}&nbsp;
<NcUserBubble :user="column.lastEditBy" :display-name="column.lastEditBy" />
</div>
</div>
<div style="display: flex">
<div class="flex">
<div class="button-padding-right">
<NcButton type="secondary" :aria-label="t('tables', 'Cancel')" @click="actionCancel">
{{ t('tables', 'Cancel') }}
Expand Down Expand Up @@ -109,8 +111,6 @@ export default {
editColumn: structuredClone(this.column),
deleteId: null,
editErrorTitle: false,
// To enable the column info popup
debug: false,
}
},
computed: {
Expand Down Expand Up @@ -204,4 +204,10 @@ export default {
align-items: center;
}
.buttons :deep(.user-bubble__wrapper) {
padding-top: 5px;
}
.flex { display: flex }
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{ t('tables', 'Maximum text length') }}
</div>
<div class="fix-col-4">
<input v-model="mutableColumn.textMaxLength"
<input v-model="getMaxLength"
type="number"
step="1"
min="0">
Expand All @@ -42,23 +42,32 @@
import { translate as t } from '@nextcloud/l10n'
export default {
name: 'TextLineForm',
props: {
column: {
type: Object,
default: null,
},
},
data() {
return {
mutableColumn: this.column,
}
},
computed: {
getMaxLength() {
return this.mutableColumn.textMaxLength >= 0 ? this.mutableColumn.textMaxLength : null
},
},
watch: {
column() {
this.mutableColumn = this.column
},
},
methods: {
t,
},
Expand Down

0 comments on commit dc5a2fb

Please sign in to comment.