Commit ab5442af authored by Eric Eastwood's avatar Eric Eastwood Committed by Sean McGivern

Try prerendering endpoint/enabled/incomingEmail

parent 20aeeabc
......@@ -8,9 +8,10 @@ import eventHub from './event_hub';
class ServiceDeskEntry {
constructor(wrapperElement) {
this.wrapperElement = wrapperElement;
const endpoint = this.wrapperElement.dataset.endpoint;
this.store = new ServiceDeskStore();
this.service = new ServiceDeskService('http://apilab.gitlap.com/some-project');
this.service = new ServiceDeskService(endpoint);
}
init() {
......
......@@ -6,12 +6,12 @@ import '../../../vue_shared/vue_resource_interceptor';
Vue.use(vueResource);
class ServiceDeskService {
constructor(endpointRoot) {
this.project = Vue.resource(`${endpointRoot}/fetch-incoming-service-desk-email`);
constructor(endpoint) {
this.serviceDeskEnabledResource = Vue.resource(`${endpoint}/service_desk_address`);
}
fetchIncomingEmail() {
return this.project.get()
return this.serviceDeskEnabledResource.get()
.then(res => res.data.incomingEmail);
}
}
......
......@@ -131,7 +131,7 @@
%h5.prepend-top-0
Service Desk
= link_to icon('question-circle'), help_page_path("TODO")
.js-service-desk-setting-wrapper{ data: { enabled: @project.service_desk_enabled, incomingAddress: "TODO" } }
.js-service-desk-setting-wrapper{ data: { endpoint: namespace_project_path(@project.namespace, @project), enabled: @project.service_desk_enabled?, incomingAddress: (@project.service_desk_address if @project.service_desk_enabled? ) } }
%hr
%fieldset.features.append-bottom-default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment