Pass the service url to tribe on send-to-tribe link
parent
5ca24aa37b
commit
e233736aea
|
@ -17,11 +17,16 @@
|
||||||
# File: tribe-button.directive.coffee
|
# File: tribe-button.directive.coffee
|
||||||
###
|
###
|
||||||
|
|
||||||
TribeButtonDirective = (configService) ->
|
TribeButtonDirective = (configService, locationService) ->
|
||||||
link = (scope, el, attrs) ->
|
link = (scope, el, attrs) ->
|
||||||
|
|
||||||
scope.vm = {}
|
scope.vm = {}
|
||||||
scope.vm.tribeHost = configService.config.tribeHost
|
scope.vm.tribeHost = configService.config.tribeHost
|
||||||
|
scope.vm.url = "#{locationService.protocol()}://#{locationService.host()}"
|
||||||
|
if (locationService.protocol() == "http" and locationService.port() != 80)
|
||||||
|
scope.vm.url = "#{scope.vm.url}:#{locationService.port()}"
|
||||||
|
else if (locationService.protocol() == "https" and locationService.port() != 443)
|
||||||
|
scope.vm.url = "#{scope.vm.url}:#{locationService.port()}"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
scope: {usId: "=", projectSlug: "="}
|
scope: {usId: "=", projectSlug: "="}
|
||||||
|
@ -31,7 +36,7 @@ TribeButtonDirective = (configService) ->
|
||||||
}
|
}
|
||||||
|
|
||||||
TribeButtonDirective.$inject = [
|
TribeButtonDirective.$inject = [
|
||||||
"$tgConfig"
|
"$tgConfig", "$tgLocation"
|
||||||
]
|
]
|
||||||
|
|
||||||
angular.module("taigaComponents").directive("tgTribeButton", TribeButtonDirective)
|
angular.module("taigaComponents").directive("tgTribeButton", TribeButtonDirective)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
a.button-tribe(
|
a.button-tribe(
|
||||||
ng-href="{{::vm.tribeHost}}/taiga-integration/receive?project={{projectSlug}}&us={{usId}}",
|
ng-href="{{::vm.tribeHost}}/taiga-integration/receive?url={{::vm.url}}&project={{projectSlug}}&us={{usId}}",
|
||||||
title="{{ 'US.TRIBE.PUBLISH' | translate }}"
|
title="{{ 'US.TRIBE.PUBLISH' | translate }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue