Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OIG wagtail page template on CMS DB (Launch on 2/23) #4318

Closed
5 tasks done
Tracked by #184
patphongs opened this issue Jan 12, 2021 · 2 comments
Closed
5 tasks done
Tracked by #184

Update OIG wagtail page template on CMS DB (Launch on 2/23) #4318

patphongs opened this issue Jan 12, 2021 · 2 comments
Assignees
Milestone

Comments

@patphongs
Copy link
Member

patphongs commented Jan 12, 2021

Summary

What we're after:
Now that we have a new OIG landing page template, we want to update the existing OIG landing page from a resource template to use the OIG landing page template.

Related issues

Tech steps or considerations

  • Try to locally update the wagtail.core template so that the OIG landing page is updated from a resource page to an OIG landing page template
  • Delete the page from ResourcePage table and insert into OIGLandingPage table using the same ID.
  • Check to see if that will corrupt the OIG landing page in Wagtail
  • If all goes well, wait until we're ready to insert the new OIG data to make the update in production

Completion criteria

  • The OIG landing page in Wagtail is successfully updated from a resource template to an OIG landing page template in production
@johnnyporkchops
Copy link
Contributor

johnnyporkchops commented Jan 13, 2021

This worked locally:

cfdm_cms_test_stat_summ=# BEGIN;
BEGIN
cfdm_cms_test_stat_summ=# DELETE FROM public.home_resourcepage WHERE page_ptr_id='9882';
DELETE 1
cfdm_cms_test_stat_summ=# COMMIT;
COMMIT
cfdm_cms_test_stat_summ=# BEGIN;
BEGIN
cfdm_cms_test_stat_summ=# update public.wagtailcore_page
cfdm_cms_test_stat_summ-# set content_type_id=69
cfdm_cms_test_stat_summ-# where id=9882;
UPDATE 1
cfdm_cms_test_stat_summ=# COMMIT;
COMMIT
cfdm_cms_test_stat_summ=# BEGIN;
BEGIN
cfdm_cms_test_stat_summ=# INSERT INTO public.home_oiglandingpage(page_ptr_id,intro_message,complaint_url,show_info_message,info_message,stats_content,recent_reports_url,resources,you_might_also_like)
cfdm_cms_test_stat_summ-# VALUES
cfdm_cms_test_stat_summ-# (9882,'[]','',False,'[]','[]','','[]','[]');
INSERT 0 1
cfdm_cms_test_stat_summ=# COMMIT;
COMMIT

(Or use the insert statement in next comment below from @kathycarothers Feature space OIG page)

Editing page id 9882

Screen Shot 2021-01-13 at 1 29 56 AM

Preview edits to 9882

(edited complaint_url and intro_message fields)

Screen Shot 2021-01-13 at 1 40 58 AM

@johnnyporkchops
Copy link
Contributor

johnnyporkchops commented Jan 15, 2021

Here is the data from @kathycarothers feature OIG page exported from python shell , json-formatted (and escaped) , and put into SQL insert statement.
CC: @rfultz , @patphongs
(tested locally, works)

INSERT INTO public.home_oiglandingpage(page_ptr_id,intro_message,complaint_url,show_info_message,info_message,stats_content,recent_reports_url,resources,you_might_also_like)
VALUES
(9882,'<p>The FEC OIG is committed to detect and prevent fraud, waste, and abuse, violations of law, and to promote economy, efficiency and effectiveness in the operations of the FEC.</p>','https://fecoig.ains.com/',True,'<p>Due to the evolving situation concerning the coronavirus (COVID-19), the FEC OIG is processing mail on an intermittent basis, and strongly encourages you to file all inquiries and/or complaints through the <a href=\"https://fecoig.ains.com/\">FEC OIG Hotline Portal</a>.</p>','[]','https://www.fec.gov/about/reports-about-fec/oig-reports/',
'[
   {
      "type":"html",
      "value":"<div class=\"grid grid--4-wide\">\r\n        <div class=\"grid__item\">\r\n          <a href=\"/\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-arrow-target\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Office of Inspector General mission\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/enforcement/\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-org-chart\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Core values and organization chart\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/regulations/\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-clipboard-checklist\"><span class=\"u-visually-hidden\">TODO/</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Audits, inspections and special reviews\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/statutes\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-shield\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Investigations\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n      </div>\r\n      <div class=\"grid grid--4-wide\">\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/legislation\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-shield-scales\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Whistleblower protections\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/court-cases\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-decree\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                OIG authority\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/enforcement/audit-reports/\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-exclamation-bubble\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                How to submit a complaint\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n        <div class=\"grid__item\">\r\n          <a href=\"/legal-resources/policy-other-guidance/\">\r\n            <aside class=\"card card--horizontal card--primary\">\r\n              <div class=\"card__image__container\">\r\n                <span class=\"card__icon i-magnifying-glass\"><span class=\"u-visually-hidden\">TODO</span></span>\r\n              </div>\r\n              <div class=\"card__content\">\r\n                Search OIG reports\r\n              </div>\r\n            </aside>\r\n          </a>\r\n        </div>\r\n      </div>",
      "id":"4aebcfdc-f7fe-4672-b3c6-365fe31a70c4"
   }
]',
'[
   {
      "type":"group",
      "value":[
         {
            "text":"All OIG oversight reports",
            "url":"https://www.oversight.gov/"
         },
         {
            "text":"U.S. Equal Employment Opportunity Commission",
            "url":"https://www.eeoc.gov/"
         },
         {
            "text":"Presidential Transition Handbook: the Role of the Inspectors General and the Transition to a New Administration",
            "url":"https://www.fec.gov/resources/cms-content/documents/presidential_transition_handbook.pdf"
         }
      ],
      "id":"c5f90d95-517b-43c9-90bd-f3fe84184809"
   },
   {
      "type":"group",
      "value":[
         {
            "text":"Inspector General Act of 1978",
            "url":"https://www.ignet.gov/sites/default/files/files/igactasof1010(1).pdf"
         },
         {
            "text":"All audit reports",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=audit+report"
         },
         {
            "text":"All inspection or special review reports",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=inspection+or+special+review+report"
         },
         {
            "text":"All management challenges",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=inspection+or+special+review+report"
         }
      ],
      "id":"e9da707a-9786-413e-a3b8-a03f4a9f76d2"
   },
   {
      "type":"group",
      "value":[
         {
            "text":"All outstanding recommendations",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=inspection+or+special+review+report"
         },
         {
            "text":"All semiannual reports to Congress",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=semiannual+report"
         },
         {
            "text":"All strategic plans",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=strategic+plan"
         },
         {
            "text":"All work plans",
            "url":"https://www.fec.gov/about/reports-about-fec/oig-reports/?category=work+plan"
         }
      ],
      "id":"283ea7cd-91bf-48ff-834f-e2dcdfb2868b"
   }
]');

@JonellaCulmer JonellaCulmer changed the title Update OIG wagtail page template on CMS DB Update OIG wagtail page template on CMS DB (Launch on 2/23) Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants