John Cowen 8b002d086a
ui: Address some Admin Partition FIXMEs (#11057)
This commit addresses some left over admin partition FIXMEs

1. Adds Partition correctly to Service Instances
2. Converts non-important 'we can do this later' FIXMEs to TODOs
3. Removes some FIXMEs that I've double checked and addressed.

Most of the remaining FIXMEs I'm waiting on responses to questions from
the consul core folks for. I'll address those in a separate PR.
2021-10-01 11:07:58 +01:00

34 lines
1.2 KiB
JavaScript

import Service, { inject as service } from '@ember/service';
import { setProperties } from '@ember/object';
export default class HttpService extends Service {
@service('settings') settings;
@service('repository/intention') intention;
@service('repository/kv') kv;
@service('repository/session') session;
prepare(sink, data, instance) {
return setProperties(instance, data);
}
// TODO: Currently we don't use the other properties here So dc, nspace and
// partition, but confusingly they currently are in a different order to all
// our @dataSource uris @dataSource uses /:partition/:nspace/:dc/thing whilst
// here DataSink uses /:parition/:dc/:nspace/thing We should change DataSink
// to also use a @dataSink decorator and make sure the order of the parameters
// is the same throughout the app As it stands right now, if we do need to use
// those parameters for DataSink it will be very easy to introduce a bug due
// to this inconsistency
persist(sink, instance) {
const [, , , , model] = sink.split('/');
const repo = this[model];
return repo.persist(instance);
}
remove(sink, instance) {
const [, , , , model] = sink.split('/');
const repo = this[model];
return repo.remove(instance);
}
}