Skip to content

Instantly share code, notes, and snippets.

@WenInCode
WenInCode / services-endpoints.md
Last active May 19, 2023 19:45
Catalogue of service endpoints and usages

I've made an effort to document what API endpoints we are using where and for what. The example responses here are just mock data, so I would also recommend referencing the documentation which I will link to and the endpoints themselves. Originally I was going to go tab by tab; however, a few of the endpoints are used across tabs. I indicated that in the usuage on the endpoints. If you have any questions feel free to comment here or reach out to me.

All /v1/**internal**/... endpoints don't have public documentation, as far as I can tell.

It also seems like service instances make use of these endpoints instead of their being service instance specific endpoints. I'll be happy to dig into that further should it be helpful.

Services list page

GET services list item

List Item

Originally the structure of the list items was made up (in my mind) of a ListItemContainer, ListItemTemplate and the ListItem encapsulation of both of those. However, after looking at how HDS implements their components we've had a bit of a change in direction that we wanted to share and discuss.

The list item is a generic component, which won't always be the case for component inside the toolkit. The <Cut::ListItem /> will be the container li itself and the container for all the content. It will handle options for how interacting with the entire list item will behave (switch routes, call a function, do nothing) and will represent the states of the li accordingly. It also houses a slot for generic content, allowing anyone to fill that area with whatever they would like. On top of that it will have a slot for actions that will be separate from the main clickable area of the list item to avoid buttons inside of buttons, or buttons inside of anchors, etc.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
store: Ember.inject.service(),
init() {
this._super(...arguments);
Ember.run.later(() => {
this.get('store').pushRecord('foo', {
@WenInCode
WenInCode / controllers.application.js
Created August 15, 2019 21:05
computed prop key example
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
data: { cluster: { type: 'pg' }},
computedTopLevel: Ember.computed('data', function() {
return this.get('data.cluster.type') === 'pg' ? 'POSTGRES' : 'MYSQL';
}),
@WenInCode
WenInCode / controllers.application.js
Created July 31, 2019 19:13
forms with no submit action
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
firstAction() { alert('first action'); },
secondAction() { alert('second action'); }
}
});
import Ember from 'ember';
import MyMixin from '../mymixin';
export default Ember.Controller.extend(MyMixin, {
appName: 'Ember Twiddle',
init() {
this.sayThing()
}
});
@WenInCode
WenInCode / child-component.hbs
Created February 26, 2019 05:37
Ember Closure Actions
<button {{action toggleAction}}>Toggle</button>

Keybase proof

I hereby claim:

  • I am wenincode on github.
  • I am wenincode (https://keybase.io/wenincode) on keybase.
  • I have a public key ASC_dGso-iXAyvTWnj3QfD1gRzN37cGsbhP3VZkui2oAYgo

To claim this, I am signing this object: