Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cines Vitamui
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dad
Cines Vitamui
Commits
aa1ef32e
Commit
aa1ef32e
authored
3 years ago
by
couzinie
Committed by
naji
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix problem while importing twice a profile with nsName attribute
parent
d631aa1c
No related branches found
No related tags found
5 merge requests
!58
compare branch
,
!54
Comparaison de merge vers vitam-ui
,
!53
Comparaison de merge vers vitam-ui
,
!52
Voir difference entre les deux verion
,
!41
MAJ: compare to vitam-ui
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts
+31
-29
31 additions, 29 deletions
...end/projects/pastis/src/app/core/services/file.service.ts
with
31 additions
and
29 deletions
ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts
+
31
−
29
View file @
aa1ef32e
...
...
@@ -117,40 +117,42 @@ export class FileService implements OnDestroy {
Array
.
prototype
.
forEach
.
call
(
nodes
,
(
node
:
FileNode
)
=>
{
node
.
parent
=
parent
;
let
nodeName
:
string
=
(
node
.
name
===
'
xml:id
'
)
?
'
id
'
:
node
.
name
;
let
sedaDataMatch
:
SedaData
;
if
(
nodeName
)
{
let
sedaDataMatch
:
SedaData
;
// Si le node en cours est une ArchiveUnit, lui même enfant d'une ArchiveUnit...
if
(
nodeName
===
'
ArchiveUnit
'
&&
this
.
sedaDataArchiveUnit
!=
undefined
)
{
// Alors on utilise la définition SEDA de l'ArchiveUnit mère..
sedaDataMatch
=
this
.
sedaDataArchiveUnit
;
}
else
{
// Sinon on recherche la définition SEDA dans l'arbre
sedaDataMatch
=
sedaData
.
find
(
seda
=>
seda
.
Name
===
nodeName
);
//sedaDataMatch = this.sedaService.getSedaNodeRecursively(sedaData[0],nodeName)
}
if
(
!
sedaDataMatch
){
// Sometimes,the sedaData has no property children, but many siblings (e.g. elements on the same level of the tree)
// In this case, the recursivity must be used on each symbling since the service getSedaNodeRecursively
// expects a tree root element with Children key
for
(
const
element
of
sedaData
)
{
let
resultRecursity
=
this
.
sedaService
.
getSedaNodeRecursively
(
element
,
nodeName
);
if
(
resultRecursity
)
{
sedaDataMatch
=
resultRecursity
;
break
;
// Si le node en cours est une ArchiveUnit, lui même enfant d'une ArchiveUnit...
if
(
nodeName
===
'
ArchiveUnit
'
&&
this
.
sedaDataArchiveUnit
!=
undefined
)
{
// Alors on utilise la définition SEDA de l'ArchiveUnit mère..
sedaDataMatch
=
this
.
sedaDataArchiveUnit
;
}
else
{
// Sinon on recherche la définition SEDA dans l'arbre
sedaDataMatch
=
sedaData
.
find
(
seda
=>
seda
.
Name
===
nodeName
);
//sedaDataMatch = this.sedaService.getSedaNodeRecursively(sedaData[0],nodeName)
}
if
(
!
sedaDataMatch
){
// Sometimes,the sedaData has no property children, but many siblings (e.g. elements on the same level of the tree)
// In this case, the recursivity must be used on each symbling since the service getSedaNodeRecursively
// expects a tree root element with Children key
for
(
const
element
of
sedaData
)
{
let
resultRecursity
=
this
.
sedaService
.
getSedaNodeRecursively
(
element
,
nodeName
);
if
(
resultRecursity
)
{
sedaDataMatch
=
resultRecursity
;
break
;
}
}
}
else
{
// Si le node en cours est l'achive ArchiveUnit mère, on la sauvegarde pour l'utiliser pour les ArchivesUnit enfants
if
(
sedaDataMatch
.
Name
===
'
ArchiveUnit
'
&&
this
.
sedaDataArchiveUnit
==
undefined
){
this
.
sedaDataArchiveUnit
=
sedaDataMatch
;
// On introduit la récursivité sur les ArchivesUnit
this
.
sedaDataArchiveUnit
.
Children
.
find
((
c
:
{
Name
:
string
;
})
=>
c
.
Name
==
'
ArchiveUnit
'
).
Children
=
this
.
sedaDataArchiveUnit
.
Children
;
}
}
}
else
{
// Si le node en cours est l'achive ArchiveUnit mère, on la sauvegarde pour l'utiliser pour les ArchivesUnit enfants
if
(
sedaDataMatch
.
Name
===
'
ArchiveUnit
'
&&
this
.
sedaDataArchiveUnit
==
undefined
){
this
.
sedaDataArchiveUnit
=
sedaDataMatch
;
// On introduit la récursivité sur les ArchivesUnit
this
.
sedaDataArchiveUnit
.
Children
.
find
((
c
:
{
Name
:
string
;
})
=>
c
.
Name
==
'
ArchiveUnit
'
).
Children
=
this
.
sedaDataArchiveUnit
.
Children
;
node
.
sedaData
=
sedaDataMatch
;
if
(
node
.
children
.
length
>
0
){
this
.
linkFileNodeToSedaData
(
node
,
node
.
children
,
node
.
sedaData
.
Children
);
}
}
node
.
sedaData
=
sedaDataMatch
;
if
(
node
.
children
.
length
>
0
){
this
.
linkFileNodeToSedaData
(
node
,
node
.
children
,
node
.
sedaData
.
Children
);
}
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment