Include gogs as builtin
parent
0128aee9f0
commit
b9a825620d
|
@ -20,6 +20,8 @@
|
|||
- Drag & Drop ordering for wiki links.
|
||||
- Add a list of all wiki pages
|
||||
- Add Wiki history
|
||||
- Third party integrations:
|
||||
- Included gogs as builtin integration.
|
||||
|
||||
### Misc
|
||||
- Lots of small and not so small bugfixes.
|
||||
|
|
|
@ -341,6 +341,12 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
section: "admin"
|
||||
}
|
||||
)
|
||||
$routeProvider.when("/project/:pslug/admin/third-parties/gogs",
|
||||
{
|
||||
templateUrl: "admin/admin-third-parties-gogs.html",
|
||||
section: "admin"
|
||||
}
|
||||
)
|
||||
# Admin - Contrib Plugins
|
||||
$routeProvider.when("/project/:pslug/admin/contrib/:plugin",
|
||||
{templateUrl: "contrib/main.html"})
|
||||
|
|
|
@ -586,3 +586,50 @@ ValidOriginIpsDirective = ->
|
|||
}
|
||||
|
||||
module.directive("tgValidOriginIps", ValidOriginIpsDirective)
|
||||
|
||||
#############################################################################
|
||||
## Gogs Controller
|
||||
#############################################################################
|
||||
|
||||
class GogsController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.FiltersMixin)
|
||||
@.$inject = [
|
||||
"$scope",
|
||||
"$tgRepo",
|
||||
"$tgResources",
|
||||
"$routeParams",
|
||||
"tgAppMetaService",
|
||||
"$translate"
|
||||
]
|
||||
|
||||
constructor: (@scope, @repo, @rs, @params, @appMetaService, @translate) ->
|
||||
bindMethods(@)
|
||||
|
||||
@scope.sectionName = @translate.instant("ADMIN.GOGS.SECTION_NAME")
|
||||
@scope.project = {}
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
||||
promise.then () =>
|
||||
title = @translate.instant("ADMIN.GOGS.PAGE_TITLE", {projectName: @scope.project.name})
|
||||
description = @scope.project.description
|
||||
@appMetaService.setAll(title, description)
|
||||
|
||||
promise.then null, @.onInitialDataError.bind(@)
|
||||
|
||||
loadModules: ->
|
||||
return @rs.modules.list(@scope.projectId, "gogs").then (gogs) =>
|
||||
@scope.gogs = gogs
|
||||
|
||||
loadProject: ->
|
||||
return @rs.projects.getBySlug(@params.pslug).then (project) =>
|
||||
@scope.projectId = project.id
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
return project
|
||||
|
||||
loadInitialData: ->
|
||||
promise = @.loadProject()
|
||||
promise.then(=> @.loadModules())
|
||||
return promise
|
||||
|
||||
module.controller("GogsController", GogsController)
|
||||
|
|
|
@ -108,6 +108,7 @@ urls = {
|
|||
"project-admin-third-parties-github": "/project/:project/admin/third-parties/github"
|
||||
"project-admin-third-parties-gitlab": "/project/:project/admin/third-parties/gitlab"
|
||||
"project-admin-third-parties-bitbucket": "/project/:project/admin/third-parties/bitbucket"
|
||||
"project-admin-third-parties-gogs": "/project/:project/admin/third-parties/gogs"
|
||||
"project-admin-contrib": "/project/:project/admin/contrib/:plugin"
|
||||
|
||||
# User settings
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhookit",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Веб-хуки - {{projectName}}",
|
||||
"SECTION_NAME": "Веб-хуки",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webbkrok - {{projectName}}",
|
||||
"SECTION_NAME": "Webbkrokar",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Github",
|
||||
"PAGE_TITLE": "Github - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks - {{projectName}}",
|
||||
"SECTION_NAME": "Webhooks",
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
"SECTION_NAME": "Githun",
|
||||
"PAGE_TITLE": "Gitlab - {{projectName}}"
|
||||
},
|
||||
"GOGS": {
|
||||
"SECTION_NAME": "Gogs",
|
||||
"PAGE_TITLE": "Gogs - {{projectName}}"
|
||||
},
|
||||
"WEBHOOKS": {
|
||||
"PAGE_TITLE": "Webhooks- {{projectName}}",
|
||||
"SECTION_NAME": "網頁觸發 ",
|
||||
|
|
|
@ -60,7 +60,7 @@ div.wrapper.roles(
|
|||
)
|
||||
|
||||
a.help-button(
|
||||
href="https://tree.taiga.io/support/integrations/gitlab-integration/"
|
||||
href="https://tree.taiga.io/support/integrations/gogs-integration/"
|
||||
target="_blank"
|
||||
)
|
||||
tg-svg(svg-icon="icon-question")
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
doctype html
|
||||
|
||||
div.wrapper.roles(
|
||||
tg-gogs-webhooks
|
||||
ng-controller="GogsController as ctrl",
|
||||
ng-init="section='admin'"
|
||||
)
|
||||
tg-project-menu
|
||||
sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties")
|
||||
include ../includes/modules/admin-menu
|
||||
sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-gogs")
|
||||
include ../includes/modules/admin-submenu-third-parties
|
||||
|
||||
section.main.admin-common.admin-third-parties
|
||||
include ../includes/components/mainTitle
|
||||
|
||||
form
|
||||
fieldset
|
||||
label(for="secret-key", translate="ADMIN.THIRD_PARTIES.SECRET_KEY")
|
||||
input(
|
||||
id="secret-key"
|
||||
type="text"
|
||||
name="secret-key"
|
||||
ng-model="gogs.secret"
|
||||
placeholder="{{'ADMIN.THIRD_PARTIES.SECRET_KEY' | translate}}"
|
||||
)
|
||||
|
||||
fieldset
|
||||
.select-input-text(tg-select-input-text)
|
||||
div
|
||||
label(for="payload-url", translate="ADMIN.THIRD_PARTIES.PAYLOAD_URL")
|
||||
.field-with-option
|
||||
input(
|
||||
id="payload-url"
|
||||
type="text"
|
||||
name="payload-url"
|
||||
readonly="readonly"
|
||||
ng-model="gogs.webhooks_url"
|
||||
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
||||
)
|
||||
.option-wrapper.select-input-content
|
||||
tg-svg(svg-icon="icon-clipboard")
|
||||
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
|
||||
|
||||
button.button-green.submit-button(
|
||||
type="submit"
|
||||
title="{{'COMMON.SAVE' | translate}}"
|
||||
translate="COMMON.SAVE"
|
||||
)
|
||||
|
||||
a.help-button(
|
||||
href="https://tree.taiga.io/support/integrations/gogs-integration/"
|
||||
target="_blank"
|
||||
)
|
||||
tg-svg(svg-icon="icon-question")
|
||||
span(translate="ADMIN.HELP")
|
|
@ -13,3 +13,6 @@ section.admin-submenu
|
|||
li#adminmenu-third-parties-bitbucket
|
||||
a(href="", tg-nav="project-admin-third-parties-bitbucket:project=project.slug")
|
||||
span.title Bitbucket
|
||||
li#adminmenu-third-parties-gogs
|
||||
a(href="", tg-nav="project-admin-third-parties-gogs:project=project.slug")
|
||||
span.title Gogs
|
||||
|
|
Loading…
Reference in New Issue