g1 issueshttps://code.gramener.com/cto/g1/-/issues2018-11-24T09:00:01Zhttps://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/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/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/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/90Mapviewer: Tooltip must react and position itself to collision detections2018-10-14T05:29:21ZTejeshMapviewer: Tooltip must react and position itself to collision detections![image](/uploads/a2cb9296f5a1babba8fc6033b24d5690/image.png)
![image](/uploads/daf5389fedb99de3670314a255bf159d/image.png)![image](/uploads/a2cb9296f5a1babba8fc6033b24d5690/image.png)
![image](/uploads/daf5389fedb99de3670314a255bf159d/image.png)1.44TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/70mapviewer merge data doesnot work with topojson files2018-11-01T03:07:43ZTejeshmapviewer merge data doesnot work with topojson files1.44Bharat Rbharath.r@gramener.comBharat Rbharath.r@gramener.comhttps://code.gramener.com/cto/g1/-/issues/96g1.dropdown url encodes options twice2018-10-04T12:17:02ZTejeshg1.dropdown url encodes options twice1.43TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/95Mapviewer: tooltip must support leaflet tooltip options2018-10-04T12:17:29ZTejeshMapviewer: tooltip must support leaflet tooltip optionsspec
```js
tooltip: 'just some tooltip text test',
tooltipOptions: {
opacity: 0.1,
permanent: true
}
```spec
```js
tooltip: 'just some tooltip text test',
tooltipOptions: {
opacity: 0.1,
permanent: true
}
```1.43TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/93FormHandler table: test cases for enhancements2018-10-04T12:17:44ZS AnandFormHandler table: test cases for enhancementsAdd test cases and documentation for the following features
- [x] Clicking on Add / Edit focuses on the first inpput
- [x] Pressing Enter when editing / adding saves the document
- [x] Custom action receive a `.notify(message)` that the...Add test cases and documentation for the following features
- [x] Clicking on Add / Edit focuses on the first inpput
- [x] Pressing Enter when editing / adding saves the document
- [x] Custom action receive a `.notify(message)` that they can use to send a notification
- [x] Custom actions can return a jQuery deferred (e.g. `return $.ajax(...)`). In that case, it shows a loading indicator, and after the deferred is complete (i.e. `.always()`), the loading indicator is removed1.43TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/86mapviewer: Support custom markers (divIcons)2018-10-04T12:17:18ZAnvesh Dasarimapviewer: Support custom markers (divIcons)### Summary
Integrate text labels on the map
### Benefits
User can see text labels on the map (easy to identify).
### Usage
![image](/uploads/23565d7858a13a554a5f9053a45a4006/image.png)
### Examples
(Add code samples of usage, wit...### Summary
Integrate text labels on the map
### Benefits
User can see text labels on the map (easy to identify).
### Usage
![image](/uploads/23565d7858a13a554a5f9053a45a4006/image.png)
### Examples
(Add code samples of usage, with expected output)
```
var my_icon2 = L.divIcon({
className:'current-location-icon2',
html:'<span class="label_text text-black '+sublayer.feature.properties.Id+'">'+sublayer.feature.properties.BLOCK_NAME+'</span>',
iconAnchor:[0,0],
iconSize:null,
popupAnchor:[0,0]
})
L.marker([sublayer.getCenter().lat, sublayer.getCenter().lng], {radius: 5,
icon : my_icon2, color:'blue',opacity:1,fillColor: 'blue',fillOpacity:.4 ,className : "map_circle2"}).addTo(map)
```
Depends on the layer centroid, added text on the map.
![image](/uploads/4c8f0ea1e04d1aada383536a931435e2/image.png)1.43TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/62FormHandler table code review2018-08-28T08:14:53ZS AnandFormHandler table code review- Code corrections
- [x] Do not use encodeURIComponent to escape selectors. Use quotes instead. Remove quotes if they exist in the name
- [x] Do we need to check for `if (dirty_td.length > 0) {`
- [x] `options.edit.editFunction()` ...- Code corrections
- [x] Do not use encodeURIComponent to escape selectors. Use quotes instead. Remove quotes if they exist in the name
- [x] Do we need to check for `if (dirty_td.length > 0) {`
- [x] `options.edit.editFunction()` should probably be `options.edit.editFunction` -- and should probably be `edit.function`. Also call editFunction on `.done()` if it is defined. Not via `complete:`. Always use promises
- [x] `if (options[name] == 'grid') name = 'table_grid'` is duplicated
- [x] Rename `compile_template()` to `render_template()` and document it
- Documentation
- [x] Add row needs documentation
- [x] Actions are poorly explained
- [x] Add example of how to use icon function
- Usability
- [ ] If the server responds with a Bad Request, show the actual error message
- [x] When using keyboard navigation, changed inputs are not detected as dirty
- [x] Loading indicator is not visible
- [ ] Simulate server / network failure and test. If data is lost, user should be aware
- [x] After adding a row and saving, the row should remain where it was added (i.e. at the top of the table)
- [x] All functions must accept a single object with these names (unless it's impossible.)
- `data`: the dataset from `src`
- `row`: row data - dict of {name: value}
- `index`: row index
- `name`: column name
- `value`: cell data value
- `link`: cell link value
- `format`: formatted cell display value
- [x] How can a developer add a delete button simply?
- Feature enhancements
- [x] Icon URLs are static. They must be based on the row data -- as a string template or function1.40TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/59[Mapviewer] Feature request - After the zoom text should be visible2018-08-13T09:19:08ZAnvesh Dasari[Mapviewer] Feature request - After the zoom text should be visible![image](/uploads/d521bfe1d616ed18beaadc0467354ae2/image.png)
When we do the zoom on the map text should be visible.![image](/uploads/d521bfe1d616ed18beaadc0467354ae2/image.png)
When we do the zoom on the map text should be visible.1.40TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/54[Mapviewer] Feature request - Filter regions based on click events2018-08-13T09:22:53ZAnvesh Dasari[Mapviewer] Feature request - Filter regions based on click eventsUttar Pradesh map
![uttar-pradesh](/uploads/006272c52a62c3d8e6ce533bde1bf55c/uttar-pradesh.PNG)
On clicking a region, highlight the clicked region
![uttar-pradesh-filtered](/uploads/78389e3367a7ada13055df1ffd2f87bb/uttar-pradesh-filte...Uttar Pradesh map
![uttar-pradesh](/uploads/006272c52a62c3d8e6ce533bde1bf55c/uttar-pradesh.PNG)
On clicking a region, highlight the clicked region
![uttar-pradesh-filtered](/uploads/78389e3367a7ada13055df1ffd2f87bb/uttar-pradesh-filtered.PNG)1.40TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/66g1.datafilter() doesnot filter values with `number` types2018-06-30T10:23:24ZTejeshg1.datafilter() doesnot filter values with `number` typesurl args has `?col=35` . Currently, the filtering is done on `"35"`
Possible Fixes:
needs to be typecasted based on `col` type (identified by g1.types)url args has `?col=35` . Currently, the filtering is done on `"35"`
Possible Fixes:
needs to be typecasted based on `col` type (identified by g1.types)1.38TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/21urlfilter should handle forms, inputs, sliders2018-07-02T03:23:59ZS Anandurlfilter should handle forms, inputs, sliders1.38TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/17Allow $().formhandler() to use data from g1.datafilter2018-06-30T11:16:58ZS AnandAllow $().formhandler() to use data from g1.datafilterThis will allow paginated sortable filterable displays of in-memory / pre-loaded data using the same interfaceThis will allow paginated sortable filterable displays of in-memory / pre-loaded data using the same interface1.38TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/52Unable to edit g1 FormHandler2018-06-01T13:49:44ZHari deepuUnable to edit g1 FormHandler### Summary
Values edited in FormHandler table aren't updated in database.
### Steps to Reproduce
- Edit a value in FormHandler Table
- Save the updated values, it works fine
- Reload the page, old values are displayed
gramex.yaml en...### Summary
Values edited in FormHandler table aren't updated in database.
### Steps to Reproduce
- Edit a value in FormHandler Table
- Save the updated values, it works fine
- Reload the page, old values are displayed
gramex.yaml end point:
```yaml
pmrssm-form-available-state-info:
pattern: /$YAMLURL/table_available_states_info
handler: FormHandler
kwargs:
url: 'mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST/pmrssm_forms_db'
query: select * from available_states_info;# DB Query
table: available_states_info
id: [state_code, district_code, mobile_number]
```
javascript
```javascript
<script>
$(window).on('load', function () {
$('.formhandler').formhandler({
columns:[{name: '*'},{editable: true}],
edit: true,
table: true
})
});
</script>
```
1.37TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/48Drill down feature in MapViewer2018-06-07T03:40:13ZSundeep Reddy MalluDrill down feature in MapViewer### Summary
Ability to show more granularity maps on clicking on geojson layers.
### Usage
```js
drilldown: {
rootLayer: 'indiaGeojson',
drilldown_levels: ['STATE_N', 'DISTRICT', 'VILL'],
nextLayer: fun...### Summary
Ability to show more granularity maps on clicking on geojson layers.
### Usage
```js
drilldown: {
rootLayer: 'indiaGeojson',
drilldown_levels: ['STATE_N', 'DISTRICT', 'VILL'],
nextLayer: function(name) {
return {
layerName: name + '_layer',
layerOptions: {
url: name + '.geojson',
type: 'geojson',
attrs: {
fillColor: {
metric: 'TOT_P',
range: 'RdYlGn'
}
}
}
}
}
}
```
### Examples
(Add code samples of usage, with expected output)1.37TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/41Merge basic mapviewer2018-05-29T03:01:33ZS AnandMerge basic mapviewer- [x] circleMarker zooms to bounds. marker should do the same
- [x] Tooltip titles for marker and circleMarker to be implemented
- [x] Use g1.scale
- [ ] `attr: {color: 'red'}` should be moved to `options: {color: 'red'}`
- [x] Rename `a...- [x] circleMarker zooms to bounds. marker should do the same
- [x] Tooltip titles for marker and circleMarker to be implemented
- [x] Use g1.scale
- [ ] `attr: {color: 'red'}` should be moved to `options: {color: 'red'}`
- [x] Rename `attr:` to `attrs:`
- [x] Add tooltips to show one or more columns1.36TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/35Editable Formhandler Table2018-05-24T16:16:25ZTejeshEditable Formhandler Table### Summary
Each cell in formhandler table must be editable.
TBD: Conditional editable/view only fields for each cell
### Benefits
Immediate use case is in Admin Module### Summary
Each cell in formhandler table must be editable.
TBD: Conditional editable/view only fields for each cell
### Benefits
Immediate use case is in Admin Module1.35TejeshTejesh