aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2025-07-17 10:11:30 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2025-07-17 11:44:03 +0000
commite889aaa6216bf05eb2729b7da2bddb5d8a374d7a (patch)
tree1eaac7e5d644b635b782a4abecadb897abaa46ee
parent37e401e191c70e290b34d9994f181b5d0c4d3704 (diff)
downloadnextcloud-server-e889aaa6216bf05eb2729b7da2bddb5d8a374d7a.tar.gz
nextcloud-server-e889aaa6216bf05eb2729b7da2bddb5d8a374d7a.zip
feat(files): show hidden new file name warning
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r--apps/files/src/components/NewNodeDialog.vue13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/src/components/NewNodeDialog.vue b/apps/files/src/components/NewNodeDialog.vue
index 76555db1536..ca10935940d 100644
--- a/apps/files/src/components/NewNodeDialog.vue
+++ b/apps/files/src/components/NewNodeDialog.vue
@@ -26,6 +26,11 @@
:helper-text="validity"
:label="label"
:value.sync="localDefaultName" />
+
+ <!-- Hidden file warning -->
+ <NcNoteCard v-if="isHiddenFileName"
+ type="warning"
+ :text="t('files', 'Files starting with a dot are hidden by default')" />
</form>
</NcDialog>
</template>
@@ -35,12 +40,13 @@ import type { ComponentPublicInstance, PropType } from 'vue'
import { getUniqueName } from '@nextcloud/files'
import { t } from '@nextcloud/l10n'
import { extname } from 'path'
-import { nextTick, onMounted, ref, watch, watchEffect } from 'vue'
+import { computed, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
import { getFilenameValidity } from '../utils/filenameValidity.ts'
import NcButton from '@nextcloud/vue/components/NcButton'
import NcDialog from '@nextcloud/vue/components/NcDialog'
import NcTextField from '@nextcloud/vue/components/NcTextField'
+import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
const props = defineProps({
/**
@@ -89,6 +95,11 @@ const nameInput = ref<ComponentPublicInstance>()
const formElement = ref<HTMLFormElement>()
const validity = ref('')
+const isHiddenFileName = computed(() => {
+ // Check if the name starts with a dot, which indicates a hidden file
+ return localDefaultName.value.trim().startsWith('.')
+})
+
/**
* Focus the filename input field
*/