1717 type =" error" >
1818 {{ t('tables', '"{columnTitle}" should not be empty', { columnTitle: column.title }) }}
1919 </NcNoteCard >
20+ <NcNoteCard v-if =" localRow[column.id] && column.type === 'text-link' && !isValidUrlProtocol(localRow[column.id])"
21+ type =" error" >
22+ {{ t('tables', 'Invalid protocol. Allowed: {allowed}', {allowed: allowedProtocols.join(', ')}) }}
23+ </NcNoteCard >
2024 </div >
2125 <div class =" row" >
2226 <div class =" fix-col-4 space-T" :class =" {'justify-between': showDeleteButton, 'end': !showDeleteButton}" >
3539 </div >
3640 <NcButton v-if =" canUpdateData(element) && !localLoading" :aria-label =" t('tables', 'Save')" type =" primary"
3741 data-cy =" editRowSaveButton"
38- :disabled =" hasEmptyMandatoryRows"
42+ :disabled =" hasEmptyMandatoryRows || hasInvalidUrlProtocol "
3943 @click =" actionConfirm" >
4044 {{ t('tables', 'Save') }}
4145 </NcButton >
@@ -57,6 +61,7 @@ import rowHelper from '../../shared/components/ncTable/mixins/rowHelper.js'
5761import { mapActions } from ' pinia'
5862import { useTablesStore } from ' ../../store/store.js'
5963import { useDataStore } from ' ../../store/data.js'
64+ import { ALLOWED_PROTOCOLS } from ' ../../shared/constants.js'
6065
6166export default {
6267 name: ' EditRow' ,
@@ -94,6 +99,7 @@ export default {
9499 localRow: null ,
95100 prepareDeleteRow: false ,
96101 localLoading: false ,
102+ allowedProtocols: ALLOWED_PROTOCOLS ,
97103 }
98104 },
99105 computed: {
@@ -106,6 +112,9 @@ export default {
106112 hasEmptyMandatoryRows () {
107113 return this .checkMandatoryFields (this .localRow )
108114 },
115+ hasInvalidUrlProtocol () {
116+ return this .nonMetaColumns .some (col => col .type === ' text-link' && ! this .isValidUrlProtocol (this .localRow [col .id ]))
117+ },
109118 },
110119 watch: {
111120 row () {
0 commit comments