Skip to content

Commit

Permalink
Changes to get landing page data using details instead of small chunk…
Browse files Browse the repository at this point in the history
…s for DNS

and also Addressed below issues

1)use generic api to get data for landing page
2)correct messages in delete popups
3)empty response and error not shown on popup while deleting dns server with
associated ipam
4)use same method for both create and edit in editView
5)separate constants and labels and use them accordingly
6)Remove all window usages
7)Use Feature specific messages instead of generic for No data, error and
loading for landing pages
8)Use separate file for Formatters instead of  having the code in the same
gridView file for DNS server
9)DNS Record creation fails, if we switch dns server from dropdown and try to
create
10) Invalid value for TTL error in DNS while editing both Servers and Records
11)For Record type MX  Landing page shows -  in  grid row and expansion details

Change-Id: I07188e3c13e2b24015b39a8615647300b4561e2c
Related-bug: #1562171
Related-bug: #1560252
Closes-bug: #1563675
Closes-bug: #1563676
  • Loading branch information
sbavanasi committed Mar 30, 2016
1 parent 191a9e8 commit 8b69d35
Show file tree
Hide file tree
Showing 26 changed files with 787 additions and 688 deletions.
17 changes: 16 additions & 1 deletion webroot/common/ui/js/controller.constants.js
Expand Up @@ -691,8 +691,23 @@ define([

// Virtual Network Config Constants
this.URL_CFG_VN_DETAILS = '/api/tenants/config/virtual-network-details';
//Dns constants

/* DNS Server constants */
this.ACTIVE_DNS_DATA = "/api/tenants/config/sandesh/virtual-DNS/";
this.DNS_SERVER_GRID_ID = "dns-server-grid";
this.CONFIG_DNS_SERVER_PAGE_ID = 'config-dns-server-page';
this.CONFIG_DNS_SERVER_SECTION_ID = 'config-dns-server-section';
this.CONFIG_DNS_SERVER_LIST_VIEW_ID = 'config-dns-server-list';
this.CONFIG_DNS_SERVER_ID = 'config-dns-server';
this.DNS_SERVER_PREFIX_ID = 'dns_server';

/* DNS Record constants */
this.CONFIG_DNS_RECORDS_PAGE_ID = 'config-dns-records-page';
this.CONFIG_DNS_RECORDS_LIST_VIEW_ID = 'config-dns-records-list';
this.CONFIG_DNS_RECORDS_SECTION_ID = 'config-dns-records-section';
this.CONFIG_DNS_RECORDS_ID = 'config-dns-records';
this.DNS_RECORDS_GRID_ID = 'dns-records-grid';
this.DNS_RECORDS_PREFIX_ID = 'dns_record';

/* Route Aggregate Constants */
this.CONFIG_ROUTE_AGGREGATE_LIST_ID = "config-route-aggregate-list";
Expand Down
21 changes: 4 additions & 17 deletions webroot/common/ui/js/controller.labels.js
Expand Up @@ -925,32 +925,19 @@ define([
this.TXT_ROUTING_POLICY = 'routing policy';
this.TITLE_REMOVE_GRID = "Remove Routing Policy";

this.CONFIG_DNS_SERVER_PAGE_ID = 'config-dns-server-page';
this.CONFIG_DNS_SERVER_LIST_VIEW_ID = 'config-dns-server-list';
this.CONFIG_DNS_SERVER_SECTION_ID = 'dnsServer';
this.CONFIG_DNS_SERVER_ID = 'config-dns-server';
/* DNS Server labels */
this.TITLE_DNS_SERVER = 'DNS Servers';
this.DNS_SERVER_GRID_ID = 'dns-server-grid';
this.DNS_SERVER_PREFIX_ID = 'DNS_server';
this.TITLE_CREATE_DNS_SERVER = 'Create DNS Server';
this.TITLE_DEL_DNS_SERVER = 'Delete DNS Server';
this.TITLE_DNS_SERVER_MULTI_DELETE = "Delete DNS Server(s)";
this.TITLE_EDIT_DNS_SERVER = 'Edit DNS Server';
this.DNS_SERVER_DETAILS = 'DNS Server Details';


this.CONFIG_DNS_RECORDS_PAGE_ID = 'config-dns-records-page';
this.CONFIG_DNS_RECORDS_LIST_VIEW_ID = 'config-dns-records-list';
this.CONFIG_DNS_RECORDS_SECTION_ID = 'dnsRecords';
this.CONFIG_DNS_RECORDS_ID = 'config-dns-records';
/* DNS Record labels */
this.TITLE_DNS_RECORDS = 'DNS Records';
this.DNS_RECORDS_GRID_ID = 'dns-records-grid';
this.DNS_RECORDS_PREFIX_ID = 'DNS_records';
this.TITLE_CREATE_DNS_RECORD = 'Create DNS Record';
this.TITLE_DEL_DNS_RECORD = 'Delete DNS Record';
this.TITLE_DNS_RECORD_MULTI_DELETE = "Delete DNS Record(s)";
this.TITLE_EDIT_DNS_RECORD = 'Edit DNS Record';
this.DNS_RECORD_DETAILS = 'DNS Record Details';
this.DNS_BREADCRUMB_DROPDOWN = "dns-breadcrumb-dropdown";


//Config DB Labels - Start
this.CDB_FQ_TABLE_NAMES_GRID_ID = "cdb-fq-table-names-grid";
Expand Down
225 changes: 146 additions & 79 deletions webroot/config/dns/records/test/ui/views/dnsRecordsGridView.mock.data.js
Expand Up @@ -25,88 +25,155 @@
"uuid": "e59247c6-280f-47b7-a3f3-994f3108cf93"
}
],
dnsRecordsMockData : {
"data": {
"virtual-DNS": {
"fq_name": [
"default-domain",
"s1"
],
"uuid": "e59247c6-280f-47b7-a3f3-994f3108cf93",
"network_ipam_back_refs": [
{
"to": [
"default-domain",
"default-project",
"default-network-ipam"
],
"href": "http://10.204.216.40:9100/network-ipam/f89712df-bef7-449a-97c8-504811115b17",
"attr": null,
"uuid": "f89712df-bef7-449a-97c8-504811115b17"
}
],
"parent_uuid": "07fbaa4b-c7b8-4f3d-996e-9d8b1830b288",
"parent_href": "http://10.204.216.40:9100/domain/07fbaa4b-c7b8-4f3d-996e-9d8b1830b288",
"parent_type": "domain",
"perms2": {
"owner": "e9a7b1af07c147889169045c5f2caafb",
"owner_access": 7,
"global_access": 0,
"share": []
},
"virtual_DNS_records": [
{
"to": [
"default-domain",
"s1",
"9104933f-c179-44c7-8656-3d0529adb45f"
],
"href": "http://10.204.216.40:9100/virtual-DNS-record/9104933f-c179-44c7-8656-3d0529adb45f",
"uuid": "9104933f-c179-44c7-8656-3d0529adb45f",
"virtual_DNS_record_data": {
"record_type": "A",
"record_ttl_seconds": 86400,
"record_name": "h1",
"record_class": "IN",
"record_data": "1.1.1.1"
dnsRecordsMockData : [
{
"virtual-DNS-records": [
{
"virtual-DNS-record": {
"fq_name": [
"default-domain",
"s2",
"47815646-001f-45f7-9766-ea81d6b1614b"
],
"name": "47815646-001f-45f7-9766-ea81d6b1614b",
"virtual_DNS_record_data": {
"record_type": "A",
"record_ttl_seconds": 86400,
"record_name": "h1",
"record_class": "IN",
"record_data": "1.1.1.1"
},
"parent_uuid": "ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_href": "http://10.204.216.40:9100/virtual-DNS/ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_type": "virtual-DNS",
"perms2": {
"owner": null,
"owner_access": 7,
"global_access": 0,
"share": []
},
"href": "http://10.204.216.40:9100/virtual-DNS-record/47815646-001f-45f7-9766-ea81d6b1614b",
"id_perms": {
"enable": true,
"uuid": {
"uuid_mslong": 5152494307338307000,
"uuid_lslong": 10909664990725235000
},
"created": "2016-03-29T11:44:50.274978",
"description": null,
"creator": null,
"user_visible": true,
"last_modified": "2016-03-29T11:44:50.274978",
"permissions": {
"owner": "cloud-admin",
"owner_access": 7,
"other_access": 7,
"group": "cloud-admin-group",
"group_access": 7
}
},
"display_name": "47815646-001f-45f7-9766-ea81d6b1614b",
"uuid": "47815646-001f-45f7-9766-ea81d6b1614b"
}
},
{
"virtual-DNS-record": {
"fq_name": [
"default-domain",
"s2",
"d156b94f-3428-4ce2-a668-667b67459b69"
],
"name": "d156b94f-3428-4ce2-a668-667b67459b69",
"virtual_DNS_record_data": {
"record_type": "A",
"record_ttl_seconds": 45,
"record_name": "h2",
"record_class": "IN",
"record_data": "2.2.2.2"
},
"parent_uuid": "ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_href": "http://10.204.216.40:9100/virtual-DNS/ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_type": "virtual-DNS",
"perms2": {
"owner": null,
"owner_access": 7,
"global_access": 0,
"share": []
},
"href": "http://10.204.216.40:9100/virtual-DNS-record/d156b94f-3428-4ce2-a668-667b67459b69",
"id_perms": {
"enable": true,
"description": null,
"creator": null,
"created": "2016-03-29T12:18:21.199282",
"user_visible": true,
"last_modified": "2016-03-29T12:18:35.565607",
"permissions": {
"owner": "cloud-admin",
"owner_access": 7,
"other_access": 7,
"group": "cloud-admin-group",
"group_access": 7
},
"uuid": {
"uuid_mslong": 15084447751752667000,
"uuid_lslong": 11990946688073570000
}
}
],
"href": "http://10.204.216.40:9100/virtual-DNS/e59247c6-280f-47b7-a3f3-994f3108cf93",
"virtual_DNS_data": {
"floating_ip_record": "dashed-ip-tenant-name",
"domain_name": "s1.com",
"external_visible": true,
"dynamic_records_from_client": true,
"reverse_resolution": true,
"default_ttl_seconds": 86400,
"record_order": "random"
},
"id_perms": {
"enable": true,
"uuid": {
"uuid_mslong": 16542363297686440000,
"uuid_lslong": 11813954812927070000
},
"created": "2015-11-24T08:45:13.176071",
"description": null,
"creator": null,
"user_visible": true,
"last_modified": "2015-11-24T08:45:13.176071",
"permissions": {
"owner": "admin",
"display_name": "d156b94f-3428-4ce2-a668-667b67459b69",
"uuid": "d156b94f-3428-4ce2-a668-667b67459b69"
}
},
{
"virtual-DNS-record": {
"fq_name": [
"default-domain",
"s2",
"d1bdc0cb-9f96-43d8-b329-c51b8922371b"
],
"name": "d1bdc0cb-9f96-43d8-b329-c51b8922371b",
"virtual_DNS_record_data": {
"record_type": "A",
"record_ttl_seconds": 86400,
"record_name": "h3",
"record_class": "IN",
"record_data": "3.3.3.3"
},
"parent_uuid": "ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_href": "http://10.204.216.40:9100/virtual-DNS/ffa7431e-7206-40ce-9886-76a254cd19ae",
"parent_type": "virtual-DNS",
"perms2": {
"owner": null,
"owner_access": 7,
"other_access": 7,
"group": "KeystoneServiceAdmin",
"group_access": 7
}
},
"display_name": "s1",
"name": "s1"
"global_access": 0,
"share": []
},
"href": "http://10.204.216.40:9100/virtual-DNS-record/d1bdc0cb-9f96-43d8-b329-c51b8922371b",
"id_perms": {
"enable": true,
"uuid": {
"uuid_mslong": 15113447905313570000,
"uuid_lslong": 12910066528889747000
},
"created": "2016-03-29T12:24:21.954924",
"description": null,
"creator": null,
"user_visible": true,
"last_modified": "2016-03-29T12:24:21.954924",
"permissions": {
"owner": "cloud-admin",
"owner_access": 7,
"other_access": 7,
"group": "cloud-admin-group",
"group_access": 7
}
},
"display_name": "d1bdc0cb-9f96-43d8-b329-c51b8922371b",
"uuid": "d1bdc0cb-9f96-43d8-b329-c51b8922371b"
}
}
},
"lastKey": null,
"more": false
}
]
}
]
});
});
Expand Up @@ -28,7 +28,8 @@ define([
body: JSON.stringify(TestMockdata.dnsServerListMockData)
}));
responses.push(cotr.createFakeServerResponse({
url : /\/api\/admin\/config\/get-data\?type=virtual-DNS-record&count=4&fqnUUID=e59247c6-280f-47b7-a3f3-994f3108cf93.*$/,
url : /\/api\/tenants\/config\/get-config-details.*$/,
method: "POST",
body: JSON.stringify(TestMockdata.dnsRecordsMockData)
}));

