Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
sispub
openbis
Commits
73043fc8
Commit
73043fc8
authored
10 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-616: Add ability to create Projects in the ELN (Refactoring)
SVN: 32105
parent
e2d311a5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/ProjectForm/ProjectFormController.js
+42
-0
42 additions, 0 deletions
...rowser/html/js/views/ProjectForm/ProjectFormController.js
with
42 additions
and
0 deletions
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/ProjectForm/ProjectFormController.js
+
42
−
0
View file @
73043fc8
...
...
@@ -39,6 +39,48 @@ function ProjectFormController(mainController, mode, project) {
this
.
updateProject
=
function
()
{
if
(
this
.
_mainController
.
profile
.
allDataStores
.
length
>
0
)
{
var
method
=
""
;
if
(
this
.
_projectFormModel
.
mode
===
FormMode
.
CREATE
)
{
method
=
"
insertProject
"
;
}
else
if
(
this
.
_projectFormModel
.
mode
===
FormMode
.
EDIT
)
{
method
=
"
updateProject
"
;
}
var
parameters
=
{
//API Method
"
method
"
:
method
,
//Identification Info
"
projectSpace
"
:
this
.
_projectFormModel
.
project
.
spaceCode
,
"
projectCode
"
:
this
.
_projectFormModel
.
project
.
code
,
"
projectDescription
"
:
this
.
_projectFormModel
.
project
.
description
};
var
_this
=
this
;
this
.
_mainController
.
serverFacade
.
createReportFromAggregationService
(
this
.
_mainController
.
profile
.
allDataStores
[
0
].
code
,
parameters
,
function
(
response
)
{
if
(
response
.
error
)
{
//Error Case 1
Util
.
showError
(
response
.
error
.
message
,
function
()
{
Util
.
unblockUI
();});
}
else
if
(
response
.
result
.
columns
[
1
].
title
===
"
Error
"
)
{
//Error Case 2
var
stacktrace
=
response
.
result
.
rows
[
0
][
1
].
value
;
Util
.
showStacktraceAsError
(
stacktrace
);
}
else
if
(
response
.
result
.
columns
[
0
].
title
===
"
STATUS
"
&&
response
.
result
.
rows
[
0
][
0
].
value
===
"
OK
"
)
{
//Success Case
var
message
=
""
;
if
(
_this
.
_mode
===
FormMode
.
CREATE
)
{
message
=
"
Created.
"
;
}
else
if
(
_this
.
_mode
===
FormMode
.
EDIT
)
{
message
=
"
Updated.
"
;
}
var
callbackOk
=
function
()
{
_this
.
_mainController
.
changeView
(
"
showProjectPageFromIdentifier
"
,
projectIdentifier
);
Util
.
unblockUI
();
}
Util
.
showSuccess
(
message
,
callbackOk
);
}
else
{
//This should never happen
Util
.
showError
(
"
Unknown Error.
"
,
function
()
{
Util
.
unblockUI
();});
}
});
}
else
{
Util
.
showError
(
"
No DSS available.
"
,
function
()
{
Util
.
unblockUI
();});
...
...
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