Skip to content

Commit b046098

Browse files
Accept udt as extension in import document type (#11108)
* Pass in invalid files * Fix pattern and accept udt file extension * Remove wildcard * fix help text - referred to 'browse' button, which does not exist Co-authored-by: Nathan Woulfe <[email protected]>
1 parent ed16728 commit b046098

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/Umbraco.Web.UI.Client/src/views/documenttypes/import.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ angular.module("umbraco")
99

1010
vm.cancelButtonLabel = "cancel";
1111

12-
$scope.handleFiles = function (files, event) {
12+
$scope.handleFiles = function (files, event, invalidFiles) {
1313
if (files && files.length > 0) {
1414
$scope.upload(files[0]);
1515
}

src/Umbraco.Web.UI.Client/src/views/documenttypes/importdocumenttype.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div ng-if="vm.state === 'upload'">
66
<p>
77
<localize key="settings_importDocumentTypeHelp">
8-
To import a document type, find the '.udt' file on your computer by clicking the 'Browse' button and click 'Import' (you'll be asked for confirmation on the next screen)
8+
To import a document type, find the '.udt' file on your computer by clicking the 'Import' button (you'll be asked for confirmation on the next screen)
99
</localize>
1010
</p>
1111

@@ -16,9 +16,10 @@
1616
name="file"
1717
ngf-select
1818
ng-model="filesHolder"
19-
ngf-change="handleFiles($files, $event)"
19+
ngf-change="handleFiles($files, $event, $invalidFiles)"
2020
ngf-multiple="true"
21-
ngf-pattern="*.udt">
21+
ngf-pattern="*.udt"
22+
accept=".udt">
2223
<localize key="general_import">Import</localize>
2324
</button>
2425
</form>

src/Umbraco.Web.UI/Umbraco/config/lang/en.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
14081408
</area>
14091409
<area alias="settings">
14101410
<key alias="defaulttemplate">Default template</key>
1411-
<key alias="importDocumentTypeHelp">To import a Document Type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen)</key>
1411+
<key alias="importDocumentTypeHelp">To import a Document Type, find the ".udt" file on your computer by clicking the "Import" button (you'll be asked for confirmation on the next screen)</key>
14121412
<key alias="newtabname">New Tab Title</key>
14131413
<key alias="nodetype">Node type</key>
14141414
<key alias="objecttype">Type</key>

src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
14131413
</area>
14141414
<area alias="settings">
14151415
<key alias="defaulttemplate">Default template</key>
1416-
<key alias="importDocumentTypeHelp">To import a Document Type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen)</key>
1416+
<key alias="importDocumentTypeHelp">To import a Document Type, find the ".udt" file on your computer by clicking the "Import" button (you'll be asked for confirmation on the next screen)</key>
14171417
<key alias="newtabname">New Tab Title</key>
14181418
<key alias="nodetype">Node type</key>
14191419
<key alias="objecttype">Type</key>

0 commit comments

Comments
 (0)