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
dad
Cines Vitamui
Commits
e7fb2320
Commit
e7fb2320
authored
Apr 13, 2022
by
descamps
Browse files
KDE - 13/04 - Changement routing absolu à relatif
parent
62750d63
Changes
5
Hide whitespace changes
Inline
Side-by-side
ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts
View file @
e7fb2320
...
...
@@ -113,7 +113,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
sedaUrl
:
string
=
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
())
+
this
.
pastisConfig
.
sedaUrl
;
newProfileUrl
:
string
=
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
()
)
+
this
.
pastisConfig
.
pastisNewProfile
;
newProfileUrl
:
string
=
this
.
pastisConfig
.
pastisNewProfile
;
docPath
=
this
.
isStandalone
?
'
assets/doc/Standalone - Documentation APP - PASTIS.pdf
'
:
'
assets/doc/VITAM UI - Documentation APP - PASTIS.pdf
'
;
...
...
@@ -143,7 +143,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
constructor
(
private
profileService
:
ProfileService
,
private
noticeService
:
NoticeService
,
private
router
:
Router
,
private
dialog
:
MatDialog
,
private
startupService
:
StartupService
,
private
pastisConfig
:
PastisConfiguration
,
route
:
ActivatedRoute
,
globalEventService
:
GlobalEventService
,
private
route
:
ActivatedRoute
,
globalEventService
:
GlobalEventService
,
private
dataGeneriquePopupService
:
DataGeneriquePopupService
,
private
translateService
:
TranslateService
,
private
toggleService
:
ToggleSidenavService
)
{
super
(
route
,
globalEventService
);
...
...
@@ -215,7 +215,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
}
editProfile
(
element
:
ProfileDescription
)
{
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
())
+
this
.
pastisConfig
.
pastisEditPage
,
element
.
id
],
{
state
:
element
,
skipLocationChange
:
false
});
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisEditPage
,
element
.
id
],
{
state
:
element
,
relativeTo
:
this
.
route
,
skipLocationChange
:
false
});
}
uploadProfile
(
files
:
File
[]):
void
{
...
...
@@ -227,9 +227,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
this
.
_uploadProfileSub
=
this
.
profileService
.
uploadProfile
(
formData
).
subscribe
(
(
response
:
any
)
=>
{
if
(
response
)
{
console
.
log
(
'
File submited! Reponse is :
'
,
response
);
this
.
router
.
navigateByUrl
(
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
()
)
+
this
.
pastisConfig
.
pastisNewProfile
,
{
state
:
response
});
}
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisNewProfile
],
{
state
:
response
,
relativeTo
:
this
.
route
});
}
});
this
.
subscriptions
.
push
(
this
.
_uploadProfileSub
);
}
...
...
@@ -256,8 +254,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
this
.
profileService
.
createProfile
(
this
.
pastisConfig
.
createProfileByTypeUrl
,
result
.
action
).
subscribe
((
response
:
ProfileResponse
)
=>
{
if
(
response
)
{
console
.
log
(
'
File submited! Reponse is :
'
,
response
);
this
.
router
.
navigateByUrl
(
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
()
)
+
this
.
pastisConfig
.
pastisNewProfile
,
{
state
:
response
});
}
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisNewProfile
],
{
state
:
response
,
relativeTo
:
this
.
route
});
}
});
}
}
...
...
ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts
View file @
e7fb2320
import
{
AfterViewInit
,
Component
,
EventEmitter
,
HostListener
,
Input
,
Output
,
ViewChild
}
from
'
@angular/core
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
MatTab
,
MatTabGroup
,
MatTabHeader
}
from
'
@angular/material/tabs
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
StartupService
}
from
'
ui-frontend-common
'
;
import
{
ConfirmActionComponent
}
from
'
../../../../../vitamui-library/src/lib/components/confirm-action/confirm-action.component
'
;
import
{
ConfirmActionComponent
}
from
'
../../../../../vitamui-library/src/lib/components/confirm-action/confirm-action.component
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
import
{
PastisConfiguration
}
from
'
../../core/classes/pastis-configuration
'
;
import
{
ProfileService
}
from
'
../../core/services/profile.service
'
;
import
{
FileNode
}
from
'
../../models/file-node
'
;
import
{
ProfileDescription
}
from
'
../../models/profile-description.model
'
;
import
{
ProfileResponse
}
from
'
../../models/profile-response
'
;
import
{
ProfileInformationTabComponent
}
from
'
./profile-information-tab/profile-information-tab/profile-information-tab.component
'
;
import
{
ProfileInformationTabComponent
}
from
'
./profile-information-tab/profile-information-tab/profile-information-tab.component
'
;
@
Component
({
selector
:
'
profile-preview
'
,
...
...
@@ -46,8 +49,9 @@ export class ProfilePreviewComponent implements AfterViewInit {
}
}
constructor
(
private
matDialog
:
MatDialog
,
private
router
:
Router
,
private
startupService
:
StartupService
,
private
pastisConfig
:
PastisConfiguration
,
private
profileService
:
ProfileService
)
{
constructor
(
private
matDialog
:
MatDialog
,
private
router
:
Router
,
private
pastisConfig
:
PastisConfiguration
,
private
profileService
:
ProfileService
,
private
route
:
ActivatedRoute
)
{
}
ngAfterViewInit
()
{
...
...
@@ -110,10 +114,7 @@ export class ProfilePreviewComponent implements AfterViewInit {
}
editProfile
(
inputProfile
:
ProfileDescription
)
{
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisPathPrefix
+
(
this
.
isStandalone
?
''
:
this
.
startupService
.
getTenantIdentifier
())
+
this
.
pastisConfig
.
pastisEditPage
,
inputProfile
.
id
],
{
state
:
inputProfile
,
skipLocationChange
:
false
});
this
.
router
.
navigate
([
this
.
pastisConfig
.
pastisEditPage
,
inputProfile
.
id
],
{
state
:
inputProfile
,
relativeTo
:
this
.
route
,
skipLocationChange
:
false
});
}
downloadProfile
(
inputProfile
:
ProfileDescription
)
{
...
...
ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts
View file @
e7fb2320
import
{
Component
,
Input
,
OnDestroy
,
OnInit
}
from
'
@angular/core
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
LangChangeEvent
,
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
FileUploader
}
from
'
ng2-file-upload
'
;
import
{
NgxUiLoaderService
}
from
'
ngx-ui-loader
'
;
...
...
@@ -88,7 +88,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
constructor
(
private
router
:
Router
,
private
profileService
:
ProfileService
,
public
dialog
:
MatDialog
,
private
noticeService
:
NoticeService
,
private
translateService
:
TranslateService
,
private
loaderService
:
NgxUiLoaderService
,
private
notificationService
:
NotificationService
)
{
}
private
notificationService
:
NotificationService
,
private
route
:
ActivatedRoute
)
{
}
ngOnInit
():
void
{
constantToTranslate
.
call
(
this
,
this
.
editProfile
);
...
...
@@ -108,7 +108,8 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
}
goToSedaView
()
{
window
.
open
(
this
.
sedaUrl
);
const
url
=
this
.
router
.
serializeUrl
(
this
.
router
.
createUrlTree
([
'
sedaview
'
],
{
relativeTo
:
this
.
route
}));
window
.
open
(
url
,
'
_blank
'
);
}
uploadProfile
(
files
:
File
[]):
void
{
...
...
@@ -121,7 +122,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
if
(
response
)
{
console
.
log
(
'
File submited! Reponse is :
'
,
response
);
this
.
router
.
navigate
ByUrl
(
this
.
newProfileUrl
,
{
state
:
response
});
this
.
router
.
navigate
(
[
this
.
newProfileUrl
]
,
{
state
:
response
,
relativeTo
:
this
.
route
});
}
});
}
...
...
ui/ui-frontend/projects/pastis/src/assets/config/config-standalone.json
View file @
e7fb2320
{
"sedaUrl"
:
"/sedaview"
,
"pastisEditPage"
:
"
/
edit"
,
"pastisNewProfile"
:
"
/
new"
,
"pastisEditPage"
:
"edit"
,
"pastisNewProfile"
:
"new"
,
"pastisPathPrefix"
:
""
,
"getAllProfilesUrl"
:
"/getprofiles"
,
"editProfileUrl"
:
"/edit"
,
...
...
ui/ui-frontend/projects/pastis/src/assets/config/config-vitam-ui.json
View file @
e7fb2320
{
"sedaUrl"
:
"/sedaview"
,
"pastisEditPage"
:
"
/
edit"
,
"pastisNewProfile"
:
"
/
new"
,
"pastisEditPage"
:
"edit"
,
"pastisNewProfile"
:
"new"
,
"pastisPathPrefix"
:
"/pastis/tenant/"
,
"getAllProfilesUrl"
:
"/pastis/getprofiles"
,
"editProfileUrl"
:
"/pastis/edit"
,
...
...
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