Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into user_login
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuagraber committed Mar 7, 2024
2 parents fa5e17a + 7a7451b commit 3fab966
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 285 deletions.
10 changes: 5 additions & 5 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint-plugin-vue": "^9.20.1",
"happy-dom": "^13.1.4",
"jest-serializer-vue-tjw": "^3.20.0",
"pdap-design-system": "^2.4.1",
"pdap-design-system": "^2.5.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"vite": "^4.5.1",
Expand Down
64 changes: 31 additions & 33 deletions client/src/components/SearchResultCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,32 @@
class="flex flex-col border border-neutral-400 p-3 text-lg leading-snug"
data-test="search-result-card"
>
<h2
class="text-xl font-semibold line-clamp-2"
<h3
class="text-xl font-semibold line-clamp-2 normal-case tracking-normal min-h-[50px]"
data-test="search-result-title"
>
{{ dataSource.data_source_name }}
</h2>
</h3>

<Button
:class="['text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full']"
:disabled="
!dataSource.source_url ||
dataSource.url_status === 'broken' ||
dataSource.url_status === 'not found'
"
data-test="search-result-visit-source-button"
@click="
dataSource.source_url &&
dataSource.url_status !== 'broken' &&
dataSource.url_status !== 'not found'
? openSource()
: null
"
>
Visit data source <i class="fa fa-external-link" />
</Button>

<p
class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"
data-test="search-result-record-label"
Expand Down Expand Up @@ -100,36 +120,14 @@
</li>
</ul>
<p v-else data-test="search-result-format-unknown">Unknown</p>
<div class="mt-auto flex flex-col">
<Button
:class="['text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full']"
:disabled="
!dataSource.source_url ||
dataSource.url_status === 'broken' ||
dataSource.url_status === 'not found'
"
data-test="search-result-visit-source-button"
@click="
Boolean(
dataSource.source_url &&
dataSource.url_status !== 'broken' &&
dataSource.url_status !== 'not found',
)
? openSource()
: null
"
>
Visit data source <i class="fa fa-external-link" />
</Button>
<Button
intent="secondary"
class="text-lg font-medium px-4 py-1 lg:mx-0 max-w-full"
data-test="search-result-source-details-button"
@click="showDetails"
>
View details
</Button>
</div>
<Button
intent="secondary"
class="text-lg font-medium px-4 py-1 lg:mx-0 max-w-full mt-auto"
data-test="search-result-source-details-button"
@click="showDetails"
>
More details
</Button>
</GridItem>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

exports[`SearchResultCard with all data > search result card exists with full data 1`] = `
<div class="pdap-grid-item flex flex-col border border-neutral-400 p-3 text-lg leading-snug">
<h2 class="text-xl font-semibold line-clamp-2">Calls for Service for Cicero Police Department - IN</h2>
<h3 class="text-xl font-semibold line-clamp-2 normal-case tracking-normal min-h-[50px]">Calls for Service for Cicero Police Department - IN</h3>
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full"> Visit data source <i class="fa fa-external-link"></i>
</button>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Record type </p>
<div class="mt-1 py-[.125rem] px-3 rounded-full bg-brand-wine/10 dark:bg-brand-wine dark:text-white w-fit">Calls for Service</div>
<div class="search-result-agency">
Expand Down Expand Up @@ -46,17 +48,15 @@ exports[`SearchResultCard with all data > search result card exists with full da
<li class="mt-1 py-[.125rem] px-3 rounded-full bg-slate-200 dark:bg-slate-600 w-fit">'</li>
<li class="mt-1 py-[.125rem] px-3 rounded-full bg-slate-200 dark:bg-slate-600 w-fit">]</li>
</ul>
<div class="mt-auto flex flex-col">
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full"> Visit data source <i class="fa fa-external-link"></i>
</button>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full"> View details </button>
</div>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full mt-auto"> More details </button>
</div>
`;

exports[`SearchResultCard with coverage end but not start > search result card exists with coverage end but not start 1`] = `
<div class="pdap-grid-item flex flex-col border border-neutral-400 p-3 text-lg leading-snug">
<h2 class="text-xl font-semibold line-clamp-2"></h2>
<h3 class="text-xl font-semibold line-clamp-2 normal-case tracking-normal min-h-[50px]"></h3>
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Record type </p>
<p>Unknown</p>
<div class="search-result-agency">
Expand Down Expand Up @@ -84,17 +84,15 @@ exports[`SearchResultCard with coverage end but not start > search result card e
<p> Unknown start–2016</p>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Formats available </p>
<p>Unknown</p>
<div class="mt-auto flex flex-col">
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full"> View details </button>
</div>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full mt-auto"> More details </button>
</div>
`;

exports[`SearchResultCard with coverage start but not end > search result card exists with coverage start but not end 1`] = `
<div class="pdap-grid-item flex flex-col border border-neutral-400 p-3 text-lg leading-snug">
<h2 class="text-xl font-semibold line-clamp-2"></h2>
<h3 class="text-xl font-semibold line-clamp-2 normal-case tracking-normal min-h-[50px]"></h3>
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Record type </p>
<p>Unknown</p>
<div class="search-result-agency">
Expand Down Expand Up @@ -122,17 +120,15 @@ exports[`SearchResultCard with coverage start but not end > search result card e
<p>2016–Unknown end </p>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Formats available </p>
<p>Unknown</p>
<div class="mt-auto flex flex-col">
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full"> View details </button>
</div>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full mt-auto"> More details </button>
</div>
`;

exports[`SearchResultCard with missing data > search result card exists with missing data 1`] = `
<div class="pdap-grid-item flex flex-col border border-neutral-400 p-3 text-lg leading-snug">
<h2 class="text-xl font-semibold line-clamp-2">Calls for Service for Cicero Police Department - IN</h2>
<h3 class="text-xl font-semibold line-clamp-2 normal-case tracking-normal min-h-[50px]">Calls for Service for Cicero Police Department - IN</h3>
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Record type </p>
<p>Unknown</p>
<div class="search-result-agency">
Expand Down Expand Up @@ -160,10 +156,6 @@ exports[`SearchResultCard with missing data > search result card exists with mis
<p>Unknown</p>
<p class="text-brand-wine dark:text-white font-semibold text-sm uppercase tracking-wider mb-0 mt-4"> Formats available </p>
<p>Unknown</p>
<div class="mt-auto flex flex-col">
<button class="pdap-button pdap-button-primary text-lg font-medium px-4 py-1 mt-4 mb-2 lg:mx-0 max-w-full" disabled> Visit data source <i class="fa fa-external-link"></i>
</button>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full"> View details </button>
</div>
<button class="pdap-button pdap-button-secondary text-lg font-medium px-4 py-1 lg:mx-0 max-w-full mt-auto"> More details </button>
</div>
`;
3 changes: 2 additions & 1 deletion client/src/pages/DataSourceStaticView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
import axios from 'axios';
import { Button } from 'pdap-design-system';
import formatDateForSearchResults from '../util/formatDate';
import { STATIC_VIEW_UI_SHAPE } from './util';
import { STATIC_VIEW_UI_SHAPE } from '../util/pageData.js';
export default {
name: 'DataSourceStaticView',
Expand Down Expand Up @@ -198,3 +198,4 @@ export default {
@apply my-2;
}
</style>
./pageData
Loading

0 comments on commit 3fab966

Please sign in to comment.