)]}'
{"openstack_dashboard/dashboards/identity/static/dashboard/identity/roles/roles.module.js":[{"author":{"_account_id":14151,"name":"ziyu032","email":"chen.qiaomin@99cloud.net","username":"ziyu032"},"change_message_id":"67244bfa25b9a15c50df5bed002f3e0b6bf4b4c2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"      return keystone.getRoles().then(addTrackBy);"},{"line_number":61,"context_line":"    }"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    function addTrackBy(response) {"},{"line_number":64,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":65,"context_line":"        role.track_by \u003d ["},{"line_number":66,"context_line":"          role.id,"}],"source_content_type":"text/javascript","patch_set":1,"id":"df3967d1_df6119ab","line":63,"range":{"start_line":63,"start_character":3,"end_line":63,"end_character":35},"updated":"2017-08-04 02:14:15.000000000","message":"Above this function, you can add some comments to explain why you add the property ‘track_by’, like this:\n\u0027we need to modify the API\u0027s response by adding a composite value called \u0027track_by\u0027 to assist the display mechanism when updating rows\u0027","commit_id":"d90702085ca8fda189b1986b3ba2350cbb4ea332"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"f2241f956109a59db68b74bb6f5ebae3fa7ef716","unresolved":false,"context_lines":[{"line_number":60,"context_line":"      return keystone.getRoles().then(addTrackBy);"},{"line_number":61,"context_line":"    }"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    function addTrackBy(response) {"},{"line_number":64,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":65,"context_line":"        role.track_by \u003d ["},{"line_number":66,"context_line":"          role.id,"}],"source_content_type":"text/javascript","patch_set":1,"id":"df3967d1_1700a5aa","line":63,"range":{"start_line":63,"start_character":3,"end_line":63,"end_character":35},"in_reply_to":"df3967d1_df6119ab","updated":"2017-08-04 06:35:43.000000000","message":"Done","commit_id":"d90702085ca8fda189b1986b3ba2350cbb4ea332"},{"author":{"_account_id":11885,"name":"Ying Zuo","email":"yingzuo4@gmail.com","username":"yingzuo"},"change_message_id":"ea46530ce5df144ac63592720e316221a17b5af5","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    // \u0027track_by\u0027 to assist the display mechanism when updating rows."},{"line_number":65,"context_line":"    function addTrackBy(response) {"},{"line_number":66,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":67,"context_line":"        role.track_by \u003d ["},{"line_number":68,"context_line":"          role.id,"},{"line_number":69,"context_line":"          role.domain_id,"},{"line_number":70,"context_line":"          role.name"}],"source_content_type":"text/javascript","patch_set":3,"id":"9f436f4f_5fb81729","line":67,"updated":"2017-08-09 03:08:18.000000000","message":"Can you change track_by to trackBy? The naming convention for properties in Javascript is camelcase.","commit_id":"4ce9e88e56730caea0ff6818f28e195fc0a9f287"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"4a0a254c5b7cc8c2571a2201dd0227c9aa810306","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    // \u0027track_by\u0027 to assist the display mechanism when updating rows."},{"line_number":65,"context_line":"    function addTrackBy(response) {"},{"line_number":66,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":67,"context_line":"        role.track_by \u003d ["},{"line_number":68,"context_line":"          role.id,"},{"line_number":69,"context_line":"          role.domain_id,"},{"line_number":70,"context_line":"          role.name"}],"source_content_type":"text/javascript","patch_set":3,"id":"9f436f4f_74b1bd8f","line":67,"in_reply_to":"9f436f4f_5fb81729","updated":"2017-08-09 06:49:51.000000000","message":"Done","commit_id":"4ce9e88e56730caea0ff6818f28e195fc0a9f287"},{"author":{"_account_id":16352,"name":"Shu Muto","email":"shu.mutow@gmail.com","username":"shu.mutow"},"change_message_id":"0f5efda4bcbafd5f7da23184bc5ded2bedae7965","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    // \u0027trackBy\u0027 to assist the display mechanism when updating rows."},{"line_number":65,"context_line":"    function addTrackBy(response) {"},{"line_number":66,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":67,"context_line":"        role.trackBy \u003d ["},{"line_number":68,"context_line":"          role.id,"},{"line_number":69,"context_line":"          role.domain_id,"},{"line_number":70,"context_line":"          role.name"},{"line_number":71,"context_line":"        ].join(\u0027/\u0027);"},{"line_number":72,"context_line":"        return role;"},{"line_number":73,"context_line":"      })}};"},{"line_number":74,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":4,"id":"9f436f4f_1774b334","line":71,"range":{"start_line":67,"start_character":0,"end_line":71,"end_character":20},"updated":"2017-08-09 07:15:54.000000000","message":"AFAIK, if trackBy string is same as before update, table will not be refreshed. See https://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/images/images.service.js#L130 or https://github.com/openstack/zaqar-ui/blob/master/zaqar_ui/static/dashboard/admin/pools/pools.service.js#L53-L57","commit_id":"a58aa26450837bfb84ea3cfbc015a83d8541befd"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"dc69eb4c8c615e0e1e2692756e6937d53ec75bd4","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    // \u0027trackBy\u0027 to assist the display mechanism when updating rows."},{"line_number":65,"context_line":"    function addTrackBy(response) {"},{"line_number":66,"context_line":"      return {data: {items: response.data.items.map(function(role) {"},{"line_number":67,"context_line":"        role.trackBy \u003d ["},{"line_number":68,"context_line":"          role.id,"},{"line_number":69,"context_line":"          role.domain_id,"},{"line_number":70,"context_line":"          role.name"},{"line_number":71,"context_line":"        ].join(\u0027/\u0027);"},{"line_number":72,"context_line":"        return role;"},{"line_number":73,"context_line":"      })}};"},{"line_number":74,"context_line":"    }"}],"source_content_type":"text/javascript","patch_set":4,"id":"9f436f4f_35843d5e","line":71,"range":{"start_line":67,"start_character":0,"end_line":71,"end_character":20},"in_reply_to":"9f436f4f_1774b334","updated":"2017-08-09 19:17:02.000000000","message":"I think that\u0027s right. The trackBy value must change to trigger a refresh. However a role does not have an \u0027updated_at\u0027 attribute, so I had to take a somewhat brute force approach. This composite \u0027trackBy\u0027 includes *all* attributes of a role (except the derivative attribute \u0027links\u0027), therefore if any attribute changes, \u0027trackBy\u0027 changes and the table gets refreshed. See also here:\n\nhttps://developer.openstack.org/api-ref/identity/v3/index.html#show-role-details","commit_id":"a58aa26450837bfb84ea3cfbc015a83d8541befd"}]}
