-
Notifications
You must be signed in to change notification settings - Fork 11
Top level apis #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top level apis #499
Conversation
Codecov Report
@@ Coverage Diff @@
## main #499 +/- ##
==========================================
- Coverage 85.69% 85.54% -0.15%
==========================================
Files 751 754 +3
Lines 15417 15479 +62
Branches 1834 1836 +2
==========================================
+ Hits 13212 13242 +30
- Misses 2174 2206 +32
Partials 31 31
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
| public searchPlaceholder?: string = 'Search...'; | ||
|
|
||
| @Input() | ||
| public selectMap?: Map<string, SelectFilter>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should be the key and the value? The property name could be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am cleaning up this code. Agreed its too confusing. Update incoming.
| <!-- Selects --> | ||
| <ht-select | ||
| *ngFor="let selectFilter of this.selectMap | keyvalue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*ngFor="let selectFilter of this.selectMap | keyvalue"
can we call this selectFilterEntry as the current name conflicts with the value type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why is this a map? What does key represent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand, each map entry represents a separate select dropdown? Do we need support for multiple (considering we don't for any other control type)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. In the case of multiple select boxes (we currently have a use case for three of them on the same table), the key is how the user knows which filter changes. It is passed back to the user.
projects/components/src/table/controls/table-controls.component.ts
Outdated
Show resolved
Hide resolved
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Outdated
Show resolved
Hide resolved
...s/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-select-filter.model.ts
Show resolved
Hide resolved
...ability/src/shared/dashboard/data/graphql/specifiers/secondary-entity-specification.model.ts
Outdated
Show resolved
Hide resolved
...ared/graphql/request/builders/specification/entity/secondary-entity-specification-builder.ts
Outdated
Show resolved
Hide resolved
| <!-- Selects --> | ||
| <ht-select | ||
| *ngFor="let selectFilter of this.selectMap | keyvalue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand, each map entry represents a separate select dropdown? Do we need support for multiple (considering we don't for any other control type)?
|
|
||
| public getData(): Observable<PrimitiveValue[]> { | ||
| return this.api | ||
| .getData<Dictionary<PrimitiveValue>[]>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this model supposed to represent? where is it getting data from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting the data to populate the dropdown filter. We query for the Entities, then pull out the values by attribute. frontend and backend as shown in the screenshots.
This is the code that is related to your questions here about using SERVICE instead of API. It shows why we can't index into a SERVICE entity returned by api.getData() when we are working with API entities and attributes in this model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed one tweak in another comment, but alternately, do we even need a fetch? Could we use the fetched data to populate this and just pass the data to the filter model to transform into a filters? That's basically what we're doing with the existing table filters right? The downside would be the same, that our filter options are only based on the queried data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaah, right. Agree they should be consistent. Fixed mine to just provide an array of attributes instead of the full Entity. Much better.
As for the single fetch, I think that the independent fetch is still a better route. I don't really like the way I did the header filters where we tie it to the table data. It couple everything too closely. Granted, if you are filtering on a table, the data between the filer and the table should match so technically they are coupled.
But by having them independently fetched we have more freedom to fetch results that might not be fetched by the table due to pagination or other filters (maybe debatable if that second part is good or bad). It also allows us to have filters for columns we don't even fetch/show.
I think I'd like to go with what we have now (along with your other suggestions).
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Outdated
Show resolved
Hide resolved
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Outdated
Show resolved
Hide resolved
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Outdated
Show resolved
Hide resolved
projects/observability/src/pages/apis/services/services-list.dashboard.ts
Show resolved
Hide resolved
projects/observability/src/pages/apis/services/services-list.dashboard.ts
Outdated
Show resolved
Hide resolved
...ability/src/shared/dashboard/data/graphql/specifiers/secondary-entity-specification.model.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
...s/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-select-filter.model.ts
Outdated
Show resolved
Hide resolved
...y/src/shared/dashboard/data/graphql/entity/attribute/entities-attribute-data-source-model.ts
Outdated
Show resolved
Hide resolved
|
|
||
| public getData(): Observable<PrimitiveValue[]> { | ||
| return this.api | ||
| .getData<Dictionary<PrimitiveValue>[]>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed one tweak in another comment, but alternately, do we even need a fetch? Could we use the fetched data to populate this and just pass the data to the filter model to transform into a filters? That's basically what we're doing with the existing table filters right? The downside would be the same, that our filter options are only based on the queried data.
...y/src/shared/dashboard/data/graphql/entity/attribute/entities-attribute-data-source-model.ts
Show resolved
Hide resolved
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
projects/observability/src/pages/apis/services/services-list.dashboard.ts
Outdated
Show resolved
Hide resolved
projects/observability/src/pages/apis/services/services-list.dashboard.ts
Outdated
Show resolved
Hide resolved
.../observability/src/shared/dashboard/data/graphql/entity/entities-values-data-source.model.ts
Outdated
Show resolved
Hide resolved
...ts/distributed-tracing/src/shared/dashboard/widgets/table/table-widget-renderer.component.ts
Outdated
Show resolved
Hide resolved
| ></ht-search-box> | ||
| <!-- Selects --> | ||
| <ht-select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the select dropdown be a multi select dropdown? For example: Show me all the APIs which lies in Service A or Service B or Service C
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually good feedback. I think multi select makes sense. That said, let me get the single select version out and demoed. I'll make the switch to IN filtering once everyone is onboard with the new changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually good feedback
What are you saying?!
This comment has been minimized.
This comment has been minimized.
| const changedSelectFilter = selectFilterModel.getTableFilter(changed.value.value); | ||
|
|
||
| const selectFilters = [...existingSelectFiltersWithChangedRemoved, changedSelectFilter].filter( | ||
| f => f.value !== undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the undefined filtering mean we can't switch back to unfiltered (isn't undefined the "All Services" option) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. The select option returning a value of undefined signals to the widget to drop that filter, so we remove it from the request all together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused - I would expect to not use that filter in the request, but it should still remain in the dropdown list if I want to return to see all apis across services. The behavior I read/you describe sounds like it is removed from the selection list once an option is chosen, never to return.
Description
We want to remove the nested Service -> APIs list and just use a flat list. This PR makes that change.
It also:
display: Entitycolumn in the table that links to the service