-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jira integration for release readiness (#682)
At the moment, the integration is disabled because the actual feature isn't ready yet. This is just the integration setup.
- Loading branch information
Showing
42 changed files
with
1,393 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
class IntegrationListeners::JiraController < IntegrationListenerController | ||
using RefinedString | ||
|
||
def callback | ||
unless valid_state? | ||
redirect_to app_path(state_app), alert: INTEGRATION_CREATE_ERROR | ||
return | ||
end | ||
|
||
begin | ||
@integration = state_app.integrations.build(integration_params) | ||
@integration.providable = build_providable | ||
|
||
if @integration.providable.complete_access && @integration.save | ||
redirect_to app_path(state_app), notice: t("integrations.project_management.jira.integration_created") | ||
else | ||
@resources = @integration.providable.available_resources | ||
|
||
if @resources.blank? | ||
redirect_to app_integrations_path(state_app), alert: t("integrations.project_management.jira.no_organization") | ||
return | ||
end | ||
|
||
render "jira_integration/select_organization" | ||
end | ||
rescue => e | ||
Rails.logger.error(e) | ||
redirect_to app_integrations_path(state_app), alert: INTEGRATION_CREATE_ERROR | ||
end | ||
end | ||
|
||
protected | ||
|
||
def providable_params | ||
super.merge( | ||
code: code, | ||
cloud_id: params[:cloud_id] | ||
) | ||
end | ||
|
||
private | ||
|
||
def error? | ||
params[:error].present? || state.empty? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Controller} from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["section", "subsection", "emptyState"] | ||
static outlets = ["reveal"] | ||
|
||
connect() { | ||
this.sectionTargets.forEach((section) => this.targetedToggle(section)) | ||
} | ||
|
||
toggle(e) { | ||
this.targetedToggle(e.target) | ||
} | ||
|
||
targetedToggle(target) { | ||
let subsection = this.subsectionTargets.find(t => t.dataset.sectionKey === target.dataset.sectionKey) | ||
if (subsection) { | ||
subsection.hidden = !target.checked | ||
} | ||
|
||
this.updateEmptiness() | ||
} | ||
|
||
updateEmptiness() { | ||
if (this.hasRevealOutlet) { | ||
if (this.subsectionTargets.every(t => t.hidden)) { | ||
this.revealOutlet.show() | ||
} else { | ||
this.revealOutlet.hide() | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.