g1 issueshttps://code.gramener.com/cto/g1/-/issues2018-11-27T03:51:26Zhttps://code.gramener.com/cto/g1/-/issues/116Allow loading multiple pages via AJAX2018-11-27T03:51:26ZS AnandAllow loading multiple pages via AJAX### Summary
Create a `$.ajaxchain()` that allows chaining AJAX requests flexibly
### Benefits
- Lets you load FormHandler pages successively with a single call
- Loads multiple pages of data from APIs (e.g. YouTube, Twitter, etc) easily### Summary
Create a `$.ajaxchain()` that allows chaining AJAX requests flexibly
### Benefits
- Lets you load FormHandler pages successively with a single call
- Loads multiple pages of data from APIs (e.g. YouTube, Twitter, etc) easily1.46S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/115g1 template should support list creation2018-11-24T09:00:01ZS Anandg1 template should support list creation### Summary
`$().template()` replaces the target DOM element. Allow it to append to the target DOM element.
### Benefits
This helps in creating lists that can be extended. For example:
- Repeated AJAX loads append data to the target ...### Summary
`$().template()` replaces the target DOM element. Allow it to append to the target DOM element.
### Benefits
This helps in creating lists that can be extended. For example:
- Repeated AJAX loads append data to the target node
- Successive notifications can be appended to the target node
### Usage
`$().template({}, {append: true})` should enable this behavior.1.46S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/114Support for latitude, longitude points as input2018-11-22T06:42:55ZBhanu Kbhanu.kamapantula@gramener.comSupport for latitude, longitude points as inputusers should be able to use `Lat-Long` points instead of `GeoJSON` or `TopoJSON` as input
Ref: leaflet supports a [`latLngToCoords`](https://leafletjs.com/reference-1.3.4.html#geojson-latlngtocoords) methodusers should be able to use `Lat-Long` points instead of `GeoJSON` or `TopoJSON` as input
Ref: leaflet supports a [`latLngToCoords`](https://leafletjs.com/reference-1.3.4.html#geojson-latlngtocoords) methodhttps://code.gramener.com/cto/g1/-/issues/113Multi-column support2018-12-14T05:16:55ZBhanu Kbhanu.kamapantula@gramener.comMulti-column supportTejesh: alter table to create new columns if the data source is `FormHandler` endpoint else add to `JSON` objectTejesh: alter table to create new columns if the data source is `FormHandler` endpoint else add to `JSON` objectTejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/112Highlight/Log name mismatches for data and map files2019-01-14T11:28:09ZBhanu Kbhanu.kamapantula@gramener.comHighlight/Log name mismatches for data and map files### Summary
Highlighting mismatches in data and map files. In the below map, the name mismatches (J&K and Telangana) are silently ignored and not notified for the user
![map_screenshot__4_.svg](/uploads/de47ae8bef948e9b65ef7eab7facb21b...### Summary
Highlighting mismatches in data and map files. In the below map, the name mismatches (J&K and Telangana) are silently ignored and not notified for the user
![map_screenshot__4_.svg](/uploads/de47ae8bef948e9b65ef7eab7facb21b/map_screenshot__4_.svg)Bharat Rbharath.r@gramener.comBharat Rbharath.r@gramener.comhttps://code.gramener.com/cto/g1/-/issues/111remove dev dependencies from package.json2018-12-08T00:58:30ZTejeshremove dev dependencies from package.jsonjust a reminder!just a reminder!1.47TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/110edit mode for formhandler table for data: option (non-gramex endpoints)2019-02-07T10:43:22ZTejeshedit mode for formhandler table for data: option (non-gramex endpoints)TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/109formhandler table copy/pasteFromClipboard feature2018-11-14T11:37:46ZTejeshformhandler table copy/pasteFromClipboard featureTejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/108Mapviewer - drilldown and tooltip bugfixes2019-01-16T04:23:13ZTejeshMapviewer - drilldown and tooltip bugfixesTejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/107Trigger simple hashchange events2018-11-16T14:40:57ZS AnandTrigger simple hashchange events### Summary
When the URL hash changes, trigger a `#?key` event on the window.
### Benefits
This makes it easier for developers to write URL-driven applications.
To change state, just add `<a href="#?key=val" class="urlfilter" data-ta...### Summary
When the URL hash changes, trigger a `#?key` event on the window.
### Benefits
This makes it easier for developers to write URL-driven applications.
To change state, just add `<a href="#?key=val" class="urlfilter" data-target="#">`
To respond to state, don't use `$('a').on('click')`. Instead, use `$(window).on('#?key')`.
### Usage
For example, if the URL changes from `/page` to `/page#?state=Goa`, you can listen to `$(window).on('#?state', function(state) { ... })` will be triggered with `Goa` as the `state`.
It will also trigger `$(window).on('#?', function(url) { ... })` where `url` is a g1 parsed URL.
To enable this, just run `$(window).urlchange(options)`.
Instead of `window`, we can run this on iframes and any other urlfilter target too.1.46S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/106G1 Translate2019-01-23T11:09:13ZTejeshG1 Translatehttps://paper.dropbox.com/doc/Translation-in-Gramex-9xaf4qruopZHQthjfOU5ghttps://paper.dropbox.com/doc/Translation-in-Gramex-9xaf4qruopZHQthjfOU5g1.50Som Shubham SahooSom Shubham Sahoohttps://code.gramener.com/cto/g1/-/issues/105G1 UrlFilter interactive documentation2019-02-15T07:30:21ZTejeshG1 UrlFilter interactive documentationTejesh to merge work done by @jaiprakash.siyyadri
@sundeep.mallu could you please suggest priority on releasing this part of 1.45?
cc: @s.anandTejesh to merge work done by @jaiprakash.siyyadri
@sundeep.mallu could you please suggest priority on releasing this part of 1.45?
cc: @s.anand1.51S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/104g1.formhandler Editable table must render appropriate UI elements for corresp...2018-11-14T11:33:32ZTejeshg1.formhandler Editable table must render appropriate UI elements for corresponding data TypeUsecase:
* [x] dropdown in FormHandler table for use in the admin page. This will allow developers to specify a pre-defined list of roles users can pick from.
Will start with dropdown support and extend for
* [x] DatePicker
* [x] ...Usecase:
* [x] dropdown in FormHandler table for use in the admin page. This will allow developers to specify a pre-defined list of roles users can pick from.
Will start with dropdown support and extend for
* [x] DatePicker
* [x] restricted number type input element (Min, Max, etc)1.45TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/103g1 dropdown `data` to support object also (in addition to array)2019-01-30T06:53:37ZTejeshg1 dropdown `data` to support object also (in addition to array)spec
```js
[
{
attr: val_1_1,
attr2: val_1_2
},
{
attr: val_2_1,
attr2: val_2_2
},
{
attr: val_3_1,
attr2: val_3_2
},
{
attr: val_4_1,
attr2: val_4_2
},
..
..
]
<script>
$('.contai...spec
```js
[
{
attr: val_1_1,
attr2: val_1_2
},
{
attr: val_2_1,
attr2: val_2_2
},
{
attr: val_3_1,
attr2: val_3_2
},
{
attr: val_4_1,
attr2: val_4_2
},
..
..
]
<script>
$('.container3').dropdown(
{ key: 'colors',
data: [
{
value: 0,
label: 'Hyderabad'
},
{
value: 1,
label: 'Delhi'
},
{
value: 2,
label: 'Mumbai'
},
{
value: 3,
label: 'Chennai'
}
],
target: '#'
})
</script>
```
![image](/uploads/2b92dcd2f3582ad8f98a9cfc4ea903f2/image.png)Pragnya Reddypragnya.reddy@gramener.comPragnya Reddypragnya.reddy@gramener.comhttps://code.gramener.com/cto/g1/-/issues/102Mapviewer: add test case for multiple map legends2018-10-30T06:04:11ZS AnandMapviewer: add test case for multiple map legendsWhen creating multiple maps, ensure that:
- options of one map legend do not bleed into another
- removing a map does not remove other map legendsWhen creating multiple maps, ensure that:
- options of one map legend do not bleed into another
- removing a map does not remove other map legends1.44TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/101Mapviewer: choropleth must support option of refetching and merging datasets2018-10-05T18:24:51ZTejeshMapviewer: choropleth must support option of refetching and merging datasetsUsecase: When geojson files is same but external dataset changes, developer wants to Refresh colors of map only (without rebuilding the whole vector layer)
raised by @bharath.r as part of ceasefire projectUsecase: When geojson files is same but external dataset changes, developer wants to Refresh colors of map only (without rebuilding the whole vector layer)
raised by @bharath.r as part of ceasefire projectTejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/100Utilities request2018-10-10T14:06:05ZBhanu Kbhanu.kamapantula@gramener.comUtilities requestFormatting, methods and string operations
# String formatting
JavaScript natively doesn't support camel case conversion and handwriting format conversion
`example: MatErNal MortalIty Rate` should be
## Camel case
`Maternal Mortality...Formatting, methods and string operations
# String formatting
JavaScript natively doesn't support camel case conversion and handwriting format conversion
`example: MatErNal MortalIty Rate` should be
## Camel case
`Maternal Mortality Rate`. We use a custom implementation for this:
```javascript
function toCamelCase(str) {
var final_str = str.replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
})
return final_str
}
```
## Handwriting format
`Maternal mortality rate`
This is a common utility in multiple BMGF projects (Gender, NHRR, UP TSU). I'm assuming other projects might be using this as well.
```javascript
function slug(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\\-]+/g, '') // Remove all non-word chars
.replace(/\\-\\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
```
# Slugify
Slufiy is useful to remove any special characters from a phrase. `Jammu & Kashmir` becomes `jammu_kashmir`, `Andaman and nicobar islands` becomes `andaman_and_nicobar_islands`
credit: with comments from @karmanya.aggarwal @naveen.manukonda
https://code.gramener.com/cto/g1/-/issues/99$.dropdown, multiple:true causes url to be incompatible with FormHandler filters2018-10-22T04:38:54ZKarmanya Aggarwal$.dropdown, multiple:true causes url to be incompatible with FormHandler filtersBootstrap-select and $.dropdown return a comma seperated string of multiple values -
currently urlfilter/$.dropdown appends this string as is to the url as opposed to splitting it into key=value pairs that FormHandler expects.Bootstrap-select and $.dropdown return a comma seperated string of multiple values -
currently urlfilter/$.dropdown appends this string as is to the url as opposed to splitting it into key=value pairs that FormHandler expects.https://code.gramener.com/cto/g1/-/issues/98formhandler error handling broken2018-10-14T04:43:26ZPratap Vardhanpratap.vardhan@gramener.comformhandler error handling broken### Summary
If there are errors in querying, formhandler doesn't handle the error. Looks like a regression bug from 0.9.0
### Steps to reproduce
Setup with g1 0.9.1
```html
<div class="formhandler" data-src="nonexisting-url"></div>
<...### Summary
If there are errors in querying, formhandler doesn't handle the error. Looks like a regression bug from 0.9.0
### Steps to reproduce
Setup with g1 0.9.1
```html
<div class="formhandler" data-src="nonexisting-url"></div>
<!-- libraries -->
<script>
$('.formhandler').formhandler()
</script>
```
### What is the current *bug* behavior?
Formhandler doesn't make any changes to dom. This probably happens for any error handling, on fresh/reloading the page/component.
### What is the expected *correct* behavior?
It should render error template into `.note`, BUT, `.note` is not present in the dom.
### Possible fixes
No-so cleaner way.
- If you don't want to render other components.
- Check if `el = $('.note', $this)` -- `el.length` exists else use `el = $this` for `el.html(message)`
--TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/97package leaflet.css as part of mapviewer.js2018-11-14T11:34:58ZTejeshpackage leaflet.css as part of mapviewer.js6 out of 7 developers who I know has worked with mapviewer wasted decent chunk of time in debugging partially working maps because `<link src="leaflet.css">` file is not added to index.html6 out of 7 developers who I know has worked with mapviewer wasted decent chunk of time in debugging partially working maps because `<link src="leaflet.css">` file is not added to index.htmlTejeshTejesh