Skip to content

Commit 472cc71

Browse files
authored
Accept zip as extension in local package installer (#11109)
* Update ngf-pattern and accept * Restructure less * Remove ng-invalid again
1 parent 3167c8b commit 472cc71

File tree

3 files changed

+50
-45
lines changed

3 files changed

+50
-45
lines changed

src/Umbraco.Web.UI.Client/src/less/components/umb-package-local-install.less

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,51 @@
99
color: @gray-5;
1010
}
1111

12-
.umb-upload-local__dropzone {
13-
position: relative;
14-
width: 500px;
15-
height: 300px;
16-
border: 2px dashed @ui-action-border;
17-
border-radius: 3px;
18-
background: @white;
19-
display: flex;
20-
flex-direction: column;
21-
justify-content: center;
22-
align-items: center;
23-
margin-bottom: 30px;
24-
transition: 100ms box-shadow ease, 100ms border ease;
25-
26-
&.drag-over {
27-
border-color: @ui-action-border-hover;
28-
border-style: solid;
29-
box-shadow: 0 3px 8px rgba(0,0,0, .1);
12+
.umb-upload-local {
13+
14+
&__dropzone {
15+
position: relative;
16+
width: 500px;
17+
height: 300px;
18+
border: 2px dashed @ui-action-border;
19+
border-radius: 3px;
20+
background: @white;
21+
display: flex;
22+
flex-direction: column;
23+
justify-content: center;
24+
align-items: center;
25+
margin-bottom: 30px;
3026
transition: 100ms box-shadow ease, 100ms border ease;
31-
}
3227

33-
.umb-icon {
34-
display: block;
35-
color: @ui-action-type;
36-
font-size: 6.75rem;
37-
line-height: 1;
38-
margin: 0 auto;
28+
&.drag-over {
29+
border-color: @ui-action-border-hover;
30+
border-style: solid;
31+
box-shadow: 0 3px 8px rgba(0,0,0, .1);
32+
transition: 100ms box-shadow ease, 100ms border ease;
33+
}
34+
35+
.umb-icon {
36+
display: block;
37+
color: @ui-action-type;
38+
font-size: 6.75rem;
39+
line-height: 1;
40+
margin: 0 auto;
41+
}
42+
43+
.umb-info-local-item {
44+
margin: 20px;
45+
}
3946
}
40-
}
4147

42-
.umb-upload-local__select-file {
43-
font-weight: bold;
44-
color: @ui-action-type;
45-
cursor: pointer;
48+
&__select-file {
49+
font-weight: bold;
50+
color: @ui-action-type;
51+
cursor: pointer;
4652

47-
&:hover {
48-
text-decoration: underline;
49-
color: @ui-action-type-hover;
53+
&:hover {
54+
text-decoration: underline;
55+
color: @ui-action-type-hover;
56+
}
5057
}
5158
}
5259

@@ -117,7 +124,3 @@
117124
.umb-info-local-item {
118125
margin-bottom: 20px;
119126
}
120-
121-
.umb-upload-local__dropzone .umb-info-local-item {
122-
margin:20px;
123-
}

src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
serverErrorMessage: null
2020
};
2121

22-
$scope.handleFiles = function (files, event) {
22+
$scope.handleFiles = function (files, event, invalidFiles) {
2323
if (files) {
2424
for (var i = 0; i < files.length; i++) {
2525
upload(files[i]);

src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
<div ngf-drop
1111
ng-hide="hideDropzone"
1212
ng-model="filesHolder"
13-
ngf-change="handleFiles($files, $event)"
13+
ngf-change="handleFiles($files, $event, $invalidFiles)"
1414
class="umb-upload-local__dropzone"
1515
ngf-drag-over-class="'drag-over'"
1616
ngf-multiple="false"
1717
ngf-allow-dir="false"
18-
ngf-pattern="*.zip"
19-
ngf-max-size="{{ maxFileSize }}"
20-
ng-class="{'is-small': compact!=='false' || (done.length+queue.length) > 0 }">
18+
ngf-max-size="{{maxFileSize}}"
19+
ngf-pattern="'.zip'"
20+
accept=".zip"
21+
ng-class="{ 'is-small': compact !== 'false' || (done.length + queue.length) > 0 }">
2122

2223
<div class="content" draggable="false">
2324

@@ -31,10 +32,11 @@
3132
<div class="umb-upload-local__select-file"
3233
ngf-select
3334
ng-model="filesHolder"
34-
ngf-change="handleFiles($files, $event)"
35+
ngf-change="handleFiles($files, $event, $invalidFiles)"
3536
ngf-multiple="true"
36-
ngf-pattern="*.zip"
37-
ngf-max-size="{{ maxFileSize }}">
37+
ngf-max-size="{{maxFileSize}}"
38+
ngf-pattern="'.zip'"
39+
accept=".zip">
3840
- <localize key="packager_orClickHereToUpload">or click here to choose files</localize>
3941
</div>
4042

0 commit comments

Comments
 (0)