Merge pull request #53984 from nextcloud/feat/hint-hidden

fix(files): show hidden new file name warning
This commit is contained in:
John Molakvoæ 2025-07-17 14:25:15 +02:00 committed by GitHub
commit 2cbfdcc493
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -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
*/

4
dist/files-init.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long