Skip to content

Commit

Permalink
Changes as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts-ctrlo committed Nov 8, 2023
1 parent d8866c0 commit 3176b5f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ jobs:
# TODO: Delete the line below and uncomment the line beneath that
run: prove -lmrsv webdriver/t/login.t
#run: prove -lmrsv webdriver/t

js_tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion lib/GADS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2894,7 +2894,7 @@ prefix '/:layout_name' => sub {

my $report_id = param('id');

my $result = schema->resultset('Report')->find ({id => $report_id})
my $result = schema->resultset('Report')->find ({id => $report_id})
or error 'No report found for ' . $report_id;

my $lo = param 'layout_name';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/button/lib/create-report-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CreateReportButtonComponent extends Component {
submitReport(ev) {
const $button = $(ev.target).closest('button');
const $form = $button.closest("form");

if (!this.canSubmitRecordForm) {
ev.preventDefault();

Expand Down
10 changes: 5 additions & 5 deletions src/frontend/components/button/lib/create-report-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('create-report-button', () => {
<form id="myform">
<input class="form-control " id="report_name" name="report_name" value="Something" data-restore-value="" required="" aria-required="true">
<input class="form-control " id="report_description" name="report_description" placeholder="New Report Description" value="" data-restore-value="">
<fieldset class="fieldset fieldset--required fieldset--report" id="report_fields">
<fieldset class="fieldset fieldset--required" id="report_fields">
<input id="1" type="checkbox">
<input id="8" type="checkbox">
<input id="2" type="checkbox">
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('create-report-button', () => {
<input required="" aria-required="true">
</div>
<input>
<fieldset class="fieldset fieldset--required fieldset--report" id="report_fields">
<fieldset class="fieldset fieldset--required" id="report_fields">
<input id="1" type="checkbox">
<input id="8" type="checkbox" checked="checked">
<input id="2" type="checkbox">
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('create-report-button', () => {
<input required="" aria-required="true" value = "boop">
</div>
<input>
<fieldset class="fieldset fieldset--required fieldset--report" id="report_fields">
<fieldset class="fieldset fieldset--required" id="report_fields">
<input id="1" type="checkbox">
<input id="8" type="checkbox" checked="checked">
<input id="2" type="checkbox">
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('create-report-button', () => {
it('Validates checkboxes correctly', () => {
document.body.innerHTML = `
<form>
<fieldset class="fieldset fieldset--required fieldset--report">
<fieldset class="fieldset fieldset--required">
<div class="fieldset__legend">
<legend id="-label">
Columns to show in report:
Expand Down Expand Up @@ -172,6 +172,6 @@ describe('create-report-button', () => {
expect(input.checked).toBe(false);
});

expect(validateRequiredFields($('form'))).toBe(false);
expect(validateRequiredFields($('form'))).toBe(false);
});
});
38 changes: 19 additions & 19 deletions views/reports/edit.tt
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@
<div class="hidden alert__no__select" aria-hidden="true">
<p class="alert__message">Please select at least one item to add to the report!</p>
</div>
[%
report_items = [];
[%
report_items = [];

FOREACH field IN fields;
report_items.push({
field_id = field.id,
name = field.name,
id = field.id,
is_checked = field.is_checked ? 1 : 0
});
END;
FOREACH field IN fields;
report_items.push({
field_id = field.id,
name = field.name,
id = field.id,
is_checked = field.is_checked ? 1 : 0
});
END;

INCLUDE fields/checkbox_list.tt
list_class = "list--vertical list--checkboxes"
name = "checkboxes"
label = "Columns to show in report:"
items = report_items
fieldset_required = 1
fieldset_classes = "fieldset--report"
filter = "html";
%]
INCLUDE fields/checkbox_list.tt
list_class = "list--vertical list--checkboxes"
name = "checkboxes"
label = "Columns to show in report:"
items = report_items
fieldset_required = 1
fieldset_classes = ""
filter = "html";
%]
</div>
</div>
</div>
Expand Down
36 changes: 16 additions & 20 deletions views/reports/view.tt
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
[%
table_dom = "t";
table_show_all_records = "true";
table_width = 85;
table_class = "table-striped";

table_caption = "Reports";
table_width = 85;

table_buttons = [
{
label = "Edit",
filter = "html",
link = "report/edit" _ report.id
},{
label = "Delete",
filter = "html",
link = "report/delete" _ report.id
}
]

table_columns = [{
name = "Name",
orderable = 0,
}, {
name = "Actions",
orderable = 0
}, {
orderable = 0
width = table_width _ "%"
}];

table_buttons = [];

rows = [];

FOREACH report IN reports;
Expand All @@ -26,18 +33,7 @@
label = report.name
}]
};
IF user.permission.superadmin;
data.fields.push({
type = "link",
label = "Edit",
link = "report/edit" _ report.id
},{
type = "link",
label = "Delete",
link = "report/delete" _ report.id
});

END; #if

rows.push(data);
END; #foreach
%]
Expand Down
12 changes: 6 additions & 6 deletions views/snippets/header_table_form.tt
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@

FOREACH report IN reports;
links.push({
name = report.name,
name = report.name,
target = url.page _ '/' _ layout.identifier _ '/report/render' _ report.id _ '/' _ record.current_id,
});
END;

record_edit_buttons.push({
type = "button_list",
target = url.page _ '/' _ layout.identifier _ '/report/render' _ report.id _ '/' _ record.current_id,
class = "link link--plain dropdown-toggle",
label = report.name _ " Report",
type = "button_list",
target = url.page _ '/' _ layout.identifier _ '/report/render' _ report.id _ '/' _ record.current_id,
class = "link link--plain dropdown-toggle",
label = report.name _ " Report",
label_in_span = 1,
links = links,
links = links,
});
END;

Expand Down

0 comments on commit 3176b5f

Please sign in to comment.