Skip to content

Commit 78410a3

Browse files
authored
bump version 0.11.3 (#344)
* bump version 0.11.3 * underscore * add last updates * ffi * erblint * fix modal * button to a * changelog * method * displayblock * add an organization memoizer for helpers * ensure request exits * memoize in request * Fix cell spec --------- Co-authored-by: Ivan Vergés <Ivan Vergés>
1 parent 39c9401 commit 78410a3

File tree

13 files changed

+42
-40
lines changed

13 files changed

+42
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
CHANGELOG
22
=========
33

4-
Current
4+
v0.11.3
55
-------
66
Compatibility:
77
- Decidim v0.28.x
88

99
Features:
1010
- Added user time zones in account settings
11+
- Added custom styles for the admin panel
12+
- Added Verification tweaks
13+
- Added Admin manual verifications
1114

1215
v0.11.2
1316
-------

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
decidim-decidim_awesome (0.11.2)
4+
decidim-decidim_awesome (0.11.3)
55
decidim-admin (>= 0.28.0, < 0.29)
66
decidim-core (>= 0.28.0, < 0.29)
77
deface (>= 1.5)

app/controllers/decidim/decidim_awesome/admin/admin_authorizations_controller.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Admin
66
class AdminAuthorizationsController < DecidimAwesome::Admin::ApplicationController
77
include NeedsAwesomeConfig
88

9-
layout false
9+
layout "layouts/decidim/decidim_awesome/admin/admin_authorizations"
1010
helper_method :user, :authorization, :workflow, :handler, :conflict
1111
# overwrite original rescue_from to ensure we print messages from ajax methods
1212
rescue_from Decidim::ActionForbidden, with: :json_error
@@ -23,16 +23,16 @@ def update
2323
if conflict
2424
message = render_to_string("conflict")
2525
else
26-
message = render_to_string(partial: "callout", locals: { i18n_key: "user_authorized", klass: "success" })
26+
message = render_to_string("callout", locals: { i18n_key: "user_authorized", klass: "success" })
2727
Decidim::Verifications::AuthorizeUser.call(handler, current_organization) do
2828
on(:transferred) do |transfer|
29-
message += render_to_string(partial: "callout", locals: { i18n_key: "authorization_transferred", klass: "success" }) if transfer.records.any?
29+
message += render_to_string("callout", locals: { i18n_key: "authorization_transferred", klass: "success" }) if transfer.records.any?
3030
end
3131
on(:invalid) do
3232
if force_verification.present?
3333
create_forced_authorization
3434
else
35-
message = render_to_string(partial: "callout", locals: { i18n_key: "user_not_authorized", klass: "alert" })
35+
message = render_to_string("callout", locals: { i18n_key: "user_not_authorized", klass: "alert" })
3636
message += render_to_string("edit", locals: { with_override: true })
3737
end
3838
end
@@ -52,9 +52,9 @@ def update
5252

5353
def destroy
5454
message = if destroy_authorization
55-
render_to_string(partial: "callout", locals: { i18n_key: "authorization_destroyed", klass: "success" })
55+
render_to_string("callout", locals: { i18n_key: "authorization_destroyed", klass: "success" })
5656
else
57-
render_to_string(partial: "callout", locals: { i18n_key: "authorization_not_destroyed", klass: "alert" })
57+
render_to_string("callout", locals: { i18n_key: "authorization_not_destroyed", klass: "alert" })
5858
end
5959

6060
render json: {
@@ -80,7 +80,7 @@ def destroy_authorization
8080
end
8181

8282
def json_error(exception)
83-
render json: render_to_string(partial: "callout", locals: { message: exception.message, klass: "alert" }), status: :unprocessable_entity
83+
render plain: render_to_string("callout", locals: { message: exception.message, klass: "alert" }), status: :unprocessable_entity
8484
end
8585

8686
def user

app/packs/src/decidim/decidim_awesome/admin/verifications.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ document.addEventListener("DOMContentLoaded", () => {
33
if (!dialog) {
44
return;
55
}
6-
const title = dialog.querySelector("[data-dialog-title]");
7-
const content = dialog.querySelector("[data-dialog-content]");
8-
6+
const container = dialog.querySelector("[data-dialog-container]");
7+
98
dialog.addEventListener("open.dialog", async (el) => {
109
const modal = window.Decidim.currentDialogs[el.target.id];
1110
const button = modal.openingTrigger;
1211
const url = button.dataset.verificationUrl;
13-
const user = button.dataset.verificationUser;
14-
title.innerText = title.innerText.replace("{{user}}", user);
15-
content.innerHTML = '<br><br><span class="loading-spinner"></span>';
16-
// console.log("open.dialog", el, "content", content, "button", button, "url", url);
12+
container.innerHTML = '<br><br><span class="loading-spinner"></span>';
13+
// console.log("open.dialog", el, "container", container, "button", button, "url", url);
1714
fetch(url).then((res) => res.text()).then((html) => {
18-
content.innerHTML = html;
15+
container.innerHTML = html;
1916
});
2017
});
2118

@@ -24,17 +21,16 @@ document.addEventListener("DOMContentLoaded", () => {
2421
const response = JSON.parse(responseText.detail[0].response)
2522
const button = document.querySelector(`[data-verification-handler="${response.handler}"][data-verification-user-id="${response.userId}"]`);
2623
// console.log("ajax:complete", responseText, "response", response, "button", button);
27-
content.innerHTML = response.message;
24+
container.innerHTML = response.message;
2825

2926
if (response.granted) {
3027
button.classList.add("granted");
3128
} else {
3229
button.classList.remove("granted");
33-
const forceVerificationCheck = content.querySelector("#force_verification_check");
34-
const forceVerification = content.querySelector("#force_verification");
30+
const forceVerificationCheck = container.querySelector("#force_verification_check");
31+
const forceVerification = container.querySelector("#force_verification");
3532

3633
if (forceVerificationCheck) {
37-
console.log(forceVerificationCheck);
3834
forceVerificationCheck.addEventListener("change", function() {
3935
forceVerification.disabled = !forceVerification.disabled;
4036
if (forceVerificationCheck.checked) {

app/packs/stylesheets/decidim/decidim_awesome/admin/verifications.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
&-td:not(:first-child) {
77
@apply text-left;
88

9-
button {
9+
a {
10+
@apply text-sm font-normal block;
11+
1012
&:hover {
1113
@apply text-secondary underline;
1214
}

app/views/decidim/decidim_awesome/admin/officializations/_participants_td.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
data[:dialog_open] = "awesome-verification-modal"
1616
end
1717
%>
18-
<%= content_tag(auth[:managed] ? "button" : "div", class: classes, data:) do %>
18+
<%= content_tag(auth[:managed] ? "a" : "div", href: "#", class: classes, data:) do %>
1919
<%= icon "check-line", class: "checked" %>
2020
<%= icon "time-line", class: "undeterminated" %>
2121
<%= icon "close-line", class: "unchecked" %>

app/views/decidim/decidim_awesome/admin/officializations/_verification_modal.html.erb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<%= decidim_modal id: "awesome-verification-modal", class:"reveal awesome_participants-modal" do %>
22
<div data-dialog-container>
3-
<%= icon "lock-line" %>
4-
<h3 tabindex="-1" data-dialog-title>
5-
<%= t(".authorizations_for", user: "{{user}}") %>
6-
</h3>
7-
<div data-dialog-content>
8-
</div>
93
</div>
104
<div data-dialog-actions>
115
<button data-dialog-close="awesome-verification-modal" class="button button__lg button__transparent-secondary">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<%= icon "lock-line" %>
2+
<h3 tabindex="-1" data-dialog-title>
3+
<%= t("decidim.decidim_awesome.admin.officializations.verification_modal.authorizations_for", user: user.name) %>
4+
</h3>
5+
<div data-dialog-content>
6+
<%= yield %>
7+
</div>

lib/decidim/decidim_awesome/admin_engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class AdminEngine < ::Rails::Engine
6565
end
6666
# submenus
6767
Decidim::DecidimAwesome::Menu.register_custom_fields_submenu!
68-
Decidim::DecidimAwesome::Menu.register_custom__styles_submenu!
68+
Decidim::DecidimAwesome::Menu.register_custom_styles_submenu!
6969
Decidim::DecidimAwesome::Menu.register_menu_hacks_submenu!
7070
Decidim::DecidimAwesome::Menu.register_maintenance_admin_menu!
7171
Decidim::DecidimAwesome::Menu.register_awesome_admin_menu!

0 commit comments

Comments
 (0)