Skip to content

Commit 9f74d0d

Browse files
Merge pull request #33 from SteveLin100132/master
fix(filter): resolve multi_select filter validation error in advanced filtering
2 parents 0b54ca6 + 2de35e6 commit 9f74d0d

File tree

79 files changed

+9263
-868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+9263
-868
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Website to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master # 當推送到 master 分支時觸發
7+
paths:
8+
- "website/**" # 只有當 website 目錄有變更時才觸發
9+
workflow_dispatch: # 允許手動觸發
10+
11+
# 設定 GITHUB_TOKEN 的權限
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# 確保同時只有一個部署任務在執行
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: "18"
34+
cache: "npm"
35+
cache-dependency-path: "website/package-lock.json"
36+
37+
- name: Install dependencies
38+
run: |
39+
cd website
40+
npm i
41+
42+
- name: Build website
43+
run: |
44+
cd website
45+
npm run build
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: "./website/dist"
54+
55+
deploy:
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
runs-on: ubuntu-latest
60+
needs: build
61+
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

.github/workflows/master.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: CI - master
22

33
on:
4-
push:
4+
pull_request:
5+
types: [closed]
56
branches:
67
- "master"
78

@@ -54,6 +55,7 @@ jobs:
5455
bump-version:
5556
name: Bump Version and Update GitHub Variable
5657
runs-on: ubuntu-latest
58+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'build')
5759
outputs:
5860
new_version: ${{ steps.bump.outputs.new_version }}
5961
# needs: unit-test # 等 unit-test 成功才執行
@@ -87,6 +89,7 @@ jobs:
8789
build-image:
8890
name: Build and Push Docker Image
8991
runs-on: ubuntu-latest
92+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'build')
9093
needs:
9194
# - unit-test # 等 unit-test 成功才執行
9295
- bump-version # 等 bump-version 成功才執行

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## [1.1.7] - 2025-08-10
4+
5+
### Fixed
6+
7+
- **[進階篩選設定] Multi_select 欄位篩選無法生成圖表錯誤修復** ([#23](https://github.com/SteveLin100132/notion-chart-generator/issues/23))
8+
9+
- 修正 `multi_select` 類型屬性在進階篩選中使用「包含」和「不包含」操作符時產生的 Notion API 驗證錯誤
10+
- 問題根因:Notion API 要求 `multi_select.contains` 必須是字串值,但前端傳送陣列值 `["前端","後端"]`
11+
- 解決方案:
12+
- 更新 `FilterCondition` 介面,支援陣列值類型 (`string | number | boolean | string[]`)
13+
- 改進 `convertToNotionFilter` 函數中的轉換邏輯,將 `multi_select` 的陣列值正確轉換為多個 `contains` 條件的 `or` 組合
14+
- 區分 `select``multi_select` 的操作符:`select` 使用 `equals``multi_select` 使用 `contains`
15+
- 添加完整的錯誤處理和邊界情況檢查
16+
- 修復檔案:
17+
- `frontend/src/components/query-builder.tsx` - 核心轉換邏輯修復
18+
- `frontend/src/lib/filter-validation.ts` - 類型定義更新
19+
- 現在 `multi_select` 欄位的進階篩選可正常生成圖表,不再出現 API 驗證錯誤
20+
321
## [1.1.6] - 2025-08-09
422

523
### Fixed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<div align="center">
2-
<img src="assets/images/notion-chart-generator-logo.png" width="100" />
3-
<h1>Notion Chart Generator</h1>
2+
<!-- <img src="assets/images/notion-chart-generator-logo.png" width="100" /> -->
3+
<img src="assets/images/notion-chart-generator-title.png" />
4+
<br />
5+
<br />
6+
<i>
7+
一個採用現代前後端分離架構的 Web 應用程式,使用 NestJS + Next.js 技術棧,能夠連接 Notion 資料庫並將資料轉換為互動式圖表。支援多種圖表類型、資料聚合計算、即時分享和跨平台嵌入功能。
8+
</i>
9+
<br />
10+
<br />
11+
12+
![Notion Chart Generator Usage Demo](assets/images/notion-chart-generator-usage-demo.gif)
13+
14+
<br />
415
<div>
516
<img src="https://img.shields.io/github/package-json/v/stevelin100132/notion-chart-generator">
617
<img src="https://img.shields.io/badge/React-18+-61dafb.svg" />
@@ -11,12 +22,10 @@
1122
</div>
1223
</div>
1324

14-
<br />
15-
一個採用現代前後端分離架構的 Web 應用程式,使用 NestJS + Next.js 技術棧,能夠連接 Notion 資料庫並將資料轉換為美觀的互動式圖表。支援多種圖表類型、資料聚合計算、即時分享和跨平台嵌入功能。
1625
<br />
1726
<br />
1827

19-
![Notion Chart Generator Usage Demo](assets/images/notion-chart-generator-usage-demo.gif)
28+
Notion Chart Generator 是一款專為 Notion 使用者打造的圖表生成工具。它能夠連接您的 Notion 資料庫,將原始資料自動轉換為多種互動式圖表,協助您更直觀地分析和展示資訊。無需撰寫程式碼,只需簡單設定,即可快速產生長條圖、線圖、圓餅圖等多種視覺化報表,並支援即時分享與跨平台嵌入,讓資料應用更靈活便利。
2029

2130
## 主要功能
2231

@@ -217,3 +226,7 @@ Query Builder 提供強大且直觀的篩選條件建構功能,讓您能夠建
217226
- 確認選擇的屬性包含有效資料
218227
- 檢查 Y 軸 屬性是否為數字類型
219228
- 確認資料庫中有資料記錄
229+
230+
## Activities
231+
232+
![Alt](https://repobeats.axiom.co/api/embed/cb3faf362bfd9af1b29a17c7b4d948ff63ebe018.svg "Repobeats analytics image")
440 KB
Loading
40.9 KB
Loading
45.9 KB
Loading
287 KB
Loading
123 KB
Loading
44.2 KB
Loading

0 commit comments

Comments
 (0)