Skip to content

Commit

Permalink
Add a l10n service to the web-based API (#1047)
Browse files Browse the repository at this point in the history
## Problem

This PR aims to implement a `l10n` API in the web-based API. Its design
could be the base for other services.

Dropping the D-Bus interface is out of scope. 

## Tasks

- [x] Export the list of locales
- [x] Export the list of keymaps
- [x] Export the list of timezones
- [x] Allow setting the locale
- [x] Allow setting the keymap
- [x] Allow setting the timezone
- [x] Allow setting the UILocale
- [x] Read current configuration (locale, keymap, timezone)
- [x] Read the UILocale
- [ ] Write all changes or nothing (let's postpone when we drop the
D-Bus API as it will be easier).
- [x] Emit a signal when UILocale changes
- [x] Add unit tests
- [x] Add some integration test
- [x] Initialize the locales properly
- [x] More compact output (partially done; let's work on that when we
start working in the web UI).
- [x] Enable compression

## Screenshots

![emitting
events](https://github.com/openSUSE/agama/assets/15836/01f3c3cf-bcf9-4cf4-95d5-787d02b7a380)

## Links

Trello:
https://trello.com/c/sjR61cpk/3556-5-expose-the-l10n-api-over-http
  • Loading branch information
imobachgs committed Feb 27, 2024
2 parents 76c930c + 6a42f8a commit fc05c32
Show file tree
Hide file tree
Showing 29 changed files with 1,489 additions and 132 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
pam-devel
python-langtable-data
timezone
xkeyboard-config

- name: Install Rust toolchains
run: rustup toolchain install stable
Expand All @@ -92,10 +93,12 @@ jobs:
tool: cargo-binstall

- name: Install Tarpaulin (for code coverage)
run: cargo-binstall --no-confirm cargo-tarpaulin
run: |
echo "$PWD/share/bin" >> $GITHUB_PATH
cargo-binstall --no-confirm cargo-tarpaulin
- name: Run the tests
run: cargo tarpaulin --out xml
run: cargo tarpaulin --out xml -- --nocapture

# send the code coverage for the Rust part to the coveralls.io
- name: Coveralls GitHub Action
Expand Down
162 changes: 156 additions & 6 deletions rust/Cargo.lock

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

3 changes: 2 additions & 1 deletion rust/agama-dbus-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ macaddr = "1.0"
async-trait = "0.1.75"
axum = { version = "0.7.4", features = ["ws"] }
serde_json = "1.0.113"
tower-http = { version = "0.5.1", features = ["trace"] }
tower-http = { version = "0.5.1", features = ["compression-br", "trace"] }
tracing-subscriber = "0.3.18"
tracing-journald = "0.3.0"
tracing = "0.1.40"
Expand All @@ -47,6 +47,7 @@ chrono = { version = "0.4.34", default-features = false, features = [
"clock",
] }
pam = "0.8.0"
serde_with = "3.6.1"

[[bin]]
name = "agama-dbus-server"
Expand Down
Loading

0 comments on commit fc05c32

Please sign in to comment.