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

Sections #398

Open
wants to merge 46 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
baa79ce
Began work on adding sections (placeholder commit)
Oct 14, 2016
4291680
Set basic styles for sections
Oct 14, 2016
c33383b
Partially working type selection
Oct 20, 2016
ad69458
Fixed a bug in swapping the section-exists flag
Oct 20, 2016
b3e29dc
Set up json building and validation for sections
Oct 20, 2016
9a34dfa
When switching section types, add an empty rule to the group after we…
Oct 20, 2016
248f2d9
Implemented allow_sections and section flags
Oct 24, 2016
989967e
Set allow_sections in the example
Oct 24, 2016
6d249e8
Unless we have a default section id, create the section with no group…
Oct 24, 2016
6e1d3ad
Began work on adding sections (placeholder commit)
Oct 14, 2016
4440b58
Set basic styles for sections
Oct 14, 2016
8094d49
Partially working type selection
Oct 20, 2016
323bfc4
Fixed a bug in swapping the section-exists flag
Oct 20, 2016
f945379
Set up json building and validation for sections
Oct 20, 2016
e7e09df
When switching section types, add an empty rule to the group after we…
Oct 20, 2016
a771cf4
Implemented allow_sections and section flags
Oct 24, 2016
d9959dd
Set allow_sections in the example
Oct 24, 2016
543b87b
Unless we have a default section id, create the section with no group…
Oct 24, 2016
164acbe
Merge branch 'sections' of github.com:rsterbin/jQuery-QueryBuilder in…
Oct 24, 2016
3943f67
Fixed a merge error
Oct 24, 2016
3dfdf29
Fixed linting and style errors
Oct 24, 2016
1a3fa87
You can now set section data from JSON
Oct 26, 2016
ff606d4
Fixed linting/style warnings
Oct 26, 2016
1c16555
More bug fixes for sections
Oct 29, 2016
6df52ff
Invert plugin passes tests and works for sections
Nov 1, 2016
0ac0326
Broke section checking into its own method and added section detail t…
Nov 6, 2016
b7fc580
Fixed a logical error in setRules
Nov 7, 2016
8e6b42e
First pass at sections test suite (only currently passing tests for now)
Nov 7, 2016
d0a8ec6
Rounded out section tests and made allow_sections default to true
Nov 15, 2016
360fece
Removed allow_sections from the example
Nov 15, 2016
eb4f8ea
Sortable plugin now restricts moving rules/groups in and out of sections
Nov 18, 2016
08ba292
Fixed missing error message and tooltip on section
Nov 19, 2016
e4d7bf4
Changing filters now works both in and out of sections
Nov 21, 2016
5afefaf
Unique filters within sections
Nov 23, 2016
ed48873
Added support for sections to the SQL plugin and an error about non-s…
Nov 24, 2016
96b5847
Tests for get-sql sections support
Nov 29, 2016
fa0a2ab
Test for get-mongo sections error
Nov 29, 2016
187bdac
Setting sections from SQL works now; also:
Nov 30, 2016
a2a041e
Fixed linting and style warnings
Nov 30, 2016
8d550fe
Put sections in right include location
Nov 30, 2016
cf5395c
Merge branch 'dev' into sections
Nov 30, 2016
a46736a
Increased test coverage and fixed a bug in the sections part of the u…
Dec 8, 2016
71d8cec
Added a test for inverting on sections and fixed a bug in auto-settin…
Dec 8, 2016
5db5f73
Added testing of default unique filters
Dec 8, 2016
9fe66f5
Added a test for remove filter on a section
Dec 8, 2016
e3966f3
Forgot about section flags
Dec 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
144 changes: 141 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,127 @@ <h3>Output</h3>
//default_filter: 'name',
sort_filters: true,

sections: [
{
id: 'subquery-a',
label: 'Subquery A',
base_sql: 'SELECT a_id FROM section_a WHERE parent_id = 10 AND ',
Copy link
Owner

Choose a reason for hiding this comment

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

not used

Copy link
Author

Choose a reason for hiding this comment

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

Derp, forgot to remove that.

filters: [
{
id: 'sqa_name',
label: {
en: 'Subquery A Name',
fr: 'Nom'
},
type: 'string',
optgroup: 'core',
default_value: 'Subquery Name',
size: 30,
unique: true
},
{
id: 'sqa_category',
label: 'Subquery A Category',
type: 'integer',
input: 'checkbox',
optgroup: 'core',
values: {
1: 'Books',
2: 'Movies',
3: 'Music',
4: 'Tools',
5: 'Goodies',
6: 'Clothes'
},
colors: {
1: 'foo',
2: 'warning',
5: 'success'
},
operators: ['in', 'not_in', 'equal', 'not_equal', 'is_null', 'is_not_null']
}
]
},
{
id: 'subquery-b',
label: 'Subquery B',
filters: [
{
id: 'sqb_name',
label: {
en: 'Subquery B Name',
fr: 'Nom'
},
type: 'string',
optgroup: 'core',
default_value: 'Subquery Name',
size: 30,
unique: true
},
{
id: 'sqb_category',
label: 'Subquery B Category',
type: 'integer',
input: 'checkbox',
optgroup: 'core',
values: {
1: 'Books',
2: 'Movies',
3: 'Music',
4: 'Tools',
5: 'Goodies',
6: 'Clothes'
},
colors: {
1: 'foo',
2: 'warning',
5: 'success'
},
operators: ['in', 'not_in', 'equal', 'not_equal', 'is_null', 'is_not_null']
}
]
},
{
id: 'subquery-c',
label: 'Subquery C',
filters: [
{
id: 'sqc_name',
label: {
en: 'Subquery C Name',
fr: 'Nom'
},
type: 'string',
optgroup: 'core',
default_value: 'Subquery Name',
size: 30,
unique: true
},
{
id: 'sqc_category',
label: 'Subquery C Category',
type: 'integer',
input: 'checkbox',
optgroup: 'core',
values: {
1: 'Books',
2: 'Movies',
3: 'Music',
4: 'Tools',
5: 'Goodies',
6: 'Clothes'
},
colors: {
1: 'foo',
2: 'warning',
5: 'success'
},
operators: ['in', 'not_in', 'equal', 'not_equal', 'is_null', 'is_not_null']
}
]
}
],

optgroups: {
core: {
en: 'Core',
Expand Down Expand Up @@ -446,8 +567,7 @@ <h3>Output</h3>
});

// set rules
$('.set').on('click', function() {
$('#builder').queryBuilder('setRules', {
var json_rules = {
condition: 'AND',
flags: {
condition_readonly: true
Expand All @@ -463,6 +583,21 @@ <h3>Output</h3>
data: {
unit: '€'
}
}, {
section: 'subquery-a',
exists: 'EXISTS',
group: {
condition: 'AND',
rules: [{
id: 'sqa-name',
operator: 'equal',
value: 'Name Within Subquery A'
}, {
id: 'sqa-category',
operator: 'in',
value: [2,3]
}]
}
}, {
id: 'state',
operator: 'equal',
Expand All @@ -489,7 +624,10 @@ <h3>Output</h3>
}, {
empty: true
}]
});
};

$('.set').on('click', function() {
$('#builder').queryBuilder('setRules', json_rules);
});

// set rules from MongoDB
Expand Down