Skip to content

Commit

Permalink
Fix PR URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatekii committed Jan 17, 2025
1 parent 01c27f3 commit cb64f71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/models/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use dioxus::prelude::*;
use serde::{Deserialize, Serialize};
use surrealdb::{Datetime, RecordId};

use crate::helpers::read_env_var;

use super::measurement::{MeasurementMappedModel, MeasurementModel};

#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
Expand Down Expand Up @@ -54,8 +56,11 @@ pub struct RunMappedParentModel {

impl RunModel {
pub fn pr_url_element(&self) -> Element {
let org = read_env_var("GITHUB_ORG");
let repo = read_env_var("GITHUB_REPO");

rsx! {
a { href: "https://github.com/probe-rs/probe-rs/pulls/{self.pr}", "#{self.pr}" }
a { href: "https://github.com/{org}/{repo}/pull/{self.pr}", "#{self.pr}" }
}
}
}

0 comments on commit cb64f71

Please sign in to comment.