Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement labels (resolves #313) #392

Merged
merged 147 commits into from
Apr 26, 2019
Merged
Changes from 1 commit
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
516d262
Revised labelset and label models
jace Apr 8, 2019
49af3f6
Fix docstrings, add columns
jace Apr 8, 2019
5dd3e91
Fix foreignkey
jace Apr 8, 2019
169cb1d
added migration for labels
Apr 8, 2019
d5ffbed
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 8, 2019
239fa9a
added tests for assigning labels
Apr 8, 2019
c1b655e
added tests for radio labelsets
Apr 9, 2019
f06ebcd
added mock usermanager for auth testing
Apr 10, 2019
cd4e894
updated scope for user, team, profile and project fixture
Apr 10, 2019
87b1f62
logging in without dummy usermanager
Apr 10, 2019
7b40639
Add manage label page(WIP) (#394)
vidya-ram Apr 11, 2019
909fa4e
added migration for moving old sections, session types and technical …
Apr 11, 2019
3e0c426
some comments
Apr 11, 2019
8c74b4a
added dynamic proposalform and handling of labels
Apr 12, 2019
ef7ee3a
added comments
Apr 12, 2019
e755ef3
added removal of labels in non radio mode
Apr 12, 2019
3400a3e
Add CTA button to proposal page
vidya-ram Apr 12, 2019
9e51ff3
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 12, 2019
040509c
Fix styling of proposal labels
vidya-ram Apr 12, 2019
e979dee
removed the inner outer form classes, added get_proposal_form
Apr 12, 2019
8f8e781
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 12, 2019
9f9c8e9
added archived flag
Apr 12, 2019
b99b672
fixed labelview loader
Apr 13, 2019
1ec283a
added view for admins to set labels to a proposal
Apr 13, 2019
97ab0c8
fixed new form
Apr 15, 2019
32e0db5
comment
Apr 15, 2019
eee9e83
fixed label loading in dynamic form
Apr 15, 2019
e74f8db
Fix labels UI
vidya-ram Apr 15, 2019
3551b8f
Sync with master
vidya-ram Apr 15, 2019
e99e34b
Remove LabelSet
jace Apr 15, 2019
b733c6b
Use self.is_parent
jace Apr 15, 2019
c3f61e6
Required flag must be false if not a parent label
jace Apr 15, 2019
c838cf3
Updated docstrings
jace Apr 16, 2019
81f65a3
Don't need use_alter for self-referential
jace Apr 16, 2019
ba9670c
Rename part_labels (column rename also needed)
jace Apr 16, 2019
9b5740e
added setter and expression for restricted and archived
Apr 16, 2019
a3f118f
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 16, 2019
12a2d17
modified migration for labels
Apr 16, 2019
10da32c
fixed expression for flags
Apr 16, 2019
d403b22
replaced labelset views and form
Apr 16, 2019
ea255bc
removed labelset form
Apr 16, 2019
a083c63
added missing project FK in migration
Apr 16, 2019
a2cb4b1
Label form(WIP)
vidya-ram Apr 17, 2019
49d505a
Remove unwanted fields from sublabel form and update the UI
vidya-ram Apr 17, 2019
5d8bd1f
Remove description and bgcolor
vidya-ram Apr 17, 2019
369c099
added sublabel form
Apr 17, 2019
0698e06
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 17, 2019
5cd4341
added sublabelform
Apr 17, 2019
95b1028
Add emoji picker
vidya-ram Apr 17, 2019
29b2be9
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 17, 2019
cb24ad8
saving sublabels with emojis
Apr 18, 2019
6d83dfd
removed length validator from emoji field
Apr 18, 2019
580dce1
sending an empty sublabel form to template
Apr 18, 2019
d5e5ecc
modified how choices are formatted
Apr 18, 2019
ecb8b00
using labels_form template for label edit
Apr 19, 2019
2de3337
sending sublabels to label edit form
Apr 19, 2019
ba2737d
Update the UI of manage label page
vidya-ram Apr 19, 2019
a8124b4
trying to use proxy for labelset
Apr 19, 2019
01d8390
saving labels
Apr 19, 2019
ece8fbf
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 19, 2019
9c442e2
moved keys method to wrapper
Apr 22, 2019
7dd9829
Rename label parent/children to main/options; fix archived expression
jace Apr 22, 2019
0563c56
Uncommitted file in label main/options commit
jace Apr 22, 2019
6350ae2
added migration for old labels
Apr 22, 2019
82c8236
Fixed proposal label form
jace Apr 22, 2019
6800399
Validator message
jace Apr 22, 2019
a6d1411
Check for emoji on proposal page
vidya-ram Apr 22, 2019
f802f49
Ignore archived label options
jace Apr 22, 2019
af8aee6
old labels are not restricted
Apr 22, 2019
d7d8f08
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 22, 2019
d28ec8c
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 22, 2019
6b3391b
Remove unused ProposalFormData (from #109)
jace Apr 22, 2019
1e8433d
No CSRF in form fields
jace Apr 22, 2019
33e5b0b
Check for emoji
vidya-ram Apr 22, 2019
647aae3
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 22, 2019
d424ee3
only showing icon emoji if it's available
Apr 22, 2019
ddefe22
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 22, 2019
bf1c304
Friendlier messaging in label form; appropriate name
jace Apr 22, 2019
7859fb5
Rename label.is_main to has_options
jace Apr 22, 2019
beadac5
Names should be in singular as per coding convention
jace Apr 22, 2019
02c9ae0
Remove label "icon" title in form (for now)
jace Apr 22, 2019
976a2d3
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 22, 2019
15c31da
Add drag functionality to set sequence of sub labels
vidya-ram Apr 22, 2019
43264cf
Add support to reorder main labels
vidya-ram Apr 23, 2019
d0f044c
added label form for admin panel and added id to labelform
Apr 23, 2019
4cbc4c6
id field is option for labelform
Apr 23, 2019
6949eba
id is optional for options form
Apr 23, 2019
b59a8b5
Layout of manage label page
vidya-ram Apr 23, 2019
2948838
Add proposal_label_admin_form (WIP)
vidya-ram Apr 23, 2019
1191e75
showing booleanfield for boolean labels
Apr 23, 2019
f506c37
showing emoji in front of label title in widget
Apr 23, 2019
3012115
saving labels in admin panel
Apr 23, 2019
12e970f
redirecting to labels page if there is an error in proposals page lab…
Apr 24, 2019
8bdb16a
Add label widget
vidya-ram Apr 24, 2019
af72226
Add functionality to add labels widget
vidya-ram Apr 24, 2019
e0a71e2
fixed view for saving labels
Apr 24, 2019
df75fd3
Fix label widget for checkbox options
vidya-ram Apr 24, 2019
779448b
refactored tests and added more
Apr 24, 2019
5e33781
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 24, 2019
baf9049
added test for label icon
Apr 24, 2019
ca55200
added test for restricted setter
Apr 24, 2019
e7b86b2
added simple integration test
Apr 24, 2019
4441f64
added test for label create view
Apr 25, 2019
87fd255
added test for adding labels with options
Apr 25, 2019
93718f8
added id field to labels form
Apr 25, 2019
b408afc
Style changes and moved widget JS code to JS bundle
vidya-ram Apr 25, 2019
2965703
Merge branch 'labels' of github.com:hasgeek/funnel into labels
vidya-ram Apr 25, 2019
ec9f418
Merge branch 'master' of github.com:hasgeek/funnel into labels
Apr 25, 2019
bd4d19f
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 25, 2019
0a6cbe1
running npm build in travis
Apr 25, 2019
14651de
Add seq and id field for all labels
vidya-ram Apr 25, 2019
ebb55d7
Update the UI of manage label page
vidya-ram Apr 25, 2019
3a8f4eb
Minor css updates of label page
vidya-ram Apr 25, 2019
fa4d228
calling reorder to fix ordering
Apr 25, 2019
53fba72
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 25, 2019
ead9434
saving main label order from manage label page
Apr 25, 2019
d5c260d
added csrf protection to labels reorder form
Apr 26, 2019
bb068fe
addded reordering of sublabels
Apr 26, 2019
72bd94a
added viewsfor delete and archive
Apr 26, 2019
fe8c478
added `has_proposals` to label model
Apr 26, 2019
faf4823
fix edit form
Apr 26, 2019
0191b36
repalce hyphne in permission name
Apr 26, 2019
b2f899a
Add confirmation dialog for delete and archive
vidya-ram Apr 26, 2019
beb56d6
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 26, 2019
e28132b
fixed label delete view
Apr 26, 2019
e3ab13c
using name instead of id
Apr 26, 2019
38fde91
not reusing forms for label
Apr 26, 2019
5dfaaf7
moved label assignment from proposal model to label model
Apr 26, 2019
5de04a7
Change delete and archive to ajax post
vidya-ram Apr 26, 2019
8f18f14
fixed migration
Apr 26, 2019
0ffebb1
linter fixes
Apr 26, 2019
c37f4b7
Fix the label widget
vidya-ram Apr 26, 2019
19a9b46
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 26, 2019
e8c8e78
deleting options before deleting main label
Apr 26, 2019
e88416e
removed labelseqform
Apr 26, 2019
953bc35
fixed syntax error
Apr 26, 2019
b4e7de1
fixed proposal edit page label form
Apr 26, 2019
98954c7
Add title_for_name
jace Apr 26, 2019
344ac3b
fixed archived getter
Apr 26, 2019
063d773
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 26, 2019
e0482fc
Linter fixes
jace Apr 26, 2019
e5fc767
added test for label create, reorder and delete
Apr 26, 2019
30bb4be
reordering after label delete
Apr 26, 2019
08d497e
Merge branch 'labels' of github.com:hasgeek/funnel into labels
Apr 26, 2019
4975b6f
added test for editing labels
Apr 26, 2019
b71bc4e
Session type hasn't been used for a while
jace Apr 26, 2019
8f9e45a
Rename sublabel to option
jace Apr 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
old labels are not restricted
Bibhas committed Apr 22, 2019
commit af8aee679c929c6f2038fa2f01f8f25174e86d70
13 changes: 7 additions & 6 deletions migrations/versions/e2be4ab896d3_migrate_old_labels.py
Original file line number Diff line number Diff line change
@@ -75,15 +75,16 @@ def upgrade():
# create section labelset for the project
labset = conn.execute(label.insert().values({
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'project_id': proj['id'], 'name': u"section", 'title': u"Section",
'seq': 1, 'description': u"", 'restricted': True, 'archived': False,
'seq': 1, 'description': u"", 'restricted': False, 'archived': False,
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
}).returning(label.c.id)).first()

sections = conn.execute(section.select().where(section.c.project_id == proj['id']))
for index, sec in enumerate(sections, start=1):
lab = conn.execute(label.insert().values({
'main_label_id': labset[0],
'project_id': proj['id'], 'name': sec['name'], 'title': sec['title'],
'seq': index, 'description': u"", 'restricted': True, 'archived': False,
'seq': index, 'description': u"", 'restricted': False, 'archived': False,
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
}).returning(label.c.id, label.c.name)).first()

@@ -98,15 +99,15 @@ def upgrade():
# technical level
labset = conn.execute(label.insert().values({
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'project_id': proj['id'], 'name': u"technical-level", 'title': u"Technical Level",
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'seq': 1, 'description': u"", 'restricted': True, 'archived': False,
'seq': 1, 'description': u"", 'restricted': False, 'archived': False,
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
}).returning(label.c.id)).first()
tl_list = [('beginner', "Beginner"), ('intermediate', "Intermediate"), ('advanced', "Advanced")]
for index, tl in enumerate(tl_list):
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
tl_name, tl_title = tl
lab = conn.execute(label.insert().values({
'project_id': proj['id'], 'name': tl_name, 'title': tl_title, 'main_label_id': labset[0],
'seq': index, 'description': u"", 'restricted': True, 'archived': False,
'seq': index, 'description': u"", 'restricted': False, 'archived': False,
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
}).returning(label.c.id, label.c.name)).first()

@@ -121,15 +122,15 @@ def upgrade():
# session type
labset = conn.execute(label.insert().values({
'project_id': proj['id'], 'name': u"session-type", 'title': u"Session Type",
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'seq': 1, 'description': u"", 'restricted': True, 'archived': False,
'seq': 1, 'description': u"", 'restricted': False, 'archived': False,
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
}).returning(label.c.id)).first()
st_list = [('lecture', "Lecture"), ('demo', "Demo"), ('tutorial', "Tutorial"), ('workshop', "Workshop"), ('discussion', "Discussion"), ('panel', "Panel")]
for index, st in enumerate(st_list):
st_name, st_title = st
lab = conn.execute(label.insert().values({
'project_id': proj['id'], 'name': st_name, 'title': st_title, 'main_label_id': labset[0],
'seq': index, 'description': u"", 'restricted': True, 'archived': False,
'seq': index, 'description': u"", 'restricted': False, 'archived': False,
'required': True, 'created_at': datetime.now(), 'updated_at': datetime.now()
}).returning(label.c.id, label.c.name)).first()