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

WIP on jobs board #1102

Closed
wants to merge 38 commits into from
Closed

Conversation

CuriousLearner
Copy link
Contributor

Description

This is still a WIP. Will update it soon.

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)
Testing
Refers/Fixes

Refs #958


var set_filter_header = function() {
var idxStatusEl = $('input[name=idx_status]:checked');
var filter_status = idxStatusEl.attr('val-ui') ? idxStatusEl.attr('val-ui') : 'All';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected blank line after variable declarations. (newline-after-var)

var idxStatusEl = $('input[name=idx_status]:checked');
var filter_status = idxStatusEl.attr('val-ui') ? idxStatusEl.attr('val-ui') : 'All';
// TODO: See what all filters are to be displayed from designs
$('#filter').html("All");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings must use singlequote. (quotes)


var matchesEl = $('#matches');
var
listingInfoEl = $('#listing-info');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 2. (indent)

@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add tests?

from .models import Job


def list_jobs(request):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be changed and just contain template response, since the views just calls the relevant API to fetch data.

@owocki

@thelostone-mc
Copy link
Member

@CuriousLearner heads up -> we are moving to rem as against to px ^_^

@owocki
Copy link
Contributor

owocki commented May 8, 2018

@CuriousLearner heads up -> we are moving to rem as against to px ^_^

we should really have details about this (and other code standards which we follow) in the contributor guidelines, so that people have the opportunity to know upfront, before they submit the PR

@mbeacom mbeacom added the wip label May 8, 2018
@thelostone-mc
Copy link
Member

we should really have details about this (and other code standards which we follow)

@owocki It's been added here

@codecov
Copy link

codecov bot commented May 13, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@2f10de2). Click here to learn what that means.
The diff coverage is 27.27%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1102   +/-   ##
=========================================
  Coverage          ?   15.32%           
=========================================
  Files             ?      141           
  Lines             ?    10973           
  Branches          ?     1457           
=========================================
  Hits              ?     1682           
  Misses            ?     9285           
  Partials          ?        6
Impacted Files Coverage Δ
app/app/settings.py 84.04% <ø> (ø)
app/jobs/views.py 0% <0%> (ø)
app/jobs/forms.py 0% <0%> (ø)
app/jobs/routers.py 0% <0%> (ø)
app/jobs/services.py 0% <0%> (ø)
app/app/urls.py 0% <0%> (ø)
app/jobs/filters.py 0% <0%> (ø)
app/jobs/api.py 0% <0%> (ø)
app/jobs/serializers.py 0% <0%> (ø)
app/jobs/apps.py 0% <0%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f10de2...5ea25f1. Read the comment docs.

@mbeacom
Copy link
Contributor

mbeacom commented May 14, 2018

@CuriousLearner Please follow the instructions in https://github.com/gitcoinco/web/blob/master/docs/CONTRIBUTING.md to enable precommit
and install it's dependencies.

@owocki
Copy link
Contributor

owocki commented May 16, 2018

#1102
#1079

which of these PRs should remain active?

@CuriousLearner
Copy link
Contributor Author

@owocki #1102 should be the active one as discussed previously.
@zoek1 Do you want to collaborate on some of the things?

@owocki owocki mentioned this pull request May 17, 2018
20 tasks
@owocki
Copy link
Contributor

owocki commented May 17, 2018

thanks @CuriousLearner i will comment on the other thread.. when do you think youll have this PR ready for review?

/* eslint no-redeclare: "warn" */

