-
Notifications
You must be signed in to change notification settings - Fork 855
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ATLAS-4686 : UI improvements to support Atlas Relationship Search
Signed-off-by: Pinal Shah <[email protected]> (cherry picked from commit cb0bde4)
- Loading branch information
1 parent
2818699
commit 88b2815
Showing
67 changed files
with
4,730 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,10 @@ | |
font-weight: bold; | ||
} | ||
} | ||
|
||
.relationship-detailpage-panel { | ||
width: 58% !important; | ||
} | ||
} | ||
|
||
pre { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
dashboardv2/public/js/collection/VRelationshipSearchList.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
define(['require', | ||
'collection/BaseCollection', | ||
'models/VRelationshipSearch', | ||
'utils/UrlLinks' | ||
], function(require, BaseCollection, VRelationshipSearch, UrlLinks) { | ||
'use strict'; | ||
var VRelationshipSearchList = BaseCollection.extend( | ||
//Prototypal attributes | ||
{ | ||
url: UrlLinks.baseURL, | ||
|
||
model: VRelationshipSearch, | ||
|
||
initialize: function() { | ||
this.modelName = 'VRelationshipSearch'; | ||
this.modelAttrName = 'results'; | ||
}, | ||
getRelationship: function(id, options) { | ||
var url = UrlLinks.relationshipApiUrl(id); | ||
|
||
options = _.extend({ | ||
contentType: 'application/json', | ||
dataType: 'json' | ||
}, options); | ||
|
||
return this.constructor.nonCrudOperation.call(this, url, 'GET', options); | ||
} | ||
}, | ||
//Static Class Members | ||
{ | ||
/** | ||
* Table Cols to be passed to Backgrid | ||
* UI has to use this as base and extend this. | ||
* | ||
*/ | ||
tableCols: {} | ||
} | ||
); | ||
return VRelationshipSearchList; | ||
}); |
87 changes: 87 additions & 0 deletions
87
dashboardv2/public/js/collection/VRelationshipSearchResultList.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
define(['require', | ||
'collection/BaseCollection', | ||
'models/VRelationSearch', | ||
'utils/UrlLinks' | ||
], function(require, BaseCollection, VRelationSearch, UrlLinks) { | ||
'use strict'; | ||
var VRelationshipSearchResultList = BaseCollection.extend( | ||
//Prototypal attributes | ||
{ | ||
url: UrlLinks.relationshipSearchApiUrl(), | ||
|
||
model: VRelationSearch, | ||
|
||
initialize: function(options) { | ||
_.extend(this, options); | ||
this.modelName = 'VRelationshipSearchResultList'; | ||
this.modelAttrName = ''; | ||
this.dynamicTable = false; | ||
}, | ||
parseRecords: function(resp, options) { | ||
this.queryType = resp.queryType; | ||
this.queryText = resp.queryText; | ||
this.referredEntities = resp.referredEntities; | ||
if (resp.attributes) { | ||
this.dynamicTable = true; | ||
var entities = []; | ||
_.each(resp.attributes.values, function(obj) { | ||
var temp = {}; | ||
_.each(obj, function(val, index) { | ||
var key = resp.attributes.name[index]; | ||
if (key == "__guid") { | ||
key = "guid" | ||
} | ||
temp[key] = val; | ||
}); | ||
entities.push(temp); | ||
}); | ||
return entities; | ||
} else if (resp.entities) { | ||
this.dynamicTable = false; | ||
return resp.entities ? resp.entities : []; | ||
} else { | ||
return []; | ||
} | ||
}, | ||
getBasicRearchResult: function(options) { | ||
var url = UrlLinks.relationshipSearchApiUrl('basic'); | ||
|
||
options = _.extend({ | ||
contentType: 'application/json', | ||
dataType: 'json', | ||
}, options); | ||
options.data = JSON.stringify(options.data); | ||
|
||
return this.constructor.nonCrudOperation.call(this, url, 'POST', options); | ||
} | ||
}, | ||
//Static Class Members | ||
{ | ||
/** | ||
* Table Cols to be passed to Backgrid | ||
* UI has to use this as base and extend this. | ||
* | ||
*/ | ||
tableCols: {} | ||
} | ||
); | ||
return VRelationshipSearchResultList; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
define(['require', | ||
'models/BaseModel', | ||
'utils/UrlLinks' | ||
], function(require, VBaseModel, UrlLinks) { | ||
'use strict'; | ||
var VRelationSearch = VBaseModel.extend({ | ||
urlRoot: UrlLinks.relationshipSearchApiUrl(), | ||
|
||
defaults: {}, | ||
|
||
serverSchema: {}, | ||
|
||
idAttribute: 'id', | ||
|
||
initialize: function() { | ||
this.modelName = 'VRelationSearch'; | ||
}, | ||
toString: function() { | ||
return this.get('name'); | ||
}, | ||
/************************* | ||
* Non - CRUD operations | ||
*************************/ | ||
getEntity: function(id, options) { | ||
var url = UrlLinks.relationApiUrl({ guid: id }); | ||
|
||
options = _.extend({ | ||
contentType: 'application/json', | ||
dataType: 'json' | ||
}, options); | ||
|
||
return this.constructor.nonCrudOperation.call(this, url, 'GET', options); | ||
} | ||
}, {}); | ||
return VRelationSearch; | ||
}); |
Oops, something went wrong.