Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Add a button to trigger a post to the AK worker queue... #1343

Merged
merged 1 commit into from Feb 27, 2019

Conversation

Tuuleh
Copy link
Contributor

@Tuuleh Tuuleh commented Feb 27, 2019

... in order to create AK petition + donation + follow up resources from the page edit view.

@Tuuleh
Copy link
Contributor Author

Tuuleh commented Feb 27, 2019

ezgif com-video-to-gif

If the page has resources, it links to both the resources and reports in the page edit view.
If it doesn't, it shows this button to create the resources, which posts a page create event to the queue. I wanted to do it with API requests initially to make it more robust and to be able to display error messages directly to the user, but I would have needed to duplicate a lot of the code on the worker - doing it like this was much simpler. The button only shows up after the page is five minutes old (or older) - in order to avoid confusion, since the AK worker is still supposed to create the resources automatically.

@vincemtnz
Copy link
Contributor

but I would have needed to duplicate a lot of the code on the worker - doing it like this was much simpler.

I'd say this is good compromise, given that we're adding a much needed feature that has few if any side effects (again, thanks for taking the time!). I can't think of any really concerning technical debt issues with this PR – +1 from me!

@@ -71,4 +88,9 @@
javascript:
$(function () {
window.ee.emit('layout:edit');
$('#ak-resource-button').click(function(){
console.log("CLICK");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugging code!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uuuuups

…tition + donation + follow up resources from the page edit view
@Tuuleh Tuuleh merged commit 0974905 into development Feb 27, 2019
@vincemtnz vincemtnz deleted the ak-resource-buttons branch April 12, 2019 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants