Web: its possible to create a file/folder that contains a "/" in the name

Created on 30 Apr 2019  路  5Comments  路  Source: owncloud/web

Steps to reproduce

similar to #946 its possible to create a file/folder that contains a "/" in the name

  1. create a folder "new"
  2. go back to the root folder
  3. create a folder called "new/sub"

Expected behaviour

error message shown

Actual behaviour

folder is created

Bug

All 5 comments

Need some help on that :)

I want to watch the input value. If it contains any forbidden characters I would like to mark the input boder red and write some error message.

To achieve that behavior I would have to watch the input directly in the oc dialog prompt. But as it should be more universal I would have to put the watcher stuff in the file top bar component which does all the logic part for creating new folder/files?

How can I watch/bind the input and check for it in the top bar component and render a specific error message in a different component

@Julian1998 If I get your problem right - you could pass it as a prop. If you want to display error message in oc-dialog-prompt you could use for example ocContent. But then I guess would be also nice to edit a little bit the component in ods to make it a little bit prettier while handeling the error. The border around the input could be then done as a variation the same way as is the error notification.

Passed error message as a prop into ocContent:
image

Other option could be then to move the logic into mixins.

@LukasHirt thx a lot in advance. Yeah props were the way I wanted to deal with. But still I need to access/watch the folderName input value from the child component (dialog prompt). The input value gets emitted via an event. So watching isn't simply possible (at least it seems)

Ah you want to watch it in real-time and not after submiting? I got it wrong there, my bad.

Within the dialog you have access to the input field oc-text-field.

oc-text-field emits an input event which should help to get this implemented.

see https://owncloud.github.io/owncloud-design-system/#/Elements/oc-text-input - scroll down for the documentation of the events?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

labkode picture labkode  路  8Comments

ChrisEdS picture ChrisEdS  路  6Comments

tomneedham picture tomneedham  路  5Comments

PVince81 picture PVince81  路  9Comments

individual-it picture individual-it  路  5Comments