Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2/12/25 add markdown descriptions #1283

Merged
merged 26 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7b36f5e
add markdown
hardingjam Feb 12, 2025
ea460c3
add base css and to format markdown
hardingjam Feb 12, 2025
0003b97
add css rules and new registry
hardingjam Feb 12, 2025
55e536a
update gui test
hardingjam Feb 12, 2025
58890f6
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardingjam Feb 12, 2025
59a6566
console.log remove
hardingjam Feb 12, 2025
dc19f1b
Merge branch '2024-02-11-styling-pass' into 2/12/25-add-markdown-desc…
hardyjosh Feb 12, 2025
e457a01
wip routing fixes
hardyjosh Feb 12, 2025
3d4caa0
wip
hardyjosh Feb 12, 2025
163bbe1
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardyjosh Feb 13, 2025
1477f98
routing and cleanup
hardyjosh Feb 13, 2025
ecf001c
rm styles
hardyjosh Feb 13, 2025
3939373
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardyjosh Feb 13, 2025
c6c25eb
rm unused prop
hardyjosh Feb 13, 2025
0c67823
rm raw dotrain
hardyjosh Feb 13, 2025
0a90668
tests
hardyjosh Feb 13, 2025
860f179
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardyjosh Feb 13, 2025
0d6b412
lint
hardyjosh Feb 13, 2025
31a3600
cast dotrain type
hardingjam Feb 14, 2025
9bad7b9
lint
hardyjosh Feb 14, 2025
edba303
test
hardyjosh Feb 14, 2025
4587680
rm files
hardyjosh Feb 14, 2025
05d27a7
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardingjam Feb 14, 2025
e5839f6
tailwind typography
hardyjosh Feb 14, 2025
533f92b
Merge branch 'main' into 2/12/25-add-markdown-descriptions
hardyjosh Feb 14, 2025
9ab0c23
test
hardyjosh Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions crates/settings/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ impl_all_wasm_traits!(Gui);
pub struct NameAndDescription {
pub name: String,
pub description: String,
pub short_description: Option<String>,
}

#[cfg(target_family = "wasm")]
impl_all_wasm_traits!(NameAndDescription);

Expand Down Expand Up @@ -376,7 +378,17 @@ impl Gui {
Some("gui".to_string()),
)?;

return Ok(NameAndDescription { name, description });
let short_description = require_string(
get_hash_value(gui, "short-description", Some("gui".to_string()))?,
None,
Some("gui".to_string()),
)?;

return Ok(NameAndDescription {
name,
description,
short_description: Some(short_description),
});
}
}
Err(YamlError::Field {
Expand Down Expand Up @@ -422,8 +434,14 @@ impl Gui {
Some(location.clone()),
)?;

deployment_details
.insert(deployment_key, NameAndDescription { name, description });
deployment_details.insert(
deployment_key,
NameAndDescription {
name,
description,
short_description: None,
},
);
}
}
}
Expand Down Expand Up @@ -1474,8 +1492,8 @@ gui:
- binding: test
name: test
presets:
- value:
- test
- value:
wrong: map
"#;
let error = Gui::parse_from_yaml_optional(
vec![get_document(&format!("{yaml_prefix}{yaml}"))],
Expand Down
1 change: 1 addition & 0 deletions crates/settings/src/yaml/dotrain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ mod tests {
gui:
name: Test gui
description: Test description
short-description: Test short description
deployments:
deployment1:
name: Test deployment
Expand Down
119 changes: 83 additions & 36 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tailwindcss/typography": "^0.5.16",
"@tanstack/svelte-query": "^5.59.20",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/svelte": "^5.1.0",
Expand All @@ -52,15 +53,15 @@
"jsdom": "^24.0.0",
"lodash": "^4.17.21",
"mockttp": "^3.15.1",
"postcss": "^8.4.32",
"postcss": "^8.5.2",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"publint": "^0.2.0",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.9",
"tailwindcss": "^3.4.17",
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
Expand All @@ -83,6 +84,7 @@
"flowbite": "^2.2.1",
"flowbite-svelte": "^0.44.21",
"flowbite-svelte-icons": "^0.4.5",
"svelte-markdown": "^0.4.1",
"wagmi": "^2.14.7"
}
}
3 changes: 3 additions & 0 deletions packages/orderbook/test/js_api/gui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ const guiConfig = `
gui:
name: Fixed limit
description: Fixed limit order strategy
short-description: Buy WETH with USDC on Base.
deployments:
some-deployment:
name: Buy WETH with USDC on Base.
description: Buy WETH with USDC for fixed price on Base network.
short-description: Buy WETH with USDC on Base.
deposits:
- token: token1
min: 0
Expand Down Expand Up @@ -374,6 +376,7 @@ describe('Rain Orderbook JS API Package Bindgen Tests - Gui', async function ()
await DotrainOrderGui.getStrategyDetails(dotrainWithGui);
assert.equal(strategyDetails.name, 'Fixed limit');
assert.equal(strategyDetails.description, 'Fixed limit order strategy');
assert.equal(strategyDetails.short_description, 'Buy WETH with USDC on Base.');
});

it('should get deployment details', async () => {
Expand Down
6 changes: 6 additions & 0 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"import": "./dist/index.js",
"require": "./dist/index.js",
"svelte": "./dist/index.js"
},
"./services": {
"types": "./dist/services/index.d.ts",
"import": "./dist/services/index.js",
"require": "./dist/services/index.js",
"svelte": "./dist/services/index.js"
}
},
"scripts": {
Expand Down
Loading