From abea905feb274948aa96f97ee216e67906e435b3 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 22 Sep 2024 23:39:00 +0200 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=91=B7=20=20Check=20that=20no=20error?= =?UTF-8?q?=20occurs=20during=20the=20build=20of=20the=20webapp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .woodpecker/.validate.yaml diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml new file mode 100644 index 0000000..5517665 --- /dev/null +++ b/.woodpecker/.validate.yaml @@ -0,0 +1,11 @@ +steps: + build: + image: rust:latest + commands: + - cargo install dioxus-cli --locked -j ${JOBS_NB:-default} + - rustup target add wasm32-unknown-unknown + - cargo install -f wasm-bindgen-cli --version 0.2.93 + - dx build -r --platform web -- -j ${JOBS_NB:-default} + +when: + - event: pull_request -- 2.43.0 From deb3e273f4160fcea13fc0079357694f2d1de553 Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 23 Sep 2024 20:47:23 +0200 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=91=B7=20Add=20format=20and=20clippy?= =?UTF-8?q?=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.dockerize.yaml | 3 +++ .woodpecker/.validate.yaml | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.woodpecker/.dockerize.yaml b/.woodpecker/.dockerize.yaml index f5fa465..c4856b1 100644 --- a/.woodpecker/.dockerize.yaml +++ b/.woodpecker/.dockerize.yaml @@ -13,3 +13,6 @@ steps: when: - event: push branch: ${CI_REPO_DEFAULT_BRANCH} + +depends_on: + - validate diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index 5517665..5604d32 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -1,5 +1,15 @@ steps: - build: + - name: format + image: rust:latest + commands: + - cargo fmt --all --check + + - name: clippy + image: rust:latest + commands: + - cargo clippy --all --all-features -- -D warnings + + - name: build image: rust:latest commands: - cargo install dioxus-cli --locked -j ${JOBS_NB:-default} -- 2.43.0 From 9b2ab337b26ffd78d8b9409f991e2b11601d0167 Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 23 Sep 2024 20:50:51 +0200 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=91=B7=20Install=20rustfmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index 5604d32..edae8ed 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -2,6 +2,7 @@ steps: - name: format image: rust:latest commands: + - rustup component add rustfmt - cargo fmt --all --check - name: clippy -- 2.43.0 From d8e3d49d95b807b8c6164c1cc940b251fffc3792 Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 23 Sep 2024 20:52:08 +0200 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=91=B7=20Install=20clippy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index edae8ed..90ef551 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -8,6 +8,7 @@ steps: - name: clippy image: rust:latest commands: + - rustup component add clippy - cargo clippy --all --all-features -- -D warnings - name: build -- 2.43.0 From b728f6efcdc8a33a1743c020a6c900d6c055ce12 Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 23 Sep 2024 21:58:07 +0200 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=91=B7=20Install=20deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index 90ef551..040fda3 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -8,8 +8,11 @@ steps: - name: clippy image: rust:latest commands: + - apt update && apt install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev - rustup component add clippy - cargo clippy --all --all-features -- -D warnings + # Not ready for clippy validation + failure: ignore - name: build image: rust:latest -- 2.43.0 From 691dc7572a3ddca4b609a9bdaf9a93eef7eb5dfe Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 23 Sep 2024 22:16:55 +0200 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20some=20clippy=20warnin?= =?UTF-8?q?gs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.rs | 41 +++++++++++++++-------------- src/domain/model/store_interface.rs | 1 + src/ui/components/chat_panel.rs | 2 +- src/ui/components/conversations.rs | 8 ++++-- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/build.rs b/build.rs index 80f3543..7d0ad5a 100644 --- a/build.rs +++ b/build.rs @@ -15,26 +15,27 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let mut tasks = Vec::new(); - - // Global tokens - tasks.push(Task::new( - PathBuf::from("src/ui/_base.scss"), - Path::new(&out_dir).join("style_tokens.rs"), - "style".to_string(), - )); - // variables defined by the Panel component - tasks.push(Task::new( - PathBuf::from("src/ui/components/_panel.scss"), - Path::new(&out_dir).join("style_component_panel.rs"), - "panel".to_string(), - )); - // Variables set by the Conversations layout - tasks.push(Task::new( - PathBuf::from("src/ui/layouts/conversations.scss"), - Path::new(&out_dir).join("style_layout_conversations.rs"), - "conversations".to_string(), - )); + // let mut tasks = Vec::new(); + let tasks = vec![ + // Global tokens + Task::new( + PathBuf::from("src/ui/_base.scss"), + Path::new(&out_dir).join("style_tokens.rs"), + "style".to_string(), + ), + // variables defined by the Panel component + Task::new( + PathBuf::from("src/ui/components/_panel.scss"), + Path::new(&out_dir).join("style_component_panel.rs"), + "panel".to_string(), + ), + // Variables set by the Conversations layout + Task::new( + PathBuf::from("src/ui/layouts/conversations.scss"), + Path::new(&out_dir).join("style_layout_conversations.rs"), + "conversations".to_string(), + ), + ]; export_variables(tasks) } diff --git a/src/domain/model/store_interface.rs b/src/domain/model/store_interface.rs index 4a30354..bfdd944 100644 --- a/src/domain/model/store_interface.rs +++ b/src/domain/model/store_interface.rs @@ -39,6 +39,7 @@ pub trait RoomStoreConsumerInterface { pub trait RoomStoreProviderInterface { fn on_new_name(&self, name: Option); fn on_new_avatar(&self, avatar: Option); + #[allow(dead_code)] fn on_new_topic(&self, topic: Option); fn on_new_member(&self, member: RoomMember); fn on_invitation(&self, invitation: Invitation); diff --git a/src/ui/components/chat_panel.rs b/src/ui/components/chat_panel.rs index 0ba0b6c..868adc3 100644 --- a/src/ui/components/chat_panel.rs +++ b/src/ui/components/chat_panel.rs @@ -5,7 +5,7 @@ turf::style_sheet!("src/ui/components/chat_panel.scss"); #[component] pub fn ChatPanel(name: String) -> Element { rsx! { - style { {STYLE_SHEET} }, + style { {STYLE_SHEET} } div { class: ClassName::CHAT_PANEL, diff --git a/src/ui/components/conversations.rs b/src/ui/components/conversations.rs index ee71bdd..f572685 100644 --- a/src/ui/components/conversations.rs +++ b/src/ui/components/conversations.rs @@ -237,12 +237,16 @@ pub fn ConversationAvatar( let on_press = { let room_id = room_id.clone(); move || { - on_selected.map(|c| c.call(room_id.as_ref().clone())); + if let Some(c) = on_selected { + c.call(room_id.as_ref().clone()) + } } }; let on_long_press = move || { - on_pressed.map(|c| c.call(room_id.as_ref().clone())); + if let Some(c) = on_pressed { + c.call(room_id.as_ref().clone()) + } }; let long_press_hook = use_long_press(long_press_duration, on_press, on_long_press); -- 2.43.0 From 831085e8b6d74c90bf1f7b3683198bf38a086b3e Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 24 Sep 2024 22:56:04 +0200 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=91=B7=20Disable=20build=20step=20on?= =?UTF-8?q?=20MR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index 040fda3..fbf155e 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -14,13 +14,13 @@ steps: # Not ready for clippy validation failure: ignore - - name: build - image: rust:latest - commands: - - cargo install dioxus-cli --locked -j ${JOBS_NB:-default} - - rustup target add wasm32-unknown-unknown - - cargo install -f wasm-bindgen-cli --version 0.2.93 - - dx build -r --platform web -- -j ${JOBS_NB:-default} + # - name: build + # image: rust:latest + # commands: + # - cargo install dioxus-cli --locked -j ${JOBS_NB:-default} + # - rustup target add wasm32-unknown-unknown + # - cargo install -f wasm-bindgen-cli --version 0.2.93 + # - dx build -r --platform web -- -j ${JOBS_NB:-default} when: - event: pull_request -- 2.43.0