Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Jan Maximilian Michal
grady
Commits
d4196856
Commit
d4196856
authored
6 years ago
by
Dominik Seeger
Browse files
Options
Downloads
Patches
Plain Diff
refactor to class component, also poll available submissions regulary
corrected test
parent
4fd11de1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!150
Resolve "subscription ended on submit"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/subscriptions/SubscriptionList.vue
+48
-37
48 additions, 37 deletions
frontend/src/components/subscriptions/SubscriptionList.vue
functional_tests/test_feedback_creation.py
+2
-1
2 additions, 1 deletion
functional_tests/test_feedback_creation.py
with
50 additions
and
38 deletions
frontend/src/components/subscriptions/SubscriptionList.vue
+
48
−
37
View file @
d4196856
...
...
@@ -6,7 +6,7 @@
Tasks
</v-toolbar-title>
<v-spacer/>
<v-btn
icon
@
click=
"getSubscriptions"
>
<v-btn
icon
@
click=
"getSubscriptions
(false)
"
>
<v-icon
v-if=
"!updating"
>
refresh
</v-icon>
<v-progress-circular
v-else
...
...
@@ -27,54 +27,65 @@
</v-card>
</
template
>
<
script
>
<
script
lang=
"ts"
>
import
Vue
from
'
vue
'
import
Component
from
'
vue-class-component
'
import
{
Prop
}
from
'
vue-property-decorator
'
import
{
mapGetters
,
mapActions
,
mapState
}
from
'
vuex
'
import
{
UI
}
from
'
@/store/modules/ui
'
import
{
actions
}
from
'
@/store/actions
'
import
SubscriptionCreation
from
'
@/components/subscriptions/SubscriptionCreation
'
import
SubscriptionForList
from
'
@/components/subscriptions/SubscriptionForList
'
import
SubscriptionsForStage
from
'
@/components/subscriptions/SubscriptionsForStage
'
import
SubscriptionCreation
from
'
@/components/subscriptions/SubscriptionCreation
.vue
'
import
SubscriptionForList
from
'
@/components/subscriptions/SubscriptionForList
.vue
'
import
SubscriptionsForStage
from
'
@/components/subscriptions/SubscriptionsForStage
.vue
'
import
{
Subscriptions
}
from
'
@/store/modules/subscriptions
'
export
default
{
@
Component
({
name
:
'
subscription-list
'
,
components
:
{
SubscriptionsForStage
,
SubscriptionForList
,
SubscriptionCreation
},
name
:
'
subscription-list
'
,
props
:
{
sidebar
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
selectedStage
:
null
,
updating
:
false
}
SubscriptionCreation
},
computed
:
{
subscriptions
()
{
return
Subscriptions
.
state
.
subscriptions
},
stages
()
{
return
Subscriptions
.
availableStages
},
stagesReadable
()
{
return
Subscriptions
.
availableStagesReadable
},
showDetail
()
{
return
!
this
.
sidebar
||
(
this
.
sidebar
&&
!
UI
.
state
.
sideBarCollapsed
)
}
},
methods
:
{
async
getSubscriptions
()
{
})
export
default
class
SubscriptionList
extends
Vue
{
@
Prop
({
type
:
Boolean
,
required
:
true
,
default
:
false
})
sidebar
!
:
boolean
selectedStage
=
null
updating
=
false
timer
=
0
get
subscriptions
()
{
return
Subscriptions
.
state
.
subscriptions
}
get
stages
()
{
return
Subscriptions
.
availableStages
}
get
stagesReadable
()
{
return
Subscriptions
.
availableStagesReadable
}
get
showDetail
()
{
return
!
this
.
sidebar
||
(
this
.
sidebar
&&
!
UI
.
state
.
sideBarCollapsed
)
}
async
getSubscriptions
(
silent
:
boolean
)
{
if
(
silent
===
false
)
{
this
.
updating
=
true
const
subscriptions
=
await
Subscriptions
.
getSubscriptions
()
this
.
updating
=
false
return
subscriptions
}
},
created
()
{
const
typesAndSubscriptions
=
[
actions
.
updateSubmissionTypes
(),
Subscriptions
.
getSubscriptions
()]
Promise
.
all
(
typesAndSubscriptions
).
then
(()
=>
{
const
subscriptions
=
await
Subscriptions
.
getSubscriptions
()
this
.
updating
=
false
return
subscriptions
}
mounted
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
getSubscriptions
(
true
)
},
30
*
1
e3
)
}
beforeDestroy
()
{
clearInterval
(
this
.
timer
)
}
created
()
{
const
submissionTypes
=
actions
.
updateSubmissionTypes
()
const
subscriptions
=
Subscriptions
.
getSubscriptions
()
Promise
.
all
([
submissionTypes
,
subscriptions
]).
then
(()
=>
{
Subscriptions
.
subscribeToAll
()
Subscriptions
.
cleanAssignmentsFromSubscriptions
()
Subscriptions
.
cleanAssignmentsFromSubscriptions
(
undefined
)
})
}
}
...
...
This diff is collapsed.
Click to expand it.
functional_tests/test_feedback_creation.py
+
2
−
1
View file @
d4196856
...
...
@@ -227,7 +227,8 @@ class UntestedParent:
self
.
write_comments_on_lines
([(
0
,
'
I disagree
'
),
(
1
,
'
Full points!
'
)])
self
.
browser
.
find_element_by_id
(
'
score-full
'
).
click
()
self
.
browser
.
find_element_by_id
(
'
submit-feedback
'
).
click
()
WebDriverWait
(
self
.
browser
,
10
).
until
(
ec
.
url_contains
(
'
subscription/ended
'
))
sub_url
=
'
subscription/
'
+
str
(
self
.
sub_type
.
pk
)
+
'
/ended
'
WebDriverWait
(
self
.
browser
,
10
).
until
(
ec
.
url_contains
(
sub_url
))
submission_for_code
=
Submission
.
objects
.
get
(
text
=
code
)
self
.
assertEqual
(
self
.
sub_type
.
full_score
,
submission_for_code
.
feedback
.
score
)
self
.
assertEqual
(
3
,
submission_for_code
.
feedback
.
feedback_lines
.
count
())
...
...
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