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) => {
2323---
2424
2525<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>
4138 </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 )}
6375 </div>
6476</div>
6577
web/src/components/things/ServiceList.astro +41 −14
@@ -67,13 +67,16 @@ const {
6767 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`}
6868 />
6969
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>
7173 {service.followWith && <p class="follow-with">({service.followWith})</p> }
7274 <a class="service-link" href={service.url}>{formatLink(service.url)}</a>
7375 </div>
7476 <div class="service-body">
7577 <p set:html={parseMarkdown(service.description)}></p>
7678 <div class="service-stats">
79 <div class="left">
7780 { service.securityAudited && (
7881 <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}>
7982 <FontAwesome iconName="securityAudited" /> Security Audited
@@ -108,6 +111,7 @@ const {
108111 </a>
109112 </span>
110113 ) }
114 </div>
111115 <div class="view-service">
112116 <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a>
113117 </div>
@@ -156,10 +160,15 @@ const {
156160 align-items: center;
157161 gap: 0.5rem;
158162 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 }
162170 }
171
163172 .service-icon {
164173 width: 2.5rem;
165174 height: 2.5rem;
@@ -193,10 +202,37 @@ const {
193202 }
194203 }
195204 .service-stats {
205 .left {
206 display: flex;
207 gap: 1rem;
208 flex-wrap: wrap;
209 align-items: center;
210 }
196211 display: flex;
197212 gap: 1rem;
198213 flex-wrap: wrap;
214 align-items: center;
215 justify-content: space-between;
199216 }
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
200236 .meta-item, .warning {
201237 display: flex;
202238 align-items: center;
@@ -239,16 +275,7 @@ const {
239275 }
240276 }
241277
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
252279
253280section :global(.view-all) {
254281 width: fit-content;
web/src/pages/[...listing].astro +3 −1
@@ -121,10 +121,12 @@ export async function getStaticPaths() {
121121// const { previous, next } = makePaginationLinks();
122122
123123
124const ignoredSites = ['github.gom', 'wikipedia.'];
125
124126// Fetch detailed data about the services GitHub repo, privacy policy and website
125127const githubData = github ? await fetchGitHubStats(github) : null;
126128const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null;
127const websiteData = (url && !url.includes('github.com')) ? await fetchWebsiteInfo(url) : null;
129const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null;
128130
129131---
130132