angular1.3
parent
63d6f4c829
commit
098b794d83
|
@ -134,7 +134,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
{templateUrl: "/partials/permission-denied.html"})
|
||||
|
||||
$routeProvider.otherwise({redirectTo: '/not-found'})
|
||||
$locationProvider.html5Mode(true)
|
||||
$locationProvider.html5Mode({enabled: true, requireBase: false})
|
||||
|
||||
defaultHeaders = {
|
||||
"Content-Type": "application/json"
|
||||
|
@ -154,20 +154,24 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
|
||||
# Add next param when user try to access to a secction need auth permissions.
|
||||
authHttpIntercept = ($q, $location, $confirm, $navUrls, $lightboxService) ->
|
||||
return (promise) ->
|
||||
return promise.then null, (response) ->
|
||||
if response.status == 0
|
||||
$lightboxService.closeAll()
|
||||
$location.path($navUrls.resolve("error"))
|
||||
$location.replace()
|
||||
else if response.status == 401
|
||||
nextPath = $location.path()
|
||||
$location.url($navUrls.resolve("login")).search("next=#{nextPath}")
|
||||
return $q.reject(response)
|
||||
httpResponseError = (response) ->
|
||||
if response.status == 0
|
||||
$lightboxService.closeAll()
|
||||
$location.path($navUrls.resolve("error"))
|
||||
$location.replace()
|
||||
else if response.status == 401
|
||||
nextPath = $location.path()
|
||||
$location.url($navUrls.resolve("login")).search("next=#{nextPath}")
|
||||
return $q.reject(response)
|
||||
|
||||
return {
|
||||
responseError: httpResponseError
|
||||
}
|
||||
|
||||
$provide.factory("authHttpIntercept", ["$q", "$location", "$tgConfirm", "$tgNavUrls",
|
||||
"lightboxService", authHttpIntercept])
|
||||
$httpProvider.responseInterceptors.push('authHttpIntercept')
|
||||
|
||||
$httpProvider.interceptors.push('authHttpIntercept');
|
||||
|
||||
window.checksley.updateValidators({
|
||||
linewidth: (val, width) ->
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
taiga = @.taiga
|
||||
|
||||
mixOf = @.taiga.mixOf
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaAdmin")
|
||||
|
||||
|
@ -47,7 +48,7 @@ class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
|||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q,
|
||||
@location, @navUrls, @analytics, @appTitle) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Manage Members" #i18n
|
||||
@scope.project = {}
|
||||
|
|
|
@ -24,6 +24,7 @@ taiga = @.taiga
|
|||
mixOf = @.taiga.mixOf
|
||||
bindOnce = @.taiga.bindOnce
|
||||
debounce = @.taiga.debounce
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaAdmin")
|
||||
|
||||
|
@ -47,7 +48,7 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
|||
]
|
||||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @navUrls, @appTitle) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Permissions" #i18n
|
||||
@scope.project = {}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
taiga = @.taiga
|
||||
|
||||
mixOf = @.taiga.mixOf
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaAdmin")
|
||||
|
||||
|
@ -40,7 +41,7 @@ class GithubController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
|||
]
|
||||
|
||||
constructor: (@scope, @repo, @rs, @params, @appTitle) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Github" #i18n
|
||||
@scope.project = {}
|
||||
|
|
|
@ -27,6 +27,7 @@ scopeDefer = @.taiga.scopeDefer
|
|||
bindOnce = @.taiga.bindOnce
|
||||
groupBy = @.taiga.groupBy
|
||||
timeout = @.taiga.timeout
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaBacklog")
|
||||
|
||||
|
@ -53,7 +54,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
|||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q,
|
||||
@location, @appTitle, @navUrls, @events, @analytics, tgLoader) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Backlog"
|
||||
@showTags = false
|
||||
|
@ -444,6 +445,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
|||
return obj
|
||||
|
||||
plainStatuses = _.map(@scope.userstories, "status")
|
||||
|
||||
plainStatuses = _.filter plainStatuses, (status) =>
|
||||
if status
|
||||
return status
|
||||
|
|
|
@ -143,6 +143,7 @@ class RepositoryService extends taiga.Service
|
|||
queryMany: (name, params, options={}) ->
|
||||
url = @urls.resolve(name)
|
||||
httpOptions = {headers: {}}
|
||||
|
||||
if not options.enablePagination
|
||||
httpOptions.headers["x-disable-pagination"] = "1"
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
taiga = @.taiga
|
||||
sizeFormat = @.taiga.sizeFormat
|
||||
bindOnce = @.taiga.bindOnce
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaCommon")
|
||||
|
||||
|
@ -30,7 +31,7 @@ class AttachmentsController extends taiga.Controller
|
|||
@.$inject = ["$scope", "$rootScope", "$tgRepo", "$tgResources", "$tgConfirm", "$q"]
|
||||
|
||||
constructor: (@scope, @rootscope, @repo, @rs, @confirm, @q) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
@.type = null
|
||||
@.objectId = null
|
||||
@.projectId = null
|
||||
|
|
|
@ -23,7 +23,7 @@ taiga = @.taiga
|
|||
timeout = @.taiga.timeout
|
||||
cancelTimeout = @.taiga.cancelTimeout
|
||||
debounce = @.taiga.debounce
|
||||
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
NOTIFICATION_MSG = {
|
||||
"success":
|
||||
|
@ -42,7 +42,7 @@ class ConfirmService extends taiga.Service
|
|||
@.$inject = ["$q", "lightboxService", "$tgLoading"]
|
||||
|
||||
constructor: (@q, @lightboxService, @loading) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
hide: (el)->
|
||||
if el
|
||||
|
|
|
@ -21,13 +21,14 @@
|
|||
|
||||
taiga = @.taiga
|
||||
startswith = @.taiga.startswith
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaEvents", [])
|
||||
|
||||
|
||||
class EventsService
|
||||
constructor: (@win, @log, @config, @auth) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
initialize: (sessionId) ->
|
||||
@.sessionId = sessionId
|
||||
|
|
|
@ -27,6 +27,7 @@ scopeDefer = @.taiga.scopeDefer
|
|||
bindOnce = @.taiga.bindOnce
|
||||
groupBy = @.taiga.groupBy
|
||||
timeout = @.taiga.timeout
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaKanban")
|
||||
|
||||
|
@ -66,7 +67,9 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
|||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location,
|
||||
@appTitle, @navUrls, @events, @analytics, tgLoader) ->
|
||||
_.bindAll(@)
|
||||
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Kanban"
|
||||
@scope.statusViewModes = {}
|
||||
@.initializeEventHandlers()
|
||||
|
|
|
@ -26,6 +26,7 @@ groupBy = @.taiga.groupBy
|
|||
bindOnce = @.taiga.bindOnce
|
||||
scopeDefer = @.taiga.scopeDefer
|
||||
timeout = @.taiga.timeout
|
||||
bindMethods = @.taiga.bindMethods
|
||||
|
||||
module = angular.module("taigaTaskboard")
|
||||
|
||||
|
@ -53,7 +54,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @appTitle, @location, @navUrls,
|
||||
@events, @analytics, tgLoader) ->
|
||||
_.bindAll(@)
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = "Taskboard"
|
||||
@.initializeEventHandlers()
|
||||
|
|
|
@ -23,6 +23,16 @@ nl2br = (str) =>
|
|||
breakTag = '<br />'
|
||||
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2')
|
||||
|
||||
bindMethods = (object) =>
|
||||
dependencies = _.keys(object)
|
||||
|
||||
methods = []
|
||||
|
||||
_.forIn object, (value, key) =>
|
||||
if key not in dependencies
|
||||
methods.push(key)
|
||||
|
||||
_.bindAll(object, methods)
|
||||
|
||||
bindOnce = (scope, attr, continuation) =>
|
||||
val = scope.$eval(attr)
|
||||
|
@ -133,6 +143,7 @@ sizeFormat = (input, precision=1) ->
|
|||
|
||||
taiga = @.taiga
|
||||
taiga.nl2br = nl2br
|
||||
taiga.bindMethods = bindMethods
|
||||
taiga.bindOnce = bindOnce
|
||||
taiga.mixOf = mixOf
|
||||
taiga.trim = trim
|
||||
|
|
|
@ -16,7 +16,7 @@ block content
|
|||
span.us-number(tg-bo-ref="issue.ref")
|
||||
span.us-name(tg-editable-subject, ng-model="issue", required-perm="modify_issue")
|
||||
|
||||
p.us-related-task(ng-if="issue.generated_user_stories") This issue has been promoted to US:
|
||||
p.us-related-task(ng-if="issue.generated_user_stories.length") This issue has been promoted to US:
|
||||
a(ng-repeat="us in issue.generated_user_stories",
|
||||
tg-check-permission="view_us", href="",
|
||||
tg-bo-title="'#' + us.ref + ' ' + us.subject",
|
||||
|
|
13
bower.json
13
bower.json
|
@ -50,11 +50,11 @@
|
|||
"lodash": "~2.4.1",
|
||||
"emoticons": "~0.1.7",
|
||||
"jquery-flot": "~0.8.2",
|
||||
"angular": "1.2.21",
|
||||
"angular-route": "1.2.21",
|
||||
"angular-animate": "1.2.21",
|
||||
"angular-sanitize": "1.2.21",
|
||||
"angular-mocks": "1.2.21",
|
||||
"angular": "1.3.4",
|
||||
"angular-route": "1.3.4",
|
||||
"angular-animate": "1.3.4",
|
||||
"angular-sanitize": "1.3.4",
|
||||
"angular-mocks": "1.3.4",
|
||||
"kalendae": "~0.4.1",
|
||||
"checksley": "~0.6.0",
|
||||
"i18next": "~1.7.1",
|
||||
|
@ -78,7 +78,8 @@
|
|||
"resolutions": {
|
||||
"lodash": "~2.4.1",
|
||||
"moment": "~2.6.0",
|
||||
"jquery": "~2.1.1"
|
||||
"jquery": "~2.1.1",
|
||||
"angular": "1.3.4"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue