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

テスト結果ID 440 から 580 の追加 #157

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions data/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
author: ウェブアクセシビリティ基盤委員会(WAIC)
pub_date: 2020年4月1日
mod_date: 2024年**月**日
last_reviewed_result_id: 439
status: レビュー作業中の情報が含まれることがあります
2,173 changes: 2,173 additions & 0 deletions data/results.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions data/techs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ C9:
C15:
title: ユーザインタフェースコンポーネントがフォーカスを受けとったときの提示を変更するために、CSS を使用する
target:
C18:
title: レイアウトデザインのためのスペーサー画像ではなく、CSS のマージンとパディング規則を使用する
target:
ARIA1:
title: ユーザインターフェース コントロールに対する説明ラベルを提供するために、aria-describedby プロパティを使用する
target:
Expand Down
18 changes: 13 additions & 5 deletions data/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -850,21 +850,27 @@
title: テキストフィールドにラベルを付けるために aria-labelledby を使用する
code: https://waic.github.io/as_test/WAIC-CODE/WAIC-CODE-0047-01.html
document: https://github.com/waic/as_test/blob/master/WAIC-TEST/HTML/WAIC-TEST-0047-01.md
criteria: []
criteria:
- 1.3.1
- 4.1.2
techs:
- ARIA16
0047-02:
title: スライダーコントロールにラベルを付けるために aria-labelledby を使用する
code: https://waic.github.io/as_test/WAIC-CODE/WAIC-CODE-0047-02.html
document: https://github.com/waic/as_test/blob/master/WAIC-TEST/HTML/WAIC-TEST-0047-02.md
criteria: []
criteria:
- 1.3.1
- 4.1.2
techs:
- ARIA16
0047-03:
title: 複数のラベルを付けるために aria-labelledby を使用する
code: https://waic.github.io/as_test/WAIC-CODE/WAIC-CODE-0047-03.html
document: https://github.com/waic/as_test/blob/master/WAIC-TEST/HTML/WAIC-TEST-0047-03.md
criteria: []
criteria:
- 1.3.1
- 4.1.2
techs:
- ARIA9
- ARIA16
Expand Down Expand Up @@ -924,7 +930,8 @@
title: アイコンフォントに意味を付与するために role="img" を使用
code: https://waic.github.io/as_test/WAIC-CODE/WAIC-CODE-0053-01.html
document: https://github.com/waic/as_test/blob/master/WAIC-TEST/HTML/WAIC-TEST-0053-01.md
criteria: []
criteria:
- 1.3.1
techs:
- ARIA24
0054-01:
Expand Down Expand Up @@ -965,7 +972,8 @@
title: レイアウトデザインのためのスペーサー画像ではなく、CSS を使用する(マージンとパディング)
code: https://waic.github.io/as_test/WAIC-CODE/WAIC-CODE-0056-01.html
document: https://github.com/waic/as_test/blob/master/WAIC-TEST/HTML/WAIC-TEST-0056-01.md
criteria: []
criteria:
- 1.1.1
techs:
- C18
0057-01:
Expand Down
1 change: 1 addition & 0 deletions pages/criteria/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const Criterion = ({ query }) => {
/>
<ul>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>検証結果を含む達成方法</h2>
{queryTechs(true_id).length > 0 ? (
Expand Down
1 change: 1 addition & 0 deletions pages/criteria/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Index = () =>
<h1>アクセシビリティ サポーテッド(AS)情報</h1>
<ul>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>達成基準の一覧</h2>
<ul>
Expand Down
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import SEO from '../next-seo.config'
import Link from 'next/link'
import { getCriterionLevel } from '../functions/getCriterionLevel'
import { queryCriteriaWithTests } from '../functions/queryCriteriaWithTests'
import { getResultsCount } from '../functions/getResultsCount';

const Index = () =>
<>
Expand All @@ -25,6 +26,7 @@ const Index = () =>
<li>公開日:{metadata.pub_date}</li>
<li>更新日:{metadata.mod_date}</li>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>検証結果を含む達成基準</h2>
<ul>
Expand All @@ -44,7 +46,7 @@ const Index = () =>
<ul>
{Object.keys(tests).map(
key => <li key={key}>
<Link href={'results/' + key + '.html'}>{key}: {tests[key].title}</Link>
<Link href={'results/' + key + '.html'}>{key}: {tests[key].title} (結果: {getResultsCount(key)}件)</Link>
</li>
)}
</ul>
Expand Down
58 changes: 44 additions & 14 deletions pages/results/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ function Comment(props: { result: ResultData; }) {
return nl2br(comments);
}

const InReview = ({ resultId }: { resultId: number }) => {
const { last_reviewed_result_id } = metadata;
return resultId > last_reviewed_result_id ? <span>[WAICレビュー作業中]</span> : null;
};

function Judgment(props: { resultContent: ResultContent; }) {
const { judgment } = props.resultContent;
switch (judgment) {
case '満たしている':
return <>○</>;
case '満たしていない':
return <>×</>;
default:
return <>{judgment}</>;
}
};

const ResultTableRow = (props: { result: ResultData; }) => {
const result = props.result;
const contents = result.contents;
Expand All @@ -78,7 +95,7 @@ const ResultTableRow = (props: { result: ResultData; }) => {
{result.assistive_tech_config && (<li style={list_item_style}>{nl2br(result.assistive_tech_config)}</li>)}
</ul></td>
<td>
{contents[0].judgment === '満たしている' ? '○' : '×'}
<Judgment resultContent={contents[0]}/>
</td>
<td style={larger_th_style}>
{nl2br(contents[0].procedure)}
Expand All @@ -88,7 +105,10 @@ const ResultTableRow = (props: { result: ResultData; }) => {
</td>
<td style={larger_th_style}>{getTesterName(result)}</td>
<td style={larger_th_style}>{getDate(result)}</td>
<td style={larger_th_style}><Comment result={result} /></td>
<td style={larger_th_style}>
<InReview resultId={result.id} />
<Comment result={result} />
</td>
</tr>
);
}
Expand All @@ -108,7 +128,7 @@ const ResultTableRow = (props: { result: ResultData; }) => {
</>
)}
<td>
{item.judgment === '満たしている' ? '○' : '×'}
<Judgment resultContent={item} />
</td>
<td style={larger_th_style}>
{nl2br(item.procedure)}
Expand All @@ -120,7 +140,10 @@ const ResultTableRow = (props: { result: ResultData; }) => {
<>
<td rowSpan={contents.length} style={larger_th_style}>{getTesterName(result)}</td>
<td rowSpan={contents.length} style={larger_th_style}>{getDate(result)}</td>
<td rowSpan={contents.length} style={larger_th_style}><Comment result={result} /></td>
<td rowSpan={contents.length} style={larger_th_style}>
<InReview resultId={result.id} />
<Comment result={result} />
</td>
</>
)}
</tr>
Expand All @@ -129,6 +152,21 @@ const ResultTableRow = (props: { result: ResultData; }) => {
)
};

const sortByOS = (a: ResultData, b: ResultData) => {
let a_env = (typeof a.os === 'undefined') ? '' : a.os.toLowerCase();
let b_env = (typeof b.os === 'undefined') ? '' : b.os.toLowerCase();
if (a_env > b_env) {
return 1;
} else if (a_env == b_env) {
return 0;
}
return -1;
};

const sortByResultId = (a: ResultData, b: ResultData) => {
return a.id - b.id;
};

const Result = ({ query }) => {
const router = useRouter()
if (router.isFallback) {
Expand All @@ -142,16 +180,7 @@ const Result = ({ query }) => {
const test = tests[true_id];
const criterion_ids = test.criteria;
const tech_ids = test.techs;
const result_ids = results.filter(result => result.test === true_id).sort((a, b) => {
let a_env = (typeof a.os === 'undefined') ? '' : a.os.toLowerCase();
let b_env = (typeof b.os === 'undefined') ? '' : b.os.toLowerCase();
if (a_env > b_env) {
return 1;
} else if (a_env == b_env) {
return 0;
}
return -1;
});
const result_ids = results.filter(result => result.test === true_id).sort(sortByResultId);
return (
<>
<NextSeo {...Object.assign(SEO, { title: 'テスト' + true_id })} />
Expand All @@ -163,6 +192,7 @@ const Result = ({ query }) => {
/>
<ul>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>テストの対象となる達成基準</h2>
<ul>
Expand Down
1 change: 1 addition & 0 deletions pages/techs/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Tech = ({ query }) => {
/>
<ul>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>テストの対象となる達成基準</h2>
<ul>
Expand Down
1 change: 1 addition & 0 deletions pages/techs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Index = () =>
<h1>アクセシビリティ サポーテッド(AS)情報</h1>
<ul>
<li>作成者:{metadata.author}</li>
{metadata.status && <li>注記:{metadata.status}</li>}
</ul>
<h2>達成方法の一覧</h2>
<ul>
Expand Down
2 changes: 2 additions & 0 deletions types/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ export interface Metadata {
author: string;
pub_date: string;
mod_date: number;
last_reviewed_result_id: number;
status: string;
}
Loading