Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
custom-tzcld
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Components
custom-tzcld
Commits
1e05637b
Commit
1e05637b
authored
1 year ago
by
Antoine Dupré
Browse files
Options
Downloads
Patches
Plain Diff
feature: add display for points parts
parent
801b764c
No related branches found
No related tags found
No related merge requests found
Pipeline
#14919
passed
1 year ago
Stage: prepare
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/widjets-display-evaluation-tzcld.js
+130
-6
130 additions, 6 deletions
src/widjets-display-evaluation-tzcld.js
with
130 additions
and
6 deletions
src/widjets-display-evaluation-tzcld.js
+
130
−
6
View file @
1e05637b
...
...
@@ -76,6 +76,88 @@ import("./utils.js").then((utils) => {
}
}
);
core
.
Sib
.
register
({
name
:
"
tzcld-autoeval-points
"
,
use
:
[
core
.
StoreMixin
],
empty
()
{
console
.
debug
();
this
.
element
.
innerHTML
=
""
;
},
async
populate
()
{
this
.
element
.
innerHTML
=
`
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`
;
let
tzcldprofile
=
{
community
:
await
this
.
resource
,
name
:
await
this
.
resource
.
name
,
};
console
.
log
(
this
.
element
.
getAttribute
(
'
parts
'
)
);
console
.
log
(
await
tzcldprofile
.
community
)
;
if
(
"
label
"
in
this
.
element
.
attributes
)
{
for
(
let
ignore
of
this
.
element
.
attributes
[
'
label
'
].
value
.
split
(
'
,
'
))
{
tzcldprofile
[
ignore
.
trim
()]
=
null
;
}
}
let
render
=
`
<solid-display solid-resource bind-resources fields="name reponse" data-src="
${
this
.
element
.
getAttribute
(
'
data-src
'
)}
" widget-name="div"
></solid-display>`
;
this
.
element
.
innerHTML
=
render
;
}
});
core
.
Sib
.
register
({
name
:
"
tzcld-autoeval
"
,
use
:
[
core
.
StoreMixin
],
empty
()
{
console
.
debug
();
this
.
element
.
innerHTML
=
""
;
},
async
populate
()
{
this
.
element
.
innerHTML
=
`
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`
;
let
tzcldprofile
=
{
community
:
await
this
.
resource
,
name
:
await
this
.
resource
.
name
,
};
console
.
log
(
this
.
element
.
getAttribute
(
'
parts
'
)
);
console
.
log
(
await
tzcldprofile
.
community
)
;
if
(
"
label
"
in
this
.
element
.
attributes
)
{
for
(
let
ignore
of
this
.
element
.
attributes
[
'
label
'
].
value
.
split
(
'
,
'
))
{
tzcldprofile
[
ignore
.
trim
()]
=
null
;
}
}
let
render
=
`<div>
${
await
tzcldprofile
.
name
}
</div>
<solid-display solid-resource bind-resources data-src="
${
this
.
element
.
getAttribute
(
'
parts
'
)}
" parts-points="
${
this
.
element
.
getAttribute
(
'
parts-points
'
)}
" fields="name, title, subtitle, part_points"
multiple-part_points="tzcld-autoeval-points",
widget-name="div",
widget-title="div",
widget-subtitle="div",
widget-part_points="tzcld-autoeval-points",
></solid-display>`
;
this
.
element
.
innerHTML
=
render
;
}
});
customElements
.
define
(
"
solid-tzcld
"
,
class
extends
core
.
SolidTemplateElement
{
...
...
@@ -97,8 +179,9 @@ import("./utils.js").then((utils) => {
routeurs
()
{
let
render
=
`
<solid-router default-route="
${
this
.
route
}
-answers">
<solid-route name="
${
this
.
route
}
-answers"></solid-route>
<solid-router default-route="
${
this
.
route
}
-my-communities">
<solid-route name="
${
this
.
route
}
-answers" use-id></solid-route>
<solid-route name="
${
this
.
route
}
-my-communities"></solid-route>
</solid-router>
`
;
...
...
@@ -110,6 +193,44 @@ import("./utils.js").then((utils) => {
return
render
;
}
viewMyCommunities
()
{
let
render
=
`
<div id="
${
this
.
route
}
-my-communities" data-view="
${
this
.
route
}
-my-communities" class="tzcld-my-communities">
<div class="segment full padding-large border-bottom border-color-grey" style="padding-top: 0;">
<div class="segment full sm-hidden text-right">
<solid-link class="backlink" next="
${
this
.
route
}
-community-profile">
${
this
.
localize
(
"
back
"
)}
</solid-link>
</div>
</div>
<div class="segment block shadow bg-color-white margin-right-xxsmall margin-left-xxsmall sm-margin-none">
<div class="loader" id="loader-
${
this
.
route
}
-my-communities">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<solid-display
bind-resources=""
loader-id="loader-
${
this
.
route
}
-my-communities"
data-src ="
${
this
.
communities
}
"
fields="name"
next="
${
this
.
route
}
-answers"
`
;
render
+=
`>
</solid-display>`
;
render
+=
`
</div>
</div>`
;
return
render
;
}
viewCommunityAnswers
()
{
...
...
@@ -130,15 +251,17 @@ import("./utils.js").then((utils) => {
<div></div>
</div>
<
solid-display
<
tzcld-autoeval
bind-resources=""
loader-id="loader-
${
this
.
route
}
-answer"
data-src ="
${
this
.
parts
}
"
parts ="
${
this
.
parts
}
"
parts-points ="
${
this
.
partsPoints
}
"
point-answers ="
${
this
.
pointAnswers
}
"
solid-resource
`
;
render
+=
`>
</
solid-display
>`
;
</
tzcld-autoeval
>`
;
render
+=
`
...
...
@@ -162,6 +285,7 @@ import("./utils.js").then((utils) => {
${
this
.
routeurs
()}
${
this
.
viewWidgets
()}
${
this
.
viewCommunityAnswers
()}
${
this
.
viewMyCommunities
()}
`
;
return
render
;
...
...
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