Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dspace7 Angular
Manage
Activity
Members
Labels
Plan
Issues
42
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vtechworks
Dspace7 Angular
Commits
7fce3df3
Commit
7fce3df3
authored
5 years ago
by
Kristof De Langhe
Browse files
Options
Downloads
Patches
Plain Diff
68346: bitstream edit bugfix
parent
0f55ee8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts
+7
-5
7 additions, 5 deletions
...page/edit-bitstream-page/edit-bitstream-page.component.ts
with
7 additions
and
5 deletions
src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts
+
7
−
5
View file @
7fce3df3
...
...
@@ -429,7 +429,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
*/
onSubmit
()
{
const
updatedValues
=
this
.
formGroup
.
getRawValue
();
this
.
formToBitstream
(
updatedValues
);
const
updatedBitstream
=
this
.
formToBitstream
(
updatedValues
);
const
selectedFormat
=
this
.
formats
.
find
((
f
:
BitstreamFormat
)
=>
f
.
id
===
updatedValues
.
formatContainer
.
selectedFormat
);
const
isNewFormat
=
selectedFormat
.
id
!==
this
.
originalFormat
.
id
;
...
...
@@ -456,7 +456,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
bitstream$
.
pipe
(
switchMap
(()
=>
{
return
this
.
bitstreamService
.
update
(
this
.
b
itstream
).
pipe
(
return
this
.
bitstreamService
.
update
(
updatedB
itstream
).
pipe
(
getFirstSucceededRemoteDataPayload
()
);
})
...
...
@@ -473,8 +473,9 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
* Parse form data to an updated bitstream object
* @param rawForm Raw form data
*/
formToBitstream
(
rawForm
)
{
const
newMetadata
=
cloneDeep
(
this
.
bitstream
.
metadata
);
formToBitstream
(
rawForm
):
Bitstream
{
const
updatedBitstream
=
cloneDeep
(
this
.
bitstream
);
const
newMetadata
=
updatedBitstream
.
metadata
;
// TODO: Set bitstream to primary when supported
const
primary
=
rawForm
.
fileNamePrimaryContainer
.
primaryBitstream
;
Metadata
.
setFirstValue
(
newMetadata
,
'
dc.title
'
,
rawForm
.
fileNamePrimaryContainer
.
fileName
);
...
...
@@ -482,7 +483,8 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
if
(
isNotEmpty
(
rawForm
.
formatContainer
.
newFormat
))
{
Metadata
.
setFirstValue
(
newMetadata
,
'
dc.format
'
,
rawForm
.
formatContainer
.
newFormat
);
}
this
.
bitstream
.
metadata
=
newMetadata
;
updatedBitstream
.
metadata
=
newMetadata
;
return
updatedBitstream
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment