Data source list: Use Card component (#31326)

* Replace DataSourcesListItem with Card

* Add tests

* Remove unused styles

* Make card heading semi bold

* Make heading semi-bold

* Show type name instead of type id

* Fix key warning

* Update Card

* Fix tests

* Make typeName optional

* remove styling that was just a test

* Make typeName non-optional and fix tests

* Update list key

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
Alex Khomenko
2021-02-22 14:02:10 +02:00
committed by GitHub
co-authored by Torkel Ödegaard
parent 6e549bc95d
commit 6db4b40d5b
26 changed files with 90 additions and 272 deletions
+2
View File
@@ -36,6 +36,7 @@ func (hs *HTTPServer) GetDataSources(c *models.ReqContext) response.Response {
Name: ds.Name,
Url: ds.Url,
Type: ds.Type,
TypeName: ds.Type,
Access: ds.Access,
Password: ds.Password,
Database: ds.Database,
@@ -48,6 +49,7 @@ func (hs *HTTPServer) GetDataSources(c *models.ReqContext) response.Response {
if plugin, exists := plugins.DataSources[ds.Type]; exists {
dsItem.TypeLogoUrl = plugin.Info.Logos.Small
dsItem.TypeName = plugin.Name
} else {
dsItem.TypeLogoUrl = "public/img/icn-datasource.svg"
}
+1
View File
@@ -36,6 +36,7 @@ type DataSourceListItemDTO struct {
OrgId int64 `json:"orgId"`
Name string `json:"name"`
Type string `json:"type"`
TypeName string `json:"typeName"`
TypeLogoUrl string `json:"typeLogoUrl"`
Access models.DsAccess `json:"access"`
Url string `json:"url"`