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<div class="privacy-policy-wrapper"> 25<div class="privacy-policy-wrapper">
26 <div class="left"> 26
27 <h4>Privacy Policy Summary</h4> 27 {(priv.points && priv.points.length) > 0 && (
28 <ul> 28 <div class="left">
29 {priv.points.map((point) => ( 29 <h4>Privacy Policy Summary</h4>
30 <li class={`clasification ${point.case.classification}`}> 30 <ul>
31 <FontAwesome iconName={getIconName(point.case.classification)} /> 31 {priv.points.map((point) => (
32 {point.title} 32 <li class={`clasification ${point.case.classification}`}>
33 </li> 33 <FontAwesome iconName={getIconName(point.case.classification)} />
34 ))} 34 {point.title}
35 </ul> 35 </li>
36 </div> 36 ))}
37 <div class="right"> 37 </ul>
38 <h4>Score</h4>
39 <div class={`rating rating-${priv.rating}`}>
40 <p>{priv.rating}</p>
41 </div> 38 </div>
42 <h4>Documents</h4> 39 )}
43 <ul> 40
44 {priv.documents.map((document) => ( 41 <div class="right">
45 <li class="list-item"> 42 { priv.rating && (
46 <a href={document.url} target="_blank">{document.name}</a> 43 <h4>Score</h4>
47 <div class="date-block"> 44 <div class={`rating rating-${priv.rating}`}>
48 Created {formatDate(document.created_at)}, 45 <p>{priv.rating}</p>
49 Last modified {timeAgo(document.updated_at)} 46 </div>
50 </div> 47 )}
51 </li> 48 {priv.documents && priv.documents.length > 0 && (
52 ))} 49 <h4>Documents</h4>
53 </ul> 50 <ul>
54 <h4>Domains Covered by Policy</h4> 51 {priv.documents.map((document) => (
55 <ul> 52 <li class="list-item">
56 {priv.urls.map((url) => ( 53 <a href={document.url} target="_blank">{document.name}</a>
57 <li>{url}</li> 54 <div class="date-block">
58 ))} 55 Created {formatDate(document.created_at)},
59 </ul> 56 Last modified {timeAgo(document.updated_at)}
60 <h4>About the Data</h4> 57 </div>
61 <p>This data is kindly provided by <a href="https://tosdr.org/">tosdr.org</a></p> 58 </li>
62 <p>View the full report at: <a href={`https://tosdr.org/en/service/${priv.id}`}>tosdr.org/en/service/{priv.id}</a></p> 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 </div> 75 </div>
64</div> 76</div>
65 77
web/src/components/things/ServiceList.astro +41 −14
@@ -67,13 +67,16 @@ const {
67 src={service.icon || `https://icon.horse/icon/${formatLink(service.url)}`} 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 {service.followWith && <p class="follow-with">({service.followWith})</p> } 73 {service.followWith && <p class="follow-with">({service.followWith})</p> }
72 <a class="service-link" href={service.url}>{formatLink(service.url)}</a> 74 <a class="service-link" href={service.url}>{formatLink(service.url)}</a>
73 </div> 75 </div>
74 <div class="service-body"> 76 <div class="service-body">
75 <p set:html={parseMarkdown(service.description)}></p> 77 <p set:html={parseMarkdown(service.description)}></p>
76 <div class="service-stats"> 78 <div class="service-stats">
79 <div class="left">
77 { service.securityAudited && ( 80 { service.securityAudited && (
78 <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}> 81 <span class="meta-item great" title={`${service.name} has been security audited by an accredited auditor, with results published publicly`}>
79 <FontAwesome iconName="securityAudited" /> Security Audited 82 <FontAwesome iconName="securityAudited" /> Security Audited
@@ -108,6 +111,7 @@ const {
108 </a> 111 </a>
109 </span> 112 </span>
110 ) } 113 ) }
114 </div>
111 <div class="view-service"> 115 <div class="view-service">
112 <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a> 116 <a href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}>View {service.name} Report</a>
113 </div> 117 </div>
@@ -156,10 +160,15 @@ const {
156 align-items: center; 160 align-items: center;
157 gap: 0.5rem; 161 gap: 0.5rem;
158 flex-wrap: wrap; 162 flex-wrap: wrap;
159 h3, h4 { 163 .service-title {
160 margin: 0; 164 text-decoration: none;
161 font-size: 1.6rem; 165 color: var(--foreground);
166 h3, h4 {
167 margin: 0;
168 font-size: 1.6rem;
169 }
162 } 170 }
171
163 .service-icon { 172 .service-icon {
164 width: 2.5rem; 173 width: 2.5rem;
165 height: 2.5rem; 174 height: 2.5rem;
@@ -193,10 +202,37 @@ const {
193 } 202 }
194 } 203 }
195 .service-stats { 204 .service-stats {
205 .left {
206 display: flex;
207 gap: 1rem;
208 flex-wrap: wrap;
209 align-items: center;
210 }
196 display: flex; 211 display: flex;
197 gap: 1rem; 212 gap: 1rem;
198 flex-wrap: wrap; 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 .meta-item, .warning { 236 .meta-item, .warning {
201 display: flex; 237 display: flex;
202 align-items: center; 238 align-items: center;
@@ -239,16 +275,7 @@ const {
239 } 275 }
240 } 276 }
241 277
242.view-service { 278
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}
252 279
253section :global(.view-all) { 280section :global(.view-all) {
254 width: fit-content; 281 width: fit-content;
web/src/pages/[...listing].astro +3 −1
@@ -121,10 +121,12 @@ export async function getStaticPaths() {
121// const { previous, next } = makePaginationLinks(); 121// const { previous, next } = makePaginationLinks();
122 122
123 123
124const ignoredSites = ['github.gom', 'wikipedia.'];
125
124// Fetch detailed data about the services GitHub repo, privacy policy and website 126// Fetch detailed data about the services GitHub repo, privacy policy and website
125const githubData = github ? await fetchGitHubStats(github) : null; 127const githubData = github ? await fetchGitHubStats(github) : null;
126const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; 128const 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;
128 130
129--- 131---
130 132