Overview
This is a follow-up of story #24166. The modifications proposed here will be available only of there is a pattern defined.
And the user uses Document interface to create new files, embedded files or new versions of those, Then the user should be able to see the generated filename In order to adapt "Version name" so the generated filename is consistent with already uploaded files.
Not covered in the story:
- if user uses the legacy Docman interface, the filename & history is not displayed.
- if user drag'n drop a file directly in the file tree, there won't be any "Version name" defined
- if user upload a new file or version using WebDav, the pattern will not apply
Display of the file name
There are two places where this capability should be provided.
The creation of a new File (ie the initial version):
The creation of a new version of the file:
In both screens we should have a "Filename preview" field, that cannot be modified by end user:
- By default the field is empty (there is no file provided yet)
- As soon as a file is selected (browse button) the filename preview is updated with:
- The actual filename when there is no pattern defined
- The transformed filename according to the pattern (updated as user types / select values)
New version, display of history
The history is displayed only if there is a pattern defined.
When users have to modify the filename, it often has to be consistent with the naming that was done with previous versions.
Hence, the the "New version" modal is updated to list the last 5 versions of the file (Version number + Version title in descending order).
When there is more than 5 versions in the history, there is a link to the "history" page of the document.
New file and ${ID} in pattern
When there is a new file, the exact filename cannot be displayed if the pattern contains ${ID}
because the file id is not yet know.
Hence the displayed filename will contains ${ID}
variable instead of the actual id.
Example:
- Pattern is
${ID}-${TITLE}-${VERSION_NAME}
- Creation of new file "HW Specifications"
- User sees as generated filename
${ID}-HW Specifications-
(note the final -
)
- User creates the document
- Document is created and filename is
12323-HW Specifications-
- Creation of a new version for "HW Specifications"
- User sees as generated filename
12323-HW Specifications-
- User types
V1_APP
- User sees as generated filename
12323-HW Specifications-V1_APP
- User saves the new version
- New version is created and filename is
12323-HW Specifications-V1_APP
- User look at history, they see:
- v1 - 12323-HW Specifications-V1_APP
- v0 - 12323-HW Specifications-
Figma : https://www.figma.com/file/0U4874nbYDlRBc56W1d4K3/Documents---story-%2324192?node-id=0%3A1