forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from ncbo/feature/kgcl-issue-attribution/323
Enhance ontology change request attribution and begin UJS replacement
- Loading branch information
Showing
25 changed files
with
172 additions
and
170 deletions.
There are no files selected for viewing
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,10 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
// Connects to data-controller="change-requests" | ||
export default class extends Controller { | ||
static targets = [ 'addProposalForm' ] | ||
|
||
clearProposalForm() { | ||
this.addProposalFormTarget.innerHTML = ''; | ||
} | ||
} |
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,56 @@ | ||
# frozen_string_literal: true | ||
|
||
module KGCL | ||
module Renderers | ||
# Base class for generating GitHub issue content for ontology change requests | ||
class IssueContent | ||
attr_reader :params | ||
|
||
def initialize(params) | ||
@params = params | ||
end | ||
|
||
def render | ||
tr = KGCL::TemplateRenderer.new( | ||
title_template: title_template, | ||
body_template: body_template, | ||
bind_klass: self | ||
) | ||
tr.render | ||
end | ||
|
||
def concept_id | ||
@params[:concept_id] | ||
end | ||
|
||
def concept_label | ||
@params[:concept_label] | ||
end | ||
|
||
def curie | ||
@params[:curie] | ||
end | ||
|
||
def github_id | ||
@params[:github_id] | ||
end | ||
|
||
def orcid_id | ||
@params[:orcid_id] | ||
end | ||
|
||
def username | ||
@params[:username] | ||
end | ||
|
||
# These methods should be defined in subclasses to provide unique templates | ||
def title_template | ||
raise NotImplementedError, 'Subclasses must define a title_template' | ||
end | ||
|
||
def body_template | ||
raise NotImplementedError, 'Subclasses must define a body_template' | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
**Comment:** <%= comment %> | ||
|
||
<% if github_id.present? %> | ||
Proposal generated by: @<%= github_id %> | ||
<% else %> | ||
Proposal generated by: BioPortal user '<%= username %>' | ||
<% end %> | ||
|
||
ORCID: <%= orcid_id %> |
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
Oops, something went wrong.