g1 issueshttps://code.gramener.com/cto/g1/-/issues2019-03-01T04:00:22Zhttps://code.gramener.com/cto/g1/-/issues/42formhandler table cell link is not urlencoded2019-03-01T04:00:22ZTejeshformhandler table cell link is not urlencoded### Summary
formhandler table cell link is not urlencoded
### Steps to reproduce
g1 version 0.6.0
visit https://uat.gramener.com/fdd/#?SEGMENT=M%26M and click on Segment column value `M&M`. Filtering fails because `&` in `M&M` is not...### Summary
formhandler table cell link is not urlencoded
### Steps to reproduce
g1 version 0.6.0
visit https://uat.gramener.com/fdd/#?SEGMENT=M%26M and click on Segment column value `M&M`. Filtering fails because `&` in `M&M` is not urlencoded
### Possible fixes
Need to add a test case and verify the issue. Expected behavior of current code is urlencoded string but that's not the case.1.51S AnandS Anandhttps://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/77formhandler: Add .disable class to .count2022-11-07T09:16:05ZPratap Vardhanpratap.vardhan@gramener.comformhandler: Add .disable class to .countBy default total row `.count` adds a `span.btn` with `cursor: pointer`. Adding `.disable` class removes it.
There is no click behavior needed for that I suppose?By default total row `.count` adds a `span.btn` with `cursor: pointer`. Adding `.disable` class removes it.
There is no click behavior needed for that I suppose?S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/83Equals not working in column dropdown in FormHandler table2019-02-27T06:09:46ZNaveen ManukondaEquals not working in column dropdown in FormHandler table- When we search with equals in first page it is working good.
- When we click on second page equals as we had only one search result again we need to click on first page for getting the result. If we have only one search result can we r...- When we search with equals in first page it is working good.
- When we click on second page equals as we had only one search result again we need to click on first page for getting the result. If we have only one search result can we redirect to 1 page in the table.
- Can we clear the filters without updating the URL?
- Please refer to below gif.![formhabdler_table](/uploads/7ae8c6e09d5ba35a3e0918a04e47f17e/formhabdler_table.gif)1.51TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/84Page refresh on selecting number of rows in FormHandler table2022-11-07T09:16:11ZNaveen ManukondaPage refresh on selecting number of rows in FormHandler table- When we select from new value from row dropdown page is completely refreshing.![image](/uploads/833eca55cc0ec8c1f333fab34cad79d1/image.png)
- Currently if we make size false we are showing all rows without pagination. We want to show p...- When we select from new value from row dropdown page is completely refreshing.![image](/uploads/833eca55cc0ec8c1f333fab34cad79d1/image.png)
- Currently if we make size false we are showing all rows without pagination. We want to show pagination with minimum size of 10 and hide rows dropdown.S AnandS Anandhttps://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/118Mapviewer's buildlayer doesn't support tooltip2019-01-14T11:28:09ZBhanu Kbhanu.kamapantula@gramener.comMapviewer's buildlayer doesn't support tooltip### Summary
tooltip enabled and applied via `buildLayer` doesn't apply
### Steps to reproduce
- use `g1.mapviewer` and create a map via `buildLayer` -- `map.buildLayer('layername', layer_opts)` where map is a `g1.mapviewer()` object a...### Summary
tooltip enabled and applied via `buildLayer` doesn't apply
### Steps to reproduce
- use `g1.mapviewer` and create a map via `buildLayer` -- `map.buildLayer('layername', layer_opts)` where map is a `g1.mapviewer()` object and `layer_opts` are layer options
- one of the attributes in `layer_opts` is `tooltip: function(d) { return d.value; }`
### What is the current *bug* behavior?
Tooltip doesn't show up
### Possible fixes
In [`src/mapviewer.js`](https://code.gramener.com/cto/g1/blob/dev/src/mapviewer.js#L237), do the below:
```javascript
case 'topojson':
case 'geojson':
if() {
...
self.renderTooltip(layerName, layerConfig)
...
} else {
...
self.renderTooltip(layerName, layerConfig)
...
}
```
with this a developer can define
```javascript
tooltip: function(d) {
// console.log(d)
return d[_map_data['metric']] !== undefined ? d[_map_data['metric']].toString() : d[_map_data['metric']];
},
tooltipOptions: {
direction: function (args) {
return args.centerPoint[1] > args.tooltipPoint.x[1] ? 'top' : 'bottom'
},
sticky: true
},
```
note that `tooltipOptions` is optionalBhanu Kbhanu.kamapantula@gramener.comBhanu Kbhanu.kamapantula@gramener.comhttps://code.gramener.com/cto/g1/-/issues/131FormHandler add does not show dropdowns while FormHandler edit does2019-01-25T08:13:24ZS AnandFormHandler add does not show dropdowns while FormHandler edit doesRaised by @sindhura.ch
When using a select for specific columns (see code below):
```yaml
columns: [
{ name: '*' },
{
name: 'user_designation',
editable: {
input: 'select',
...Raised by @sindhura.ch
When using a select for specific columns (see code below):
```yaml
columns: [
{ name: '*' },
{
name: 'user_designation',
editable: {
input: 'select',
options: ['ACMO', 'CDO']
}
},
{ name: 'user_password', hide: true },
{ name: 'actions', template: $('#action-template').html() }
]
```
... the dropdown is visible when we click **Edit** but not when we click **Add**. See screenshots below.
![image](/uploads/b7a550001240a215be070f84c5692499/image.png)
![image](/uploads/794eb9caf9244ff28351c9617fa2c8e0/image.png)TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/139g1.types doesn't detect dates2019-01-24T16:51:32ZPratap Vardhanpratap.vardhan@gramener.comg1.types doesn't detect datesAs per [g1.types docs](https://code.gramener.com/cto/g1/blob/master/docs/types.md#g1types), column `d` should have been `date` but it detected as `string`. Would like to detect below as `date`.
```javascript
var data = [
{a: 1, b: 1.1...As per [g1.types docs](https://code.gramener.com/cto/g1/blob/master/docs/types.md#g1types), column `d` should have been `date` but it detected as `string`. Would like to detect below as `date`.
```javascript
var data = [
{a: 1, b: 1.1, c: 'c', d: '2014-04-04', e: true},
{a: 2, b: 2},
]
g1.types(data)
{a: "number", b: "number", c: "string", d: "string", e: "boolean"}
```
Although, this works with `options = {convert: true}`
```jaavscript
g1.types(data, {convert: true})
{a: "number", b: "number", c: "string", d: "date", e: "boolean"}
```
If this is intended, please update the documentation? S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/140g1.formhandler should clear all filters2019-02-07T03:59:35ZPratap Vardhanpratap.vardhan@gramener.comg1.formhandler should clear all filtersWhen the multiple `?a=1&a=2` query parameters with same keys are passed, `Clear All` filters doesn't remove all filters.When the multiple `?a=1&a=2` query parameters with same keys are passed, `Clear All` filters doesn't remove all filters.1.51TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/144Mapviewer automated tests fail on selenium2019-02-04T07:41:20ZS AnandMapviewer automated tests fail on selenium### Summary
### Steps to reproduce
Run `npm run test-chrome` and `npm run test-firefox` after [installing the relevant webdrivers](https://www.seleniumhq.org/download/).
### What is the current *bug* behavior?
Chrome fails. Some of...### Summary
### Steps to reproduce
Run `npm run test-chrome` and `npm run test-firefox` after [installing the relevant webdrivers](https://www.seleniumhq.org/download/).
### What is the current *bug* behavior?
Chrome fails. Some of the errors are:
```
⨯ ok
not ok 569 test/test-mapviewer-data-mismatch.html
⨯ g1.mapviewer test if popup is added to the marker
not ok 603 should be truthy
not ok 604 should be truthy
not ok 605 should be truthy
not ok 606 should be truthy
not ok 607 should be truthy
...
```
Firefox fails. Some of the errors are:
```
⨯ ok
not ok 317 test/test-formhandler-editable.html
⨯ ok
not ok 569 test/test-mapviewer-data-mismatch.html
⨯ $().template() with type=text/vdom animates nodes
not ok 678 x < 95 # This is because Firefox does not support SVG animation via CSS
```TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/153$.dropdown() not working2019-03-12T06:19:37ZParashar Sangle$.dropdown() not working### Summary
(Summarize the bug encountered concisely)
### Steps to reproduce
$('#usr_names').dropdown({
data: ['lol','rofll']
})
### What is the current *bug* behavior?
Dropdown with no urlfilter in selectpicker
<select clas...### Summary
(Summarize the bug encountered concisely)
### Steps to reproduce
$('#usr_names').dropdown({
data: ['lol','rofll']
})
### What is the current *bug* behavior?
Dropdown with no urlfilter in selectpicker
<select class="selectpicker border " id=""> <option value="lol">lol</option> <option value="rofll">rofll</option> </select>
### What is the expected *correct* behavior?
(What you should see instead)
### Possible fixes
(If you can, link to the line of code thay might be responsible for the problem. Or suggest where you think the problem might be.)https://code.gramener.com/cto/g1/-/issues/170Async sub-templates fail sometimes2019-06-04T04:23:11ZS AnandAsync sub-templates fail sometimes@tejesh.p please see https://code.gramener.com/cto/g1/-/jobs/115982
The test case related to "$().template() loaded static async sub templates" fails -- though it passes sometimes (on the server).
Maybe because we're checking before th...@tejesh.p please see https://code.gramener.com/cto/g1/-/jobs/115982
The test case related to "$().template() loaded static async sub templates" fails -- though it passes sometimes (on the server).
Maybe because we're checking before the sub-template has loaded? Could you please explore the test case?TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/176add a new row with empty data for g1.formhandler2019-12-05T11:15:48ZPratap Vardhanpratap.vardhan@gramener.comadd a new row with empty data for g1.formhandler### Summary
We can't add a new row with empty data for g1.formhandler
### Steps to reproduce
- Create a csv with columns alone and hook it up with formhandler### Summary
We can't add a new row with empty data for g1.formhandler
### Steps to reproduce
- Create a csv with columns alone and hook it up with formhandler