Expand All @@ -50,7 +51,7 @@ define([
rootView: configDNSRecordsLoader.dnsRecordsView,
tests: [
{
viewId: 'DnsRecordsGrid',
viewId: ctwc.DNS_RECORDS_GRID_ID,
suites: [
{
class: GridViewTestSuite,
Expand Down
3 changes: 2 additions & 1 deletion webroot/config/dns/records/ui/js/dnsRecords.main.js
Expand Up @@ -26,7 +26,8 @@ function ConfigDNSRecordsLoader() {
} else {
self.renderView(renderFn, hashParams);
}
}
};

this.renderView = function(renderFn, hashParams) {
$(contentContainer).html("");
switch (renderFn) {
Expand Down
7 changes: 5 additions & 2 deletions webroot/config/dns/records/ui/js/dnsRecordsFormatter.js
Expand Up @@ -30,6 +30,9 @@ define(['underscore'], function(_) {
case ("NS"):
formattedRecType = recordType + " (Delegation Record)";
break;
case ("MX"):
formattedRecType = recordType + " (Mail Exchanger Record)";
break;
default:
formattedRecType = "-";
}
Expand All @@ -38,10 +41,10 @@ define(['underscore'], function(_) {

};
/*
* @TTLFormatter
* @ttlFormatter
*/

self.TTLFormatter = function(row, col, val, d, rowData) {
self.ttlFormatter = function(row, col, val, d, rowData) {
var TTL = getValueByJsonPath(rowData,
'virtual_DNS_record_data;record_ttl_seconds',
"-");
Expand Down

0 comments on commit 8b69d35

Please sign in to comment.