Add a web extension and debian package compilation (#5)
Check go code / build-and-release (push) Successful in 1m9s
Check go code / build-and-release (push) Successful in 1m9s
Reviewed-on: #5 Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Co-committed-by: Julien Fastré <julien.fastre@champs-libres.coop>
This commit was merged in pull request #5.
This commit is contained in:
+11
-11
@@ -7,12 +7,18 @@ use crate::openproject::user::{GetMe, User};
|
||||
use crate::openproject::work::WorkPackageWriter;
|
||||
use crate::planning::utils::{append_related_issues, IssueRelated};
|
||||
use crate::planning::Issue2WorkActionTrait;
|
||||
use crate::planning::Issue2WorkResult;
|
||||
use url::Url;
|
||||
|
||||
pub(crate) struct GiteaAction {}
|
||||
|
||||
impl Issue2WorkActionTrait for GiteaAction {
|
||||
async fn run(&self, url: &Url, config: &Config, args: &Issue2Work) -> Result<(), GeneralError> {
|
||||
async fn run(
|
||||
&self,
|
||||
url: &Url,
|
||||
config: &Config,
|
||||
args: &Issue2Work,
|
||||
) -> Result<Issue2WorkResult, GeneralError> {
|
||||
let gitea_client = crate::gitea::client::Client::from_config(config.gitea.first().unwrap());
|
||||
let issue: Issue = gitea_client.get(issue_html_url_to_api(url)?).await?;
|
||||
let open_project_client =
|
||||
@@ -49,16 +55,10 @@ impl Issue2WorkActionTrait for GiteaAction {
|
||||
)
|
||||
.await?;
|
||||
|
||||
println!(
|
||||
"new work package created: {:?}, edit at {}",
|
||||
work_package.subject, url_wp
|
||||
);
|
||||
|
||||
if let Err(e) = open::that(url_wp) {
|
||||
println!("failed to open work package in browser: {}", e);
|
||||
};
|
||||
|
||||
Ok(())
|
||||
Ok(Issue2WorkResult {
|
||||
work_package_url: url_wp,
|
||||
subject: work_package.subject,
|
||||
})
|
||||
}
|
||||
|
||||
fn supports(&self, url: &Url, config: &Config, _args: &Issue2Work) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user