Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testcenter-frontend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
IQB
discontinued
testcenter-frontend
Commits
1ec2b18d
Commit
1ec2b18d
authored
4 years ago
by
paf
Browse files
Options
Downloads
Patches
Plain Diff
use improved endpoint which returns XMl directly
parent
afbf30ec
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/backend.service.ts
+1
-1
1 addition, 1 deletion
src/app/backend.service.ts
src/app/group-monitor/backend.service.ts
+11
-9
11 additions, 9 deletions
src/app/group-monitor/backend.service.ts
src/app/group-monitor/booklet.service.ts
+0
-2
0 additions, 2 deletions
src/app/group-monitor/booklet.service.ts
with
12 additions
and
12 deletions
src/app/backend.service.ts
+
1
−
1
View file @
1ec2b18d
...
...
@@ -116,7 +116,7 @@ export class BackendService {
getBookletData
(
bookletId
:
string
):
Observable
<
BookletData
>
{
return
this
.
http
.
get
<
BookletData
>
(
this
.
serverUrl
+
'
booklet/
'
+
bookletId
)
.
get
<
BookletData
>
(
this
.
serverUrl
+
'
booklet/
'
+
bookletId
+
'
/data
'
)
.
pipe
(
map
(
bData
=>
{
bData
.
id
=
bookletId
;
...
...
This diff is collapsed.
Click to expand it.
src/app/group-monitor/backend.service.ts
+
11
−
9
View file @
1ec2b18d
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Observable
,
of
}
from
'
rxjs
'
;
import
{
catchError
}
from
'
rxjs/operators
'
;
import
{
ApiError
,
BookletData
}
from
'
../app.interfaces
'
;
import
{
GroupData
,
TestSession
}
from
'
./group-monitor.interfaces
'
;
import
{
WebsocketBackendService
}
from
'
./websocket-backend.service
'
;
import
{
HttpHeaders
}
from
'
@angular/common/http
'
;
@
Injectable
()
export
class
BackendService
extends
WebsocketBackendService
<
TestSession
[]
>
{
...
...
@@ -20,18 +20,20 @@ export class BackendService extends WebsocketBackendService<TestSession[]> {
}
public
getBooklet
(
bookletName
:
string
):
Observable
<
BookletData
|
boolean
>
{
public
getBooklet
(
bookletName
:
string
):
Observable
<
string
>
{
console
.
log
(
"
load booklet for
"
+
bookletName
);
const
headers
=
new
HttpHeaders
({
'
Content-Type
'
:
'
text/xml
'
}).
set
(
'
Accept
'
,
'
text/xml
'
);
return
this
.
http
.
get
<
BookletData
>
(
this
.
serverUrl
+
`booklet/
${
bookletName
}
/data`
)
.
pipe
(
// TODO useful error handling
catchError
((
err
:
ApiError
)
=>
{
console
.
warn
(
`getTestData Api-Error:
${
err
.
code
}
${
err
.
info
}
`
);
return
of
(
false
)
})
);
.
get
(
this
.
serverUrl
+
`booklet/
${
bookletName
}
`
,
{
headers
,
responseType
:
'
text
'
}
)
//
.pipe( // TODO useful error handling
//
catchError((err: ApiError) => {
//
console.warn(`getTestData Api-Error: ${err.code} ${err.info}`);
//
return of(false)
//
})
//
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/group-monitor/booklet.service.ts
+
0
−
2
View file @
1ec2b18d
...
...
@@ -4,7 +4,6 @@ import {BackendService} from './backend.service';
import
{
Observable
,
of
}
from
'
rxjs
'
;
import
{
isDefined
}
from
'
@angular/compiler/src/util
'
;
import
{
map
,
shareReplay
}
from
'
rxjs/operators
'
;
import
{
BookletData
}
from
'
../app.interfaces
'
;
import
{
Booklet
,
BookletMetadata
,
Restrictions
,
Testlet
,
Unit
}
from
'
./group-monitor.interfaces
'
;
import
{
BookletConfig
}
from
'
../config/booklet-config
'
;
...
...
@@ -39,7 +38,6 @@ export class BookletService {
// console.log('LOADING testletOrUnit data for ' + bookletName + ' not available. loading');
this
.
booklets
[
bookletName
]
=
this
.
bs
.
getBooklet
(
bookletName
)
.
pipe
(
map
((
testData
:
BookletData
):
string
=>
testData
.
xml
))
.
pipe
(
map
(
BookletService
.
parseBookletXml
))
.
pipe
(
shareReplay
(
1
));
}
...
...
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