This webcomponent follows the open-wc recommendation.
Include this webcomponent to display Fuqua Volunteer Corps job postings.
This branch is an unauthenticated version of the application. If you use cookies for authentication purposes, the endpoints will pass those cookies along the request so you can authenticate the requests outside of the scope of the front end. As the front end will not know who the user is, you will want to configure two different URLs-- one for viewing and one for administration.
There is an authenticated version of the application available on a branch called "authenticated". It uses another component called fw-auth which is used to verify authentication and pull profile data about the user. In this version one-end point is used for both users and administrators.
LIVE DEMO
User view: https://go.fuqua.duke.edu/apps/fvcdemo/index.html Admin view: https://go.fuqua.duke.edu/apps/fvcdemo/admin.html
Module attributes: role - "admin" or "user", defaults to "user"
Installation
npm i @fuquaschoolofbusiness/fw-jobs
Usage
<script type="module">
import '@fuquaschoolofbusiness/fw-jobs/dist/fw-jobs.js';
</script>
<fw-jobs></fw-jobs>
Screen Shot
BACK END
There are 5 functional end points the components calls:
Get the application configuration data: GET https://go.fuqua.duke.edu/fuqua_link/rest/jobs/demo/configuration
Get the list of jobs: GET https://go.fuqua.duke.edu/fuqua_link/rest/jobs/demo/postings
Save the application configuration data: POST https://go.fuqua.duke.edu/fuqua_link/rest/jobs/demo/configuration
Save/create a job posting: POST https://go.fuqua.duke.edu/fuqua_link/rest/jobs/demo/postings
Delete a job posting: DELETE https://go.fuqua.duke.edu/fuqua_link/rest/jobs/demo/postings
There may be constraints on these demo services that prevent you from saving or deleting job postings. You will need to replace these endpoints to make this service work for you. Do NOT try to use these endpoints for your own purposes. There is no guarantee they will be available.
There is a sample Java web services servlet (JobPostings.java) in the server folder that mirrors our implementation that uses a CloudantDB server.
DATA
In the server folder, you can see what the raw data looks like for a couple of the services. The configuration.json is the application configuration details which you must initialize in your database since there is no method in the application to produce this-- and it has critical data that is expected by the application (the list of fields for example). There is also a jobs.json file which shows you what is pulled from the database when calling all the job listings. The jobs are each stored as separated entities, but they are aggregated by the service before being sent down. There is no endpoint to call for an individual job listing.
DEPLOYMENT
If you make no changes, you should be able to deploy this application with the anonymous data demo endpoints anywhere you like following these steps:
-
build the component -> 1) npm install, 2) npm run build (you only need to do the npm install the first time)
-
create a web-accessible folder/url and create an empty index.html file.
-
copy the froala folder from the project into this folder and the css folder.
-
copy the dist folder from the project into this folder as well.
-
edit the index.html as follows:
If you want to allow compatibility with older browsers and browsers that do not fully support ES6, use the pollyfills to pull in the script by replacing the module script tag with: