Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
Easy Quest - Smart Recruitment Tool with AI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23 - J 36
Easy Quest - Smart Recruitment Tool with AI
Commits
a3912188
Commit
a3912188
authored
May 15, 2023
by
H.M.C. Nadunithara Wijerathne
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it19243122' into 'master'
Close job See merge request
!9
parents
149b8b1e
a1aebd7b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
81 additions
and
26 deletions
+81
-26
src/common/actions/common.ts
src/common/actions/common.ts
+5
-0
src/common/actions/index.ts
src/common/actions/index.ts
+1
-0
src/common/apis/common.ts
src/common/apis/common.ts
+3
-0
src/common/lib/openApi.ts
src/common/lib/openApi.ts
+14
-13
src/common/saga/common.ts
src/common/saga/common.ts
+28
-0
src/components/Application/Analyse.tsx
src/components/Application/Analyse.tsx
+1
-1
src/components/Modals/CreateUpdateJob.tsx
src/components/Modals/CreateUpdateJob.tsx
+27
-12
src/views/Home.view.tsx
src/views/Home.view.tsx
+2
-0
No files found.
src/common/actions/common.ts
View file @
a3912188
...
...
@@ -22,3 +22,8 @@ export const setDialogBox = (payload: string | null) => ({
type
:
ACTIONS
.
SET_DIALOG
,
payload
,
});
export
const
closeJob
=
(
payload
:
string
)
=>
({
type
:
ACTIONS
.
CLOSE_JOB
,
payload
,
});
src/common/actions/index.ts
View file @
a3912188
...
...
@@ -17,6 +17,7 @@ export enum ACTIONS {
GET_JOBS
=
"
GET_JOBS
"
,
CREATE_JOB
=
"
CREATE_JOB
"
,
UPDATE_JOB
=
"
UPDATE_JOB
"
,
CLOSE_JOB
=
"
CLOSE_JOB
"
,
UPDATE_APPLICATION
=
"
UPDATE_APPLICATION
"
,
UPDATE_APPLICATION_ACTION
=
"
UPDATE_APPLICATION_ACTION
"
,
SET_DIALOG
=
"
SET_DIALOG
"
,
...
...
src/common/apis/common.ts
View file @
a3912188
...
...
@@ -34,4 +34,7 @@ export default class CommonAPI {
static
searchJobs
=
(
key
:
string
)
=>
request
(
"
<BASE_URL>/jobs/search
"
,
"
GET
"
,
{
key
});
static
closeJob
=
(
jobId
:
string
)
=>
request
(
"
<BASE_URL>/jobs/close
"
,
"
DELETE
"
,
{
jobId
});
}
src/common/lib/openApi.ts
View file @
a3912188
import
{
Configuration
,
OpenAIApi
}
from
"
openai
"
;
import
{
OPEN_API_KEY
}
from
"
../config
"
;
const
configuration
=
new
Configuration
({
organization
:
"
org-AoUQNrvNFgE7OsNnQWErMvxy
"
,
apiKey
:
OPEN_API_KEY
,
organization
:
"
org-AoUQNrvNFgE7OsNnQWErMvxy
"
,
apiKey
:
OPEN_API_KEY
,
});
const
openai
=
new
OpenAIApi
(
configuration
);
const
openai
=
new
OpenAIApi
(
configuration
);
export
default
class
OpenAPI
{
static
getInterViewQuestions
=
(
subject
:
string
,
level
:
string
)
=>
openai
.
createCompletion
({
model
:
'
text-davinci-003
'
,
prompt
:
`Create a list of
${
level
}
questions with answers for my interview regarding
${
subject
}
`
,
temperature
:
0.5
,
max_tokens
:
150
,
top_p
:
1.0
,
frequency_penalty
:
0.0
,
presence_penalty
:
0.0
})
}
\ No newline at end of file
static
getInterViewQuestions
=
(
subject
:
string
,
level
:
string
)
=>
openai
.
createCompletion
({
model
:
"
text-davinci-003
"
,
prompt
:
`Create a list of
${
level
}
10 questions with answers for my interview regarding
${
subject
}
`
,
temperature
:
0.5
,
max_tokens
:
250
,
top_p
:
1.0
,
frequency_penalty
:
0.0
,
presence_penalty
:
0.0
,
});
}
src/common/saga/common.ts
View file @
a3912188
...
...
@@ -103,8 +103,36 @@ function* updateJob({
}
}
function
*
closeJob
({
payload
,
}:
{
type
:
typeof
ACTIONS
.
CLOSE_JOB
;
payload
:
string
;
})
{
try
{
yield
put
({
type
:
ACTIONS
.
SET_APP_STATE
,
payload
:
{
state
:
APP_STATE
.
LOADING
},
});
yield
call
(
CommonAPI
.
closeJob
,
payload
);
yield
call
(
getJobs
,
{
type
:
ACTIONS
.
GET_JOBS
});
yield
put
({
type
:
ACTIONS
.
SET_APP_STATE
,
payload
:
{
state
:
APP_STATE
.
SUCCESS
},
});
}
catch
(
error
)
{
yield
put
({
type
:
ACTIONS
.
SET_APP_STATE
,
payload
:
{
state
:
APP_STATE
.
FAILED
},
});
}
}
export
default
function
*
authSaga
()
{
yield
takeLeading
(
ACTIONS
.
GET_JOBS
,
getJobs
);
yield
takeLeading
(
ACTIONS
.
CREATE_JOB
,
createJob
);
yield
takeLeading
(
ACTIONS
.
UPDATE_JOB
,
updateJob
);
yield
takeLeading
(
ACTIONS
.
CLOSE_JOB
,
closeJob
);
}
src/components/Application/Analyse.tsx
View file @
a3912188
...
...
@@ -64,7 +64,7 @@ const Analyse = ({
},
[
dispatch
]);
const
getRecording
=
()
=>
{
if
(
application
.
interview
?.
link
)
{
if
(
!
application
.
interview
?.
videoRef
&&
application
.
interview
?.
link
)
{
MeetingsAPI
.
getRecordings
(
application
.
interview
.
link
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
?.[
0
]?.
file
?.
fileUrl
)
{
updateUserApplication
(
res
.
data
?.[
0
]?.
file
?.
fileUrl
);
...
...
src/components/Modals/CreateUpdateJob.tsx
View file @
a3912188
import
React
,
{
useState
,
ChangeEvent
}
from
"
react
"
;
import
{
useDispatch
,
useSelector
}
from
"
react-redux
"
;
import
{
createJob
,
updateJob
}
from
"
../../common/actions/common
"
;
import
{
c
loseJob
,
c
reateJob
,
updateJob
}
from
"
../../common/actions/common
"
;
import
{
getUserId
}
from
"
../../common/lib/util
"
;
import
{
JobType
}
from
"
../../common/types
"
;
import
CustomModal
from
"
./Modal
"
;
...
...
@@ -148,6 +148,10 @@ const CreateUpdateJob = ({
toggleModal
();
};
const
onCloseJob
=
()
=>
{
dispatch
(
closeJob
(
defaultJob
?.
_id
||
""
));
};
const
btnText
=
mode
===
"
create
"
?
"
Create job
"
:
"
Update job
"
;
return
(
...
...
@@ -265,17 +269,28 @@ const CreateUpdateJob = ({
/>
</
div
>
</
div
>
<
div
className=
"d-md-block"
style=
{
{
float
:
"
right
"
}
}
>
<
button
className=
"btn btn-primary m-2"
onClick=
{
onSubmit
}
disabled=
{
isLoading
}
>
{
btnText
}
</
button
>
<
button
className=
"btn btn-danger"
onClick=
{
toggleModal
}
>
Cancel
</
button
>
<
div
className=
"d-md-block"
>
{
mode
!==
"
create
"
&&
(
<
button
className=
"btn btn-secondary m-2"
onClick=
{
onCloseJob
}
disabled=
{
isLoading
}
>
Close Job
</
button
>
)
}
<
div
style=
{
{
float
:
"
right
"
}
}
>
<
button
className=
"btn btn-primary m-2"
onClick=
{
onSubmit
}
disabled=
{
isLoading
}
>
{
btnText
}
</
button
>
<
button
className=
"btn btn-danger"
onClick=
{
toggleModal
}
>
Cancel
</
button
>
</
div
>
</
div
>
</
CustomModal
>
</
div
>
...
...
src/views/Home.view.tsx
View file @
a3912188
...
...
@@ -233,6 +233,8 @@ const Home = () => {
CommonAPI.searchJobs(_searchKey.current).then(({ data }: any) => {
setSelectedJobs(data);
});
} else {
setSelectedJobs(jobs);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment