Automattic / Automattic/WP-Job-Manager

Add Job Data block for showing metadata about a job listing

Open
#1,373 2 comments 1 reaction 0 assignees View on GitHub
[Pri] Normal [Status] Accepted Enhancement
Dominant language
PHP
Stars
899
Forks
369
Avg merge
11h 37m
Merged PRs (30d)
12

Description

The _Job Data_ meta box should be converted to a block.

## Job Data Block

Block in its unselected, empty state:
![screen shot 2018-03-07 at 7 24 59 am](https://user-images.githubusercontent.com/1190420/37092158-b2a00776-21d8-11e8-82c6-69820cb1c4e9.jpg)
Once selected, additional block settings become visible in the inspector area:

![screen shot 2018-03-07 at 7 42 21 am](https://user-images.githubusercontent.com/1190420/37092794-205b113c-21db-11e8-99f2-3af99dec36d1.jpg)

With the job data filled out and the settings configured, the block would look like this at smaller resolutions:
![screen shot 2018-03-12 at 8 45 37 am](https://user-images.githubusercontent.com/1190420/37284406-d01ab966-25d1-11e8-86de-95fb764366bb.jpg)
At larger resolutions, the location and posting date move up to be beside the job type(s):
![screen shot 2018-03-12 at 8 46 18 am](https://user-images.githubusercontent.com/1190420/37284428-e0abbfc8-25d1-11e8-8b1e-8740f0ca91a3.jpg)

### Company Website
There is no separate field for adding a company website. For an existing job listing that has a value for company website, the company name field renders as a link that goes to the company site when clicked. For a new job listing, the user can simply link the company name to their site.

### Company Video
For an existing job listing that contains a company video, the video should appear below the rest of the metadata:
![screen shot 2018-03-12 at 8 52 16 am](https://user-images.githubusercontent.com/1190420/37284643-b45b3984-25d2-11e8-8b78-e410b18c4315.jpg)

For a new job listing, or for an existing job listing that does not have a company video, no video placeholder is shown. If the user wishes to add a video, they can use Gutenberg's core video block.

## Additional Requirements
When Gutenberg is enabled:
- All text fields need to be able to save formatted text as per the toolbar options (i.e. **bold**, _italic_, ~~strikethrough~~ and [links](url)).
- Selecting a job type from the sidebar automatically updates the editor to show that type.
- The timestamp is a dynamic value and only appears once the job listing has been saved.
- When the block is in an _unselected_ state and there is a value entered for the company Twitter account, the field renders as a link, where the URL is `https://twitter.com/`.
- The _Job Data_ block is added to the editor automatically for a job listing, and it appears as the first item in the editor (i.e. it should appear before any existing post content).
- It should be possible to move the block to another location in the editor.
- _Job Types_ and _Job Categories_ appear in the _Document_ settings of the sidebar.
- The _Job Data_ meta box is removed.
- The _Job Data_ block should only be available for the _Job Listings_ custom post type.
- It should not be possible to add more than one _Job Data_ block to a _Job Listings_ custom post type.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing Job Data meta box and the Job Listings custom post type, then review how Gutenberg blocks and Document settings are integrated. Compare the current metadata, editor insertion behavior, and custom post type restrictions with the requirements; done means the block replaces the meta box and satisfies the listed display, editing, placement, and uniqueness behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, content, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.