Skip to content

Commit 9596086

Browse files
authored
Merge pull request #546 from vdvibhu20/hire-api
Hire api
2 parents ec100e2 + 147759e commit 9596086

File tree

5 files changed

+18
-77
lines changed

5 files changed

+18
-77
lines changed

config/environment.js

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = function(environment) {
121121
ENV.clientId = 5633768694
122122
ENV.oneauthURL = 'https://account.codingblocks.com'
123123
ENV.hackApiHost = 'https://hack-api.codingblocks.com'
124+
ENV.hiringblocksUrl = 'https://hire.codingblocks.com'
124125
ENV.googleAnalytics = {
125126
webPropertyId: 'UA-83327907-12'
126127
}
@@ -146,6 +147,7 @@ module.exports = function(environment) {
146147
ENV.clientId = 5169892443
147148
ENV.oneauthURL = 'https://account.codingblocks.com'
148149
ENV.hackApiHost = 'https://hack-api.codingblocks.xyz'
150+
ENV.hiringblocksUrl = 'https://hire.codingblocks.xyz'
149151

150152
ENV.talkjs = {
151153
appId: '2LhQvB3j'

lib/hiring-blocks/addon/pods/components/job-listing-panels/job-list/component.js

+6-21
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { restartableTask } from 'ember-concurrency-decorators';
33
import { inject as service } from '@ember/service';
44
import { action } from '@ember/object'
55
import { alias } from '@ember/object/computed';
6+
import moment from 'moment';
67

78
export default class JobListComponent extends Component {
89
@service store
910

10-
@alias('fetchJobsTask.lastSuccessful.value.meta.pagination') pagination
11+
@alias('fetchJobsTask.lastSuccessful.value.meta') pagination
1112

1213
offset = 0
1314
limit = 4
@@ -21,34 +22,18 @@ export default class JobListComponent extends Component {
2122

2223
@restartableTask fetchJobsTask = function *() {
2324
const filter = {
24-
deadline: {
25-
$gt: new Date()
26-
},
27-
postedOn: {
28-
$lte: new Date()
29-
}
30-
}
31-
32-
filter.location = {
33-
$ilike: {
34-
$any: this.filters.locations
35-
}
25+
"is_accepting =": true,
26+
"deadline >": moment().format(),
27+
"companies.is_active =": true
3628
}
3729

38-
filter.type = {
39-
$in: this.filters.jobTypes
40-
}
41-
42-
if (this.filters.eligibility)
43-
filter.eligibilityStatus = this.filters.eligibility
44-
4530
const loadedJobs = yield this.store.query('job', {
4631
filter,
4732
page: {
4833
offset: this.offset,
4934
limit: this.limit
5035
},
51-
sort: '-postedOn'
36+
sort: '-posted_on'
5237
})
5338

5439
this.set('jobs', loadedJobs.toArray())
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import Component from '@ember/component';
22
import layout from './template';
3+
import { computed } from '@ember/object';
4+
import ENV from 'codingblocks-online/config/environment'
35

46
export default Component.extend({
5-
layout
7+
layout,
8+
9+
jobViewUrl : computed('job.id', function () {
10+
return ENV.hiringblocksUrl + '/jobs/' + this.job.id
11+
})
612
});

lib/hiring-blocks/addon/pods/components/job-listing-panels/job-row/template.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
</div>
3131

3232
<div class="d-md-block d-none">
33-
<LinkTo @route="listing.job" @model={{job.id}} class="button-dashed button-orange">View Details</LinkTo>
33+
<a href="{{jobViewUrl}}" class="button-dashed button-orange">View Details</a>
3434
</div>
3535
<div class="d-md-none d-block d-flex justify-content-center w-100 mt-3">
36-
<LinkTo @route="listing.job" @model={{job.id}} class="button-dashed button-orange">View Details</LinkTo>
36+
<a href="{{jobViewUrl}}" class="button-dashed button-orange">View Details</a>
3737
</div>
3838
</div>

lib/hiring-blocks/addon/pods/listing/index/template.hbs

+1-53
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,6 @@
1414
</div>
1515

1616

17-
<WTabNav
18-
@tabs={{tabs}}
19-
@activeTab={{activeTab}}
20-
@onTabChange={{action (mut activeTab)}}
21-
>
22-
<div class="d-flex my-4 justify-content-between">
23-
<div class="d-flex w-50">
24-
<div class="flex-1 font-md">Filter Jobs</div>
25-
26-
<div class="flex-1 mx-5">
27-
<PowerSelectMultiple
28-
@selected={{locations}}
29-
@options={{possibleLocations}}
30-
@closeOnSelect={{false}}
31-
@placeholder="Location"
32-
@triggerComponent={{component 'job-filter/trigger-component'}}
33-
@onChange={{action (mut locations)}}
34-
as |location|>
35-
<input
36-
type="checkbox"
37-
onclick={{action "preventDefault"}}
38-
checked={{includes locations location}} />
39-
{{location}}
40-
</PowerSelectMultiple>
41-
</div>
42-
43-
<div class="flex-1 mx-5">
44-
<PowerSelectMultiple
45-
@selected={{jobTypes}}
46-
@options={{possibleJobTypes}}
47-
@closeOnSelect={{false}}
48-
@placeholder="Job Type"
49-
@triggerComponent={{component 'job-filter/trigger-component'}}
50-
@onChange={{action (mut jobTypes)}}
51-
as |type|>
52-
<input
53-
type="checkbox"
54-
onclick={{action "preventDefault"}}
55-
checked={{includes jobTypes type}} />
56-
{{type}}
57-
</PowerSelectMultiple>
58-
</div>
59-
60-
</div>
61-
62-
{{#if showApplyButton}}
63-
<button class="orange" {{action "apply"}}>
64-
Apply Filter
65-
</button>
66-
{{/if}}
67-
</div>
68-
6917
<div class="divider-h my-4"></div>
7018

7119
{{#if (or selectedLocations.length selectedJobTypes.length)}}
@@ -90,4 +38,4 @@
9038
filters=(hash locations=selectedLocations jobTypes=selectedJobTypes)
9139
}}
9240
</div>
93-
</WTabNav>
41+

0 commit comments

Comments
 (0)