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
bfae8a6e
Commit
bfae8a6e
authored
11 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-18: Support initial D-BIOL Workflow - Polishing 1
SVN: 31246
parent
91a01fe0
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
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js
+28
-12
28 additions, 12 deletions
...s/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js
with
28 additions
and
12 deletions
plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js
+
28
−
12
View file @
bfae8a6e
...
@@ -86,24 +86,28 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -86,24 +86,28 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
var
_this
=
this
;
var
_this
=
this
;
var
tableId
=
id
+
"
-table
"
;
var
tableId
=
id
+
"
-table
"
;
var
sampleId
=
id
+
"
-sample
"
;
var
sampleId
=
id
+
"
-sample
"
;
var
labelId
=
id
+
"
-label
"
;
var
$component
=
$
(
"
<div>
"
,
{
"
id
"
:
id
,
"
class
"
:
"
control-group
"
,
"
sample-type-code
"
:
sampleTypeHint
[
"
TYPE
"
]}
);
var
$component
=
$
(
"
<div>
"
,
{
"
id
"
:
id
,
"
class
"
:
"
control-group
"
,
"
sample-type-code
"
:
sampleTypeHint
[
"
TYPE
"
]}
);
var
$label
=
$
(
"
<label>
"
,
{
"
class
"
:
"
control-label
"
}).
text
(
sampleTypeHint
[
"
LABEL
"
]
+
"
:
"
);
var
$label
=
$
(
"
<label>
"
,
{
"
class
"
:
"
control-label
"
,
"
id
"
:
labelId
}).
text
(
sampleTypeHint
[
"
LABEL
"
]
+
"
:
"
);
var
$controls
=
$
(
"
<div>
"
,
{
"
class
"
:
"
controls
"
});
var
$controls
=
$
(
"
<div>
"
,
{
"
class
"
:
"
controls
"
});
var
$textField
=
$
(
"
<
input
>
"
,
{
"
type
"
:
"
text
"
,
"
id
"
:
sampleId
,
"
disabled
"
:
""
});
var
$textField
=
$
(
"
<
a
>
"
,
{
"
class
"
:
"
btn
"
,
"
type
"
:
"
button
"
,
"
id
"
:
sampleId
,
"
disabled
"
:
""
});
$textField
.
css
({
$textField
.
css
({
"
width
"
:
"
650px
"
"
max-width
"
:
"
90%
"
,
"
text-align
"
:
"
left
"
});
});
if
(
sampleTypeHint
[
"
REQUIRED
"
])
{
if
(
sampleTypeHint
[
"
REQUIRED
"
])
{
$textField
.
attr
(
"
required
"
,
""
);
$textField
.
attr
(
"
required
"
,
""
);
}
}
$controls
.
append
(
$textField
);
$controls
.
append
(
$textField
);
$controls
.
append
(
"
"
);
$controls
.
append
(
"
"
);
var
$buttonSelect
=
$
(
"
<input>
"
,
{
"
class
"
:
"
btn
"
,
"
type
"
:
"
button
"
,
"
value
"
:
"
Select
"
});
var
$buttonSelect
=
$
(
"
<a>
"
,
{
"
class
"
:
"
btn
"
});
$buttonSelect
.
append
(
"
Select
"
);
$controls
.
append
(
$buttonSelect
);
$controls
.
append
(
$buttonSelect
);
$controls
.
append
(
"
"
);
$controls
.
append
(
"
"
);
var
$buttonDelete
=
$
(
"
<input>
"
,
{
"
class
"
:
"
btn
"
,
"
type
"
:
"
button
"
,
"
value
"
:
"
Delete
"
});
var
$buttonDelete
=
$
(
"
<a>
"
,
{
"
class
"
:
"
btn
"
});
$buttonDelete
.
append
(
"
Delete
"
);
$controls
.
append
(
$buttonDelete
);
$controls
.
append
(
$buttonDelete
);
if
(
this
.
isDisabled
)
{
if
(
this
.
isDisabled
)
{
...
@@ -150,6 +154,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -150,6 +154,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
this
.
_getPlus
=
function
()
{
this
.
_getPlus
=
function
()
{
var
id
=
this
.
containerId
+
"
-plus-button
"
;
var
id
=
this
.
containerId
+
"
-plus-button
"
;
var
tableId
=
id
+
"
-table
"
;
var
$component
=
$
(
"
<div>
"
,
{
"
id
"
:
id
,
"
class
"
:
"
control-group
"
}
);
var
$component
=
$
(
"
<div>
"
,
{
"
id
"
:
id
,
"
class
"
:
"
control-group
"
}
);
var
$controls
=
$
(
"
<div>
"
,
{
"
class
"
:
"
controls
"
});
var
$controls
=
$
(
"
<div>
"
,
{
"
class
"
:
"
controls
"
});
...
@@ -164,11 +169,12 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -164,11 +169,12 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
var
_this
=
this
;
var
_this
=
this
;
var
onClick
=
function
(
elem
)
{
var
onClick
=
function
(
elem
)
{
_this
.
add
OneSlot
(
);
_this
.
_
add
Any
(
id
,
tableId
,
null
);
};
};
$buttonPlus
.
click
(
onClick
);
$buttonPlus
.
click
(
onClick
);
$component
.
append
(
$controls
);
$component
.
append
(
$controls
);
$component
.
append
(
$
(
"
<div>
"
,
{
"
id
"
:
tableId
}));
return
$component
;
return
$component
;
}
}
...
@@ -233,6 +239,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -233,6 +239,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
}
}
//Check for a non predefined slot that is free
//Check for a non predefined slot that is free
var
labelId
=
null
;
if
(
!
freePredefinedSampleId
)
{
if
(
!
freePredefinedSampleId
)
{
for
(
var
i
=
0
;
i
<
this
.
_lastIndex
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
_lastIndex
;
i
++
)
{
var
predefinedSampleId
=
this
.
containerId
+
"
-
"
+
i
+
"
-sample
"
;
var
predefinedSampleId
=
this
.
containerId
+
"
-
"
+
i
+
"
-sample
"
;
...
@@ -240,6 +247,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -240,6 +247,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
var
containerId
=
this
.
containerId
+
"
-
"
+
i
;
var
containerId
=
this
.
containerId
+
"
-
"
+
i
;
var
freePredefinedTypeCodeAux
=
$
(
"
#
"
+
containerId
).
attr
(
"
sample-type-code
"
);
var
freePredefinedTypeCodeAux
=
$
(
"
#
"
+
containerId
).
attr
(
"
sample-type-code
"
);
if
(
"
null
"
===
freePredefinedTypeCodeAux
)
{
if
(
"
null
"
===
freePredefinedTypeCodeAux
)
{
labelId
=
this
.
containerId
+
"
-
"
+
i
+
"
-label
"
;
freePredefinedSampleId
=
predefinedSampleId
;
freePredefinedSampleId
=
predefinedSampleId
;
break
;
break
;
}
}
...
@@ -250,6 +258,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -250,6 +258,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
//Create a new slot if nothing is found
//Create a new slot if nothing is found
if
(
!
freePredefinedSampleId
)
{
//Create a new slot if not found
if
(
!
freePredefinedSampleId
)
{
//Create a new slot if not found
var
sampleId
=
this
.
containerId
+
"
-
"
+
this
.
_lastIndex
+
"
-sample
"
;
var
sampleId
=
this
.
containerId
+
"
-
"
+
this
.
_lastIndex
+
"
-sample
"
;
labelId
=
this
.
containerId
+
"
-
"
+
this
.
_lastIndex
+
"
-label
"
;
freePredefinedSampleId
=
sampleId
;
freePredefinedSampleId
=
sampleId
;
this
.
addOneSlot
();
this
.
addOneSlot
();
}
}
...
@@ -264,8 +273,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -264,8 +273,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
}
}
var
propertiesToShowDisplayNames
=
this
.
profile
.
getPropertiesDisplayNamesForTypeCode
(
sampleToAdd
.
sampleTypeCode
,
propertiesToShow
);
var
propertiesToShowDisplayNames
=
this
.
profile
.
getPropertiesDisplayNamesForTypeCode
(
sampleToAdd
.
sampleTypeCode
,
propertiesToShow
);
var
meaningfulInfo
=
{};
var
meaningfulInfo
=
"
<b>Code: </b>
"
+
sampleToAdd
.
code
+
"
"
;
meaningfulInfo
[
"
CODE
"
]
=
sampleToAdd
.
code
;
var
max3Length
=
(
propertiesToShow
.
length
>
3
)?
3
:
propertiesToShow
.
length
;
var
max3Length
=
(
propertiesToShow
.
length
>
3
)?
3
:
propertiesToShow
.
length
;
for
(
var
j
=
0
;
j
<
max3Length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
max3Length
;
j
++
)
{
...
@@ -275,15 +283,23 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
...
@@ -275,15 +283,23 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
}
}
var
propertyToShowDisplayName
=
propertiesToShowDisplayNames
[
j
];
var
propertyToShowDisplayName
=
propertiesToShowDisplayNames
[
j
];
meaningfulInfo
[
propertyToShowDisplayName
]
=
Util
.
getEmptyIfNull
(
propertyToShow
);
meaningfulInfo
+=
"
<b>
"
+
propertyToShowDisplayName
+
"
: </b>
"
+
Util
.
getEmptyIfNull
(
propertyToShow
)
+
"
"
;
}
var
$input
=
$
(
"
#
"
+
freePredefinedSampleId
);
if
(
labelId
)
{
$
(
"
#
"
+
labelId
).
text
(
sampleToAdd
.
sampleTypeCode
+
"
:
"
);
}
if
(
meaningfulInfo
.
length
>
200
)
{
meaningfulInfo
=
meaningfulInfo
.
substring
(
0
,
200
)
+
"
...
"
;
}
}
$
(
"
#
"
+
freePredefinedSampleId
).
val
(
JSON
.
stringify
(
meaningfulInfo
));
$input
.
empty
();
$input
.
append
(
meaningfulInfo
);
}
}
}
}
this
.
removeSample
=
function
(
sampleId
)
{
this
.
removeSample
=
function
(
sampleId
)
{
if
(
this
.
samples
[
sampleId
])
{
if
(
this
.
samples
[
sampleId
])
{
$
(
'
#
'
+
sampleId
).
val
(
""
);
$
(
'
#
'
+
sampleId
).
empty
(
);
this
.
samples
[
sampleId
]
=
null
;
this
.
samples
[
sampleId
]
=
null
;
}
}
}
}
...
...
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