-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add supports table, group issues by principle
- Loading branch information
1 parent
e545c1f
commit 7d18565
Showing
13 changed files
with
84 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import successCriteria from '../_data/successcriteria.js'; | ||
|
||
export default async function scSupport(partiallySupported, unsupported) { | ||
partiallySupported ||= []; | ||
unsupported ||= []; | ||
|
||
let criteria; | ||
|
||
try { | ||
criteria = await successCriteria(); | ||
} catch (error) { | ||
console.error(`Fetch failed in sc-support.js. ${error}`); | ||
} | ||
|
||
let output = ` | ||
<table class="sc-table"> | ||
<thead> | ||
<tr> | ||
<th>Success criteria</th> | ||
<th>Level</th> | ||
<th>Support</th> | ||
</tr> | ||
</thead> | ||
<tbody>`; | ||
|
||
for (const key in criteria) { | ||
if (Object.hasOwn(criteria, key)) { | ||
let support = 'Supported'; | ||
|
||
if (unsupported.includes(key)) { | ||
support = 'Unsupported'; | ||
} | ||
|
||
if (partiallySupported.includes(key)) { | ||
support = 'Partially Supported'; | ||
} | ||
|
||
output += `<tr><td>${key}: ${criteria[key].name}</td><td>${criteria[key].level}</td><td>${support}</td></tr>`; | ||
} | ||
} | ||
|
||
output += `<tbody> | ||
</table>`; | ||
|
||
return output; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.