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'; ...@@ -8,9 +8,10 @@ import eventHub from './event_hub';
class ServiceDeskEntry { class ServiceDeskEntry {
constructor(wrapperElement) { constructor(wrapperElement) {
this.wrapperElement = wrapperElement; this.wrapperElement = wrapperElement;
const endpoint = this.wrapperElement.dataset.endpoint;
this.store = new ServiceDeskStore(); this.store = new ServiceDeskStore();
this.service = new ServiceDeskService('http://apilab.gitlap.com/some-project'); this.service = new ServiceDeskService(endpoint);
} }
init() { init() {
......
...@@ -6,12 +6,12 @@ import '../../../vue_shared/vue_resource_interceptor'; ...@@ -6,12 +6,12 @@ import '../../../vue_shared/vue_resource_interceptor';
Vue.use(vueResource); Vue.use(vueResource);
class ServiceDeskService { class ServiceDeskService {
constructor(endpointRoot) { constructor(endpoint) {
this.project = Vue.resource(`${endpointRoot}/fetch-incoming-service-desk-email`); this.serviceDeskEnabledResource = Vue.resource(`${endpoint}/service_desk_address`);
} }
fetchIncomingEmail() { fetchIncomingEmail() {
return this.project.get() return this.serviceDeskEnabledResource.get()
.then(res => res.data.incomingEmail); .then(res => res.data.incomingEmail);
} }
} }
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
%h5.prepend-top-0 %h5.prepend-top-0
Service Desk Service Desk
= link_to icon('question-circle'), help_page_path("TODO") = 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 %hr
%fieldset.features.append-bottom-default %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