Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DLCM
UI
DLCM-Portal
Commits
06a87305
Commit
06a87305
authored
Dec 20, 2021
by
Florent Poittevin
Committed by
Alicia.DeDiosFuente
Dec 21, 2021
Browse files
fix: [DLCM-1991] custom metadata fie upload fail
parent
c3e904e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/features/deposit/stores/deposit.state.ts
View file @
06a87305
...
...
@@ -199,10 +199,6 @@ export interface DepositStateModel extends ResourceLogoStateModel<Deposit> {
],
})
export
class
DepositState
extends
ResourceLogoState
<
DepositStateModel
,
Deposit
>
{
private
readonly
_CATEGORY_KEY
:
string
=
"
category
"
;
private
readonly
_TYPE_KEY
:
string
=
"
type
"
;
private
readonly
_METADATA_TYPE_KEY
:
string
=
"
metadataType
"
;
private
readonly
_FOLDER_KEY
:
string
=
"
folder
"
;
private
readonly
_ZIP_EXTENSION
:
string
=
"
.zip
"
;
private
readonly
_DEPOSIT_FILE_DOWNLOAD_PREFIX
:
string
=
"
deposit_
"
;
private
readonly
_FOLDER_QUERY_PARAM
:
string
=
"
folder
"
;
...
...
src/app/features/deposit/stores/upload/deposit-upload.state.ts
View file @
06a87305
...
...
@@ -24,6 +24,7 @@ import {
ApiService
,
defaultUploadStateInitValue
,
ENVIRONMENT
,
isNotNullNorUndefinedNorWhiteString
,
isNullOrUndefined
,
LABEL_TRANSLATE
,
LabelTranslateInterface
,
...
...
@@ -51,6 +52,7 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep
private
readonly
_CATEGORY_KEY
:
string
=
"
category
"
;
private
readonly
_TYPE_KEY
:
string
=
"
type
"
;
private
readonly
_FOLDER_KEY
:
string
=
"
folder
"
;
private
readonly
_METADATA_TYPE_KEY
:
string
=
"
metadataType
"
;
private
readonly
_CHECKSUM_MD5
:
string
=
"
checksumMd5
"
;
private
readonly
_CHECKSUM_MD5_ORIGIN
:
string
=
"
checksumMd5Origin
"
;
private
readonly
_CHECKSUM_SHA1
:
string
=
"
checksumSha1
"
;
...
...
@@ -85,6 +87,9 @@ export class DepositUploadState extends UploadState<DepositUploadStateModel, Dep
if
(
!
action
.
isArchive
)
{
formData
.
append
(
this
.
_FOLDER_KEY
,
isNullOrUndefined
(
fileUploadWrapper
.
subDirectory
)
?
StringUtil
.
stringEmpty
:
fileUploadWrapper
.
subDirectory
);
}
if
(
isNotNullNorUndefinedNorWhiteString
(
fileUploadWrapper
.
metadataType
))
{
formData
.
append
(
this
.
_METADATA_TYPE_KEY
,
fileUploadWrapper
.
metadataType
);
}
formData
.
append
(
this
.
_FILE_KEY
,
fileUploadWrapper
.
file
,
fileUploadWrapper
.
file
.
name
);
formData
.
append
(
this
.
_CATEGORY_KEY
,
fileUploadWrapper
.
dataCategory
);
formData
.
append
(
this
.
_TYPE_KEY
,
fileUploadWrapper
.
dataType
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment