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(design): edit columns #521

Merged
merged 2 commits into from
Sep 8, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
editColumn: structuredClone(this.column),
deleteId: null,
editErrorTitle: false,
// To enable the column info popup
debug: false,
}
},
computed: {
Expand Down Expand Up @@ -139,7 +139,7 @@
group
.toUpperCase()
.replace('_', '')
.replace('-', '')

Check warning on line 142 in src/modules/modals/EditColumn.vue

View workflow job for this annotation

GitHub Actions / eslint

Missing trailing comma
)
return str.charAt(0).toUpperCase() + str.slice(1)
},
Expand Down Expand Up @@ -204,4 +204,10 @@
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
Loading