var build_detail_page = function(result) {
var template = $.templates('#job_detail');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 3. (indent)

var build_detail_page = function(result) {
var template = $.templates('#job_detail');

html = template.render(result);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 3. (indent)


html = template.render(result);

$('#rendered_job_detail').html(html);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 3. (indent)

var nonefound = true;

if (result) {
nonefound = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 7. (indent)


if (result) {
nonefound = false;
build_detail_page(result);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 8. (indent)

if (result) {
nonefound = false;
build_detail_page(result);
document.result = result;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 8. (indent)

nonefound = false;
build_detail_page(result);
document.result = result;
$('#rendered_job_detail').css('display', 'block');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 6 spaces but found 8. (indent)


var main = function() {
setTimeout(function() {
pull_job_from_api();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 4 spaces but found 6. (indent)

// } else if (result['fulfiller_address'] !== '0x0000000000000000000000000000000000000000') {
// result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outline-dark" role="button" href="#">' + result['status'] + '</span></a>';
// }
console.log(result);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement. (no-console)


result['job_company'] = ((result['company'] ? result['company'] : 'Company Hidden') + ' &bull; ');

result['job_skill'] += result['skills'] ? result['skills'] : ''

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon. (semi)

@CuriousLearner
Copy link
Contributor Author

@owocki @mbeacom where do I find the list of skills to be populated in the Jobs Board?

@mbeacom
Copy link
Contributor

mbeacom commented May 21, 2018

@CuriousLearner I could be mistaken, as I didn't scope this initially, but I think we're using Keywords. You should be able to retrieve them via a GET against the keywords API endpoint.

@owocki
Copy link
Contributor

owocki commented May 21, 2018

yes Keywords is what you want to use

@CuriousLearner
Copy link
Contributor Author

Update:

Right now working on initial form for job creation.

  • Need to apply filters/keywords in list view filtering and fix css.
  • Need css changes in detail view as well.

from datetime import timedelta

from django.conf import settings
from django.contrib.postgres.fields import ArrayField

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.contrib.postgres.fields.ArrayField' imported but unused

@CuriousLearner
Copy link
Contributor Author

@mbeacom @owocki

Sure, I've used skills API helper to populate the choice field for skills.

I do have a question though:

  • I see that the description section for the job posting is a WYSIWYG editor. Do we already have something integrated with the project, or are there any preference for packages to use here?

@CuriousLearner
Copy link
Contributor Author

Also, I see in the Job posting design that Job Type can be Full-time or Part-time, but the list view also shows a third job_type that says contract.

Do we need to update one of the designs here?

@CuriousLearner
Copy link
Contributor Author

@thelostone-mc Can you take a look now please? :)

@owocki
Copy link
Contributor

owocki commented Jul 9, 2018

testing now

var toggleAny = function(event) {
if (!event)
return;
// var key = event.target.name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats with this commented out code?

});
}

if (localStorage['keywords']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be a name collision with the dashboard.js which also has localStorage['keywords

@ghost ghost assigned owocki Jul 9, 2018
@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

@owocki
Copy link
Contributor

owocki commented Jul 9, 2018

here is my QA notes:

CRITICAL:

  1. it is possible to do SQL injection when posting a job - screenshot
  2. search doesnt work
  3. neither do the filters on the left hand side
  4. the job/* pages are super slow to load. per this console output from my terminal, it looks like they request a bunch of info from github every pageload

HIGH PRIORITY

  1. when a new job is submitted, admins should be emailed to approve it. here is a method you can copy
  2. how come i can only add one skill ?
  3. on the 'issue description', the placeholder text is bad. it should be "Please enter the job description as plaintext or markdown' screenshot
  4. sidebar says 'back to issue explorer' but were browsing jobs not issue explorer
  5. dashboard.js and jobs.js have a lot of duplicated / copied / pasted code.
  6. bounty detail page does not match the design screenshot - with design / implementation

OTHER

  1. this info button doesnt have a tooltip - screenshot
  2. can we make this a button
  3. responsiveness of each page could use some work. screenshot1 2 3
  4. merge conflicts need resolved

@CuriousLearner let me know what you think of the above. we're hoping to get this shipped in the next week or so, so let us know what your availability is to work through the issues

font-size: 3em;
}

.company-name, #exp-lang, #job-post-duration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we break this up into multiple lines?

padding-left: 1em;
padding-right: 2em;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we replace px and em with -> rem

Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general comments - We'll definitely need to address all of the comments presented by @owocki and ensure we're performing the appropriate field validation/cleaning.

@@ -935,7 +935,7 @@ def profile_keywords_helper(handle):
"""
profile = profile_helper(handle, True)

keywords = []
keywords = list()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to change this and is a commonly considered an antipattern in Python in favor of the shorthand []


def job_detail(request, pk):
context = {
'pk': pk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle any kind of update functionality against details and use the form you've already created?

@@ -0,0 +1,111 @@
{% comment %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template should extend base.html

@@ -0,0 +1,122 @@
{% load i18n static %}
<!DOCTYPE html>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template should extend base.html

@@ -0,0 +1,120 @@
{% comment %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template should extend base.html

verbose_name=_('Title'), max_length=200, null=False, blank=False
)
description = models.TextField(verbose_name=_('Description'))
github_profile_link = models.URLField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github profiles should link directly back to dashboard.Profile versus char/url storage of text representing a Profile.

company = models.CharField(_('Company'), max_length=50, null=True, blank=True)
apply_email = models.EmailField(_('Contact Email for Job'), null=True, blank=True)
posted_at = models.DateTimeField(_('Posted At'), null=False, blank=False, default=timezone.now)
posted_by_gitcoin_username = models.CharField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be associated with the dashboard.Profile that created the Job versus charfield of username

@@ -0,0 +1,24 @@

# Third Party Stuff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with docstring



def list_jobs(request):
context = dict()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this and simply context={} if that's what you're going for here. Realistically, we probably want to pass some contextual data to the list view.



def create_job(request):
context = dict()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When possible, please use the shorthand {}

@owocki
Copy link
Contributor

owocki commented Jul 10, 2018

@CuriousLearner let us know what you think of the above review!

@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

* 'master' of https://github.com/gitcoinco/web: (76 commits)
  hack: trailing slash for profile (gitcoinco#1937)
  Minor tweaks to action plan textarea (gitcoinco#1856)
  fixes label on gas guzzler page, and adds an admin view for vizuailzations
  keep an eye on unsubscribes in preferences
  keep an eye on unsubscribes in preferences
  Split create_new_bounty kwargs building and check if once (gitcoinco#1892)
  press
  satisfy linter
  fix for https://gitcoincore.slack.com/archives/CAXQ7PT60/p1533912000000126
  Update profile check to getattr
  share link not edit link
  does tip receive math in BigNumber, bc JS rounding issues
  copy updates
  newsletter 8/10
  fix for slack not showing UP
  gas guzzlers
  linter
  gas guzzlers
  Error: insufficient funds for gas * price + value
  starts to track gas guzzlers, for later inclusion in the gitcoin gas station
  ...
@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

@@ -0,0 +1,3 @@
from django.test import TestCase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.test.TestCase' imported but unused

@mbeacom
Copy link
Contributor

mbeacom commented Oct 5, 2018

Is this something we should pursue rebasing and handing back off to @CuriousLearner (if interested) or bountying back out for completion? cc @owocki @PixelantDesign @thelostone-mc @SaptakS

@owocki
Copy link
Contributor

owocki commented Oct 5, 2018

i'd be curious to hear from @CuriousLearner if is interested in handling it.. if not, i think we backoff for now

@CuriousLearner
Copy link
Contributor Author

Hey, @owocki @mbeacom I can do this, but I'll be traveling in October to the US for my DjangoCon US talk. So, I think I'll be able to handle this after that.

@mbeacom
Copy link
Contributor

mbeacom commented Nov 19, 2018

@CuriousLearner Thanks for the heads up - Closing for now. Feel free to re-open if/when you find the time!

@mbeacom mbeacom closed this Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants