Skip to content

Commit

Permalink
1.1.0-rc.2 (#83)
Browse files Browse the repository at this point in the history
* reset version to 1.1.0 after merge from rc branch

* ci: updated for next branch

resolves #80

* bumped rc version

* remove initial folder

resolves #82

* added extra logging to help diagnose #81

* actually export package description

* reformatted

* Merge remote-tracking branch 'origin/next' into 1.1.0-rc.2
  • Loading branch information
lilopkins authored Dec 11, 2024
1 parent 0581dfa commit 531e5a8
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- next

env:
EXECUTABLE_NAME: evidenceangel-ui
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-version-bumped.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
check-version:
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "evidenceangel"
description = "Library and executables to work with EvidenceAngel evidence packages (*.evp)."
version = "1.1.0-rc.1"
version = "1.1.0-rc.2"
edition = "2021"
license = "GPL-3.0-or-later"
authors = [
Expand Down
38 changes: 23 additions & 15 deletions src/evidenceangel-ui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,6 @@ impl Component for AppModel {
.modal(true)
.title(lang::lookup("header-save"))
.filters(&filter::filter_list(vec![filter::packages()]))
.initial_folder(&gtk::gio::File::for_path("."))
.build();

let sender_c = sender.clone();
Expand Down Expand Up @@ -838,7 +837,6 @@ impl Component for AppModel {
.modal(true)
.title(lang::lookup("header-open"))
.filters(&filter::filter_list(vec![filter::packages()]))
.initial_folder(&gtk::gio::File::for_path("."))
.build();

let sender_c = sender.clone();
Expand Down Expand Up @@ -1707,19 +1705,29 @@ impl Component for AppModel {
let sender_c = sender.clone();
clipboard.read_texture_async(
Some(&Cancellable::new()),
move |cb| {
if let Some(data) = cb.ok().flatten() {
let media =
MediaFile::from(data.save_to_png_bytes().to_vec());
let evidence = Evidence::new(
EvidenceKind::Image,
evidenceangel::EvidenceData::Media {
hash: media.hash(),
},
);
sender_c.input(AppInput::_AddMedia(media));
sender_c.input(AppInput::_AddEvidence(evidence, None));
} else {
move |cb| match cb {
Ok(texture) => {
if let Some(data) = texture {
let media = MediaFile::from(
data.save_to_png_bytes().to_vec(),
);
let evidence = Evidence::new(
EvidenceKind::Image,
evidenceangel::EvidenceData::Media {
hash: media.hash(),
},
);
sender_c.input(AppInput::_AddMedia(media));
sender_c
.input(AppInput::_AddEvidence(evidence, None));
} else {
sender_c.input(AppInput::ShowToast(lang::lookup(
"paste-evidence-failed",
)));
}
}
Err(e) => {
log::warn!("Failed to paste image: {e}");
sender_c.input(AppInput::ShowToast(lang::lookup(
"paste-evidence-failed",
)));
Expand Down
1 change: 0 additions & 1 deletion src/evidenceangel-ui/dialogs/add_evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ impl Component for AddImageEvidenceDialogModel {
.modal(true)
.title(lang::lookup("header-open"))
.filters(&filter::filter_list(vec![filter::images()]))
.initial_folder(&gtk::gio::File::for_path("."))
.build();

let sender_c = sender.clone();
Expand Down
1 change: 0 additions & 1 deletion src/evidenceangel-ui/dialogs/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ impl Component for ExportDialogModel {
let dialog = gtk::FileDialog::builder()
.modal(true)
.title(lang::lookup("header-open"))
.initial_folder(&gtk::gio::File::for_path("."))
.initial_name(self.test_case_name.as_ref().unwrap_or(&self.package_name))
.accept_label(lang::lookup("select"))
.build();
Expand Down
5 changes: 5 additions & 0 deletions src/exporters/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ fn create_metadata_sheet(
worksheet.write_string_with_format(row, 1, format!("{author}"), &italic)?;
}

row += 2;
if let Some(description) = package.metadata().description() {
worksheet.write_string(row, 1, description)?;
}

Ok(())
}

Expand Down
4 changes: 4 additions & 0 deletions src/exporters/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ impl Exporter for HtmlExporter {
.child(HtmlElement::new("em").content(&html_escape::encode_text(&authors))),
);

if let Some(description) = package.metadata().description() {
body.add_child(HtmlElement::new("p").content(&html_escape::encode_text(description)));
}

let mut test_cases: Vec<&TestCase> = package.test_case_iter()?.collect();
test_cases.sort_by(|a, b| {
a.metadata()
Expand Down

0 comments on commit 531e5a8

Please sign in to comment.