Commit 5d658452f4
5d658452f45f1cfb46ecfed260d060f5e56e8c31
parent: 2576082a90
Unsigned
Alicia Sykes <alicia@omg.lol> · 2024-03-01 12:06 UTC
Fixes privacy policy undefined bugs, improves link to listing report
Layout: unified · split
web/src/components/things/PrivacyPolicyDetails.astro
+48 −36
| @@ -23,43 +23,55 @@ const getIconName = (clasification: string) => { |
| 23 | 23 | --- |
| 24 | 24 | |
| 25 | 25 | <div class="privacy-policy-wrapper"> |
| 26 | | <div class="left"> |
| 27 | | <h4>Privacy Policy Summary</h4> |
| 28 | | <ul> |
| 29 | | {priv.points.map((point) => ( |
| 30 | | <li class={`clasification ${point.case.classification}`}> |
| 31 | | <FontAwesome iconName={getIconName(point.case.classification)} /> |
| 32 | | {point.title} |
| 33 | | </li> |
| 34 | | ))} |
| 35 | | </ul> |
| 36 | | </div> |
| 37 | | <div class="right"> |
| 38 | | <h4>Score</h4> |
| 39 | | <div class={`rating rating-${priv.rating}`}> |
| 40 | | <p>{priv.rating}</p> |
| 26 | |
| 27 | {(priv.points && priv.points.length) > 0 && ( |
| 28 | <div class="left"> |
| 29 | <h4>Privacy Policy Summary</h4> |
| 30 | <ul> |
| 31 | {priv.points.map((point) => ( |
| 32 | <li class={`clasification ${point.case.classification}`}> |
| 33 | <FontAwesome iconName={getIconName(point.case.classification)} /> |
| 34 | {point.title} |
| 35 | </li> |
| 36 | ))} |
| 37 | </ul> |
| 41 | 38 | </div> |
| 42 | | <h4>Documents</h4> |
| 43 | | <ul> |
| 44 | | {priv.documents.map((document) => ( |
| 45 | | <li class="list-item"> |
| 46 | | <a href={document.url} target="_blank">{document.name}</a> |
| 47 | | <div class="date-block"> |
| 48 | | Created {formatDate(document.created_at)}, |
| 49 | | Last modified {timeAgo(document.updated_at)} |
| 50 | | </div> |
| 51 | | </li> |
| 52 | | ))} |
| 53 | | </ul> |
| 54 | | <h4>Domains Covered by Policy</h4> |
| 55 | | <ul> |
| 56 | | {priv.urls.map((url) => ( |
| 57 | | <li>{url}</li> |
| 58 | | ))} |
| 59 | | </ul> |
| 60 | | <h4>About the Data</h4> |
| 61 | | <p>This data is kindly provided by <a href="https://tosdr.org/">tosdr.org</a></p> |
| 62 | | <p>View the full report at: <a href={`https://tosdr.org/en/service/${priv.id}`}>tosdr.org/en/service/{priv.id}</a></p> |
| 39 | )} |
| 40 | |
| 41 | <div class="right"> |
| 42 | { priv.rating && ( |
| 43 | <h4>Score</h4> |
| 44 | <div class={`rating rating-${priv.rating}`}> |
| 45 | <p>{priv.rating}</p> |
| 46 | </div> |
| 47 | )} |
| 48 | {priv.documents && priv.documents.length > 0 && ( |
| 49 | <h4>Documents</h4> |
| 50 | <ul> |
| 51 | {priv.documents.map((document) => ( |
| 52 | <li class="list-item"> |
| 53 | <a href={document.url} target="_blank">{document.name}</a> |
| 54 | <div class="date-block"> |
| 55 | Created {formatDate(document.created_at)}, |
| 56 | Last modified {timeAgo(document.updated_at)} |
| 57 | </div> |
| 58 | </li> |
| 59 | ))} |
| 60 | </ul> |
| 61 | )} |
| 62 | {priv.urls && priv.urls.length > 1 && ( |
| 63 | <h4>Domains Covered by Policy</h4> |
| 64 | <ul> |
| 65 | {priv.urls.map((url) => ( |
| 66 | <li>{url}</li> |
| 67 | ))} |
| 68 | </ul> |
| 69 | )} |
| 70 | {priv.points && priv.points.length > 0 && ( |
| 71 | <h4>About the Data</h4> |
| 72 | <p>This data is kindly provided by <a href="https://tosdr.org/">tosdr.org</a></p> |
| 73 | <p>View the full report at: <a href={`https://tosdr.org/en/service/${priv.id}`}>tosdr.org/en/service/{priv.id}</a></p> |
| 74 | )} |
| 63 | 75 | </div> |
| 64 | 76 | </div> |
| 65 | 77 | |
web/src/components/things/ServiceList.astro
+41 −14
| @@ -67,13 +67,16 @@ const { |
| 67 | 67 | src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`} |
| 68 | 68 | /> |
| 69 | 69 | |
| 70 | | {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>} |
| 70 | <a class="service-title" href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}> |
| 71 | {subHeading ? <h4>{service.name}</h4> : <h3>{service.name}</h3>} |
| 72 | </a> |
| 71 | 73 | {service.followWith && <p class="follow-with">({service.followWith})</p> } |
| 72 | 74 | <a class="service-link" href={service.url}>{formatLink(service.url)}</a> |
| 73 | 75 | </div> |
| 74 | 76 | <div class="service-body"> |
| 75 | 77 | <p set:html={parseMarkdown(service.description)}></p> |
| 76 | 78 | <div class="service-stats"> |
| 79 | <div class="left"> |
| 77 | 80 | { service.securityAudited && ( |
| 78 | 81 | <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}> |
| 79 | 82 | <FontAwesome iconName="securityAudited" /> Security Audited |
| @@ -108,6 +111,7 @@ const { |
| 108 | 111 | </a> |
| 109 | 112 | </span> |
| 110 | 113 | ) } |
| 114 | </div> |
| 111 | 115 | <div class="view-service"> |
| 112 | 116 | <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a> |
| 113 | 117 | </div> |
| @@ -156,10 +160,15 @@ const { |
| 156 | 160 | align-items: center; |
| 157 | 161 | gap: 0.5rem; |
| 158 | 162 | flex-wrap: wrap; |
| 159 | | h3, h4 { |
| 160 | | margin: 0; |
| 161 | | font-size: 1.6rem; |
| 163 | .service-title { |
| 164 | text-decoration: none; |
| 165 | color: var(--foreground); |
| 166 | h3, h4 { |
| 167 | margin: 0; |
| 168 | font-size: 1.6rem; |
| 169 | } |
| 162 | 170 | } |
| 171 | |
| 163 | 172 | .service-icon { |
| 164 | 173 | width: 2.5rem; |
| 165 | 174 | height: 2.5rem; |
| @@ -193,10 +202,37 @@ const { |
| 193 | 202 | } |
| 194 | 203 | } |
| 195 | 204 | .service-stats { |
| 205 | .left { |
| 206 | display: flex; |
| 207 | gap: 1rem; |
| 208 | flex-wrap: wrap; |
| 209 | align-items: center; |
| 210 | } |
| 196 | 211 | display: flex; |
| 197 | 212 | gap: 1rem; |
| 198 | 213 | flex-wrap: wrap; |
| 214 | align-items: center; |
| 215 | justify-content: space-between; |
| 199 | 216 | } |
| 217 | .view-service { |
| 218 | transition: all 0.2s ease-in-out; |
| 219 | opacity: 0.8; |
| 220 | a { |
| 221 | padding: 0.25rem 0.6rem; |
| 222 | width: fit-content; |
| 223 | right: 1rem; |
| 224 | font-size: 0.9rem; |
| 225 | background: var(--accent-3); |
| 226 | color: var(--accent-fg); |
| 227 | text-decoration: none; |
| 228 | border-radius: var(--curve-md); |
| 229 | } |
| 230 | &:hover { |
| 231 | opacity: 1; |
| 232 | transform: scale(1.05); |
| 233 | } |
| 234 | } |
| 235 | |
| 200 | 236 | .meta-item, .warning { |
| 201 | 237 | display: flex; |
| 202 | 238 | align-items: center; |
| @@ -239,16 +275,7 @@ const { |
| 239 | 275 | } |
| 240 | 276 | } |
| 241 | 277 | |
| 242 | | .view-service { |
| 243 | | a { |
| 244 | | padding: 0.25rem 0.6rem; |
| 245 | | color: var(--accent-3); |
| 246 | | width: fit-content; |
| 247 | | position: absolute; |
| 248 | | right: 1rem; |
| 249 | | transform: scale(0.8); |
| 250 | | } |
| 251 | | } |
| 278 | |
| 252 | 279 | |
| 253 | 280 | section :global(.view-all) { |
| 254 | 281 | width: fit-content; |
web/src/pages/[...listing].astro
+3 −1
| @@ -121,10 +121,12 @@ export async function getStaticPaths() { |
| 121 | 121 | // const { previous, next } = makePaginationLinks(); |
| 122 | 122 | |
| 123 | 123 | |
| 124 | const ignoredSites = ['github.gom', 'wikipedia.']; |
| 125 | |
| 124 | 126 | // Fetch detailed data about the services GitHub repo, privacy policy and website |
| 125 | 127 | const githubData = github ? await fetchGitHubStats(github) : null; |
| 126 | 128 | const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; |
| 127 | | const websiteData = (url && !url.includes('github.com')) ? await fetchWebsiteInfo(url) : null; |
| 129 | const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null; |
| 128 | 130 | |
| 129 | 131 | --- |
| 130 | 132 | |