Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Maarch
MaarchCourrier
Commits
90f6606b
Verified
Commit
90f6606b
authored
6 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #7731 Update view after update
parent
5abacb50
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
apps/maarch_entreprise/js/angular/app/administration/docservers-administration.component.ts
+19
-18
19 additions, 18 deletions
...app/administration/docservers-administration.component.ts
with
19 additions
and
18 deletions
apps/maarch_entreprise/js/angular/app/administration/docservers-administration.component.ts
+
19
−
18
View file @
90f6606b
import
{
ChangeDetectorRef
,
Component
,
OnInit
,
ViewChild
,
Pipe
,
PipeTransform
}
from
'
@angular/core
'
;
import
{
ChangeDetectorRef
,
Component
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
MediaMatcher
}
from
'
@angular/cdk/layout
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
LANG
}
from
'
../translate.component
'
;
import
{
NotificationService
}
from
'
../notification.service
'
;
import
{
MatPaginator
,
MatTableDataSource
,
MatSort
}
from
'
@angular/material
'
;
import
{
MatPaginator
,
MatSort
}
from
'
@angular/material
'
;
declare
function
$j
(
selector
:
any
):
any
;
declare
var
angularGlobals
:
any
;
@
Component
({
templateUrl
:
"
../../../../Views/docservers-administration.component.html
"
,
templateUrl
:
"
../../../../Views/docservers-administration.component.html
"
,
providers
:
[
NotificationService
]
})
...
...
@@ -19,14 +19,14 @@ export class DocserversAdministrationComponent implements OnInit {
mobileQuery
:
MediaQueryList
;
private
_mobileQueryListener
:
()
=>
void
;
coreUrl
:
string
;
lang
:
any
=
LANG
;
loading
:
boolean
=
false
;
dataSource
:
any
;
coreUrl
:
string
;
lang
:
any
=
LANG
;
loading
:
boolean
=
false
;
dataSource
:
any
;
docservers
:
any
=
[];
docserversClone
:
any
=
[];
docserversTypes
:
any
=
{};
docservers
:
any
=
[];
docserversClone
:
any
=
[];
docserversTypes
:
any
=
{};
@
ViewChild
(
MatPaginator
)
paginator
:
MatPaginator
;
@
ViewChild
(
MatSort
)
sort
:
MatSort
;
...
...
@@ -56,7 +56,7 @@ export class DocserversAdministrationComponent implements OnInit {
});
}
toggleDocserver
(
docserver
:
any
)
{
toggleDocserver
(
docserver
:
any
)
{
//TO DO : implement secondary_docserver instead of priority
if
(
docserver
.
secondary_docserver
==
''
)
{
alert
(
'
Veuillez choisir un docserver secondaire
'
);
...
...
@@ -65,11 +65,11 @@ export class DocserversAdministrationComponent implements OnInit {
}
}
cancelModification
(
docserverType
:
any
,
index
:
number
)
{
this
.
docservers
[
docserverType
][
index
]
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
docserversClone
[
docserverType
][
index
]));
cancelModification
(
docserverType
:
any
,
index
:
number
)
{
this
.
docservers
[
docserverType
][
index
]
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
docserversClone
[
docserverType
][
index
]));
}
checkModif
(
docserver
:
any
,
docserversClone
:
any
)
{
checkModif
(
docserver
:
any
,
docserversClone
:
any
)
{
docserver
.
size_limit_number
=
docserver
.
limitSizeFormatted
*
1000000000
;
if
(
JSON
.
stringify
(
docserver
)
===
JSON
.
stringify
(
docserversClone
))
{
return
true
...
...
@@ -82,10 +82,11 @@ export class DocserversAdministrationComponent implements OnInit {
}
}
onSubmit
(
docserver
:
any
,
i
:
number
)
{
onSubmit
(
docserver
:
any
,
i
:
number
)
{
docserver
.
size_limit_number
=
docserver
.
limitSizeFormatted
*
1000000000
;
this
.
http
.
put
(
this
.
coreUrl
+
'
rest/docservers/
'
+
docserver
.
id
,
docserver
)
this
.
http
.
put
(
this
.
coreUrl
+
'
rest/docservers/
'
+
docserver
.
id
,
docserver
)
.
subscribe
((
data
:
any
)
=>
{
this
.
docservers
[
docserver
.
docserver_type_id
][
i
]
=
data
[
'
docserver
'
];
this
.
docserversClone
[
docserver
.
docserver_type_id
][
i
]
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
docservers
[
docserver
.
docserver_type_id
][
i
]));
this
.
notify
.
success
(
this
.
lang
.
docserverUpdated
);
},
(
err
)
=>
{
...
...
@@ -93,7 +94,7 @@ export class DocserversAdministrationComponent implements OnInit {
});
}
delete
(
docserver
:
any
,
i
:
number
)
{
delete
(
docserver
:
any
,
i
:
number
)
{
let
r
=
null
;
if
(
docserver
.
actual_size_number
==
0
)
{
r
=
confirm
(
this
.
lang
.
delete
+
'
?
'
);
...
...
@@ -103,7 +104,7 @@ export class DocserversAdministrationComponent implements OnInit {
if
(
r
)
{
this
.
http
.
delete
(
this
.
coreUrl
+
'
rest/docservers/
'
+
docserver
.
id
)
.
subscribe
((
data
:
any
)
=>
{
.
subscribe
(()
=>
{
this
.
docservers
[
docserver
.
docserver_type_id
].
splice
(
i
,
1
);
this
.
notify
.
success
(
this
.
lang
.
docserverDeleted
);
},
(
err
)
=>
{
...
...
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