HubSpot / recruiting-agency-graphql-theme

A theme based off of the HubSpot CMS Boilerplate. This theme includes modules and templates that demonstrate how to utilize GraphQL as part of a website built with HubSpot CMS and Custom CRM Objects.
https://boilerplate.hubspotcms.com/recruiting-agency/role-listing
Other
32 stars 8 forks source link

Add fake data for modules in the editor #42

Closed williamspiro closed 3 years ago

williamspiro commented 3 years ago

To make the editor for the dynamic detail page lok better, should we consider something like this so some sample data shows up?

{% if request.query_dict.role_identifier %}
  {% set role = module.data_query.data.CRM.p_role %}

  {% set dateint = role.desired_start_date||int %}
  {% set date = datetimeformat(role.dateint, '%B %e, %Y') %}

  {% set company = role.associations.company_collection__role_to_company.items|first %}

  <h1>Role Details</h1>
  <p>Company: {{company.name}}</p>
  <p>Title: {{role.title}}</p>
  <p>Location: {{role.location}}</p>
  <p>Start Date: {{date}}</p>
  <p>Salary Range: ${{role.salary_min}}-${{role.salary_max}}</p>
  {% if role.category %}
    <p>Department: {{role.department}}</p>
  {% endif %}
  <p>Status: {{role.status}}</p>
  <p>{{role.description}}</p>

  <h1>Apply now!</h1>
  {% form
    form_to_use="{{ module.job_application_form.form_id }}"
    response_response_type="{{ module.job_application_form.response_type }}"
    response_message="{{ module.job_application_form.message }}"
    response_redirect_id="{{ module.job_application_form.redirect_id }}"
    response_redirect_url="{{module.job_application_form.redirect_url}}"
  %}
{% else if request.domain == 'preview.hs-sites.com' %}
  {% set role = {
    "department": "sales",
    "description": "<p>As part of the HubSpot suite, we have new and emerging products like CMS Hub and Operations Hub which this Sales Specialist role will be focused on. Our goal is to grow these new businesses globally at an accelerated pace. We are coming off of an explosive year of 100%+ growth and are looking for sales-minded, tech-savvy team members to help us take the CMS and Operations product growth to the next level.</p><h2>Your Role at HubSpot</h2><p>As a Sales Specialist, you will work with our direct & channel sales reps to grow our existing CMS/Operations Hub business. The expectation around your role will be to add value to the sales experience (presale & account model) by helping businesses understand the value of our emerging product lines.</p><p>The sales reps you’ll align with will expect you to be a subject matter expert on our CMS and Operations Hub products & the complexity within as well as the breadth of the competitive market & how HubSpot solves customer/prospect issues.</p><p>We win as a team, so your compensation will be based on a team target for 2021.</p><h2>Responsibilities of a Sales Specialist:</h2><ul><li>Collaborate with sales & channel reps.</li><li>Run product exploration & demonstration calls with prospects.</li><li>Close both new business and install base at or above a predefined number on a monthly cadence.</li><li>Sell through internal champions to multiple stakeholders.</li><li>Work collaboratively with HubSpot's marketing and technology departments to evolve our sales strategy when new features and products are introduced.</li><li>Always be learning about our CMS/Operations products as it evolves & the market around us.</li><li>Explore outside of the the product space. The competitive ecosystem is always evolving and customers are hyper-aware of trends in web, content, SEO, iPaaS, BI, and business automation. Successful specialists can confidently speak on these topics.</li><li>Be beta-tolerant. Our platform is always evolving, so being tolerant of software changes is important as you go to market.</li><li>Always be learning. HubSpot provides a lot of top-tier learning opportunities & we expect you to constantly seek evolution in your skill.</li><li>Liaise with internal HubSpot stakeholders such as Legal, Finance, Sales Engineering and Security to solve for the more complex contract requirements of our Corporate customers.</li></ul><h2>Role requirements:</h2><ul><li>Experience working in a complex selling environment at some capacity.</li><li>Comfortable presenting to drive a business change.</li><li>Goal orientated with a track record of overachieving on targets/KPIs.</li><li>Experience selling a CMS/iPaaS/BI/Automation tool or similar product/service in SaaS.</li><li>Knowledge of the CMS/iPaaS market conditions, competitors, etc.</li></ul><h2>Who exceeds in this role? Top performers will demonstrate:</h2><ul><li>An understanding of how businesses grow, and confidence advising decision makers on growth strategies.</li><li>Genuine curiosity about business and web technology.</li><li>A growth mindset and a habit of seeking feedback for self development.</li><li>An ability to collaborate cross-functionally to achieve success.</li></ul>",
    "desired_start_date": 1640044800000,
    "fulfillment_status": "open",
    "location": "Remote",
    "salary_max": 100000,
    "salary_min": 75000,
    "status": "full-time",
    "title": "Sample Job Posting"
  } %}
  <h1>Role Details</h1>
  <p>Company: {{company.name}}</p>
  <p>Title: {{role.title}}</p>
  <p>Location: {{role.location}}</p>
  <p>Start Date: {{date}}</p>
  <p>Salary Range: ${{role.salary_min}}-${{role.salary_max}}</p>
  {% if role.category %}
    <p>Department: {{role.department}}</p>
  {% endif %}
  <p>Status: {{role.status}}</p>
  <p>{{role.description}}</p>
{% else %}
    <h1>No role identifier found.</h1>
{% endif %}

@Stefanie899 @jasonnrosa

jasonnrosa commented 3 years ago

I think this makes sense. I think we'll likely want to make sure it is clear that it would be sample data and similar to the blog editor the example content shouldn't show on the live page so we might need to use something like {% if is_in_editor %}.

jasonnrosa commented 3 years ago

Checklist for where this is needed:

jasonnrosa commented 3 years ago

This should be wrapped up. Did this for all modules with the exception of role listing and featured roles which should render fine in the editor. For application details, application listing, and role details I added some fake data for the editor that should just plug into the same variables that the actual data is pulling into. Looks something along the lines of

if you're not in the editor -> use actual data -> else -> use fake data and this way the actual HTML portion only needs to be added once below where we are adding in the real and fake data. I'll likely try to clean this up a tad but should be in a good starting point for all of the modules.