Skip to content

Communications changes #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 83 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<link rel="icon" type="image/svg+xml" href="/flying-t.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script
src="https://js.arcgis.com/calcite-components/2.11.1/calcite.esm.js"
type="module"
integrity="sha512-ccUtzrBcR+43lxCXJGVzFZR9693G5y+w+dgdQYafW4InK4hpXy1nMOTGG4dcgNueOfD83WpAqAH7xRFDd8tAjQ=="
src="https://js.arcgis.com/calcite-components/2.12.0/calcite.esm.js"
integrity="sha512-RAXhRi2FAsHCStD8ZKnMfRRik2BDzLU+Xw7yHMvoCORLdboys+etE/dAJkiKm9/2znBCHSAbksFj5zXz0kjj7A=="
crossorigin="anonymous"
type="module"
></script>
<link
rel="stylesheet"
href="https://js.arcgis.com/calcite-components/2.11.1/calcite.css"
integrity="sha512-f+iTm+8EkjFYKsXYPnkRR4UVV7Lwyfq/fNzUgV6Bdk8hcFG1416cZ0kwi1Qf+lL0og5uGOqvcjGEMVaHcZQtuA=="
href="https://js.arcgis.com/calcite-components/2.12.0/calcite.css"
integrity="sha512-31dpVzht3E7RMB8NGVGCXdw9YurzK+umqNg1JXG00Mri09sZx/sgzhPsFu0g7rofI5SI2bb4xXoquKrptCZpnQ=="
crossorigin="anonymous"
/>
<link
Expand All @@ -31,7 +31,7 @@
<wsdot-header slot="header">
<span slot="title">%VITE_HEADER_TITLE%</span>
</wsdot-header>
<calcite-shell-panel slot="panel-start" id="sidebar" collapsed>
<calcite-shell-panel slot="panel-start" id="sidebar">
<calcite-panel>
<calcite-block
id="route-input-form-block"
Expand Down Expand Up @@ -98,10 +98,10 @@
</form>
</template>
</calcite-block>
<calcite-block heading="Layer List" collapsible open>
<calcite-block heading="Layer List" collapsible>
<div id="layerlist"></div>
</calcite-block>
<calcite-block heading="Legend" collapsible open>
<calcite-block heading="Legend" collapsible>
<div id="legend"></div>
</calcite-block>
</calcite-panel>
Expand Down Expand Up @@ -133,6 +133,81 @@
<a href="https://get.webgl.org/webgl2/">WebGL2</a>.
</p>
</template>
<calcite-dialog
slot="dialogs"
id="disclaimer-dialog"
modal
kind="info"
placement="center"
heading="Disclaimer of warranties and limitations of liabilities"
description="Read our disclaimer before making use of information on this website."
>
<p>
By making use of any information on this website, you agree to the
following:
</p>

<p>
WSDOT endeavors to provide reliable information on this website.
However, the information is provided on an "as-is" and "as available"
basis and may include errors, omissions, or other inaccuracies.
</p>

<p>
You assume the sole risk of making use of the information contained on
this website. You are advised to not solely rely on the information on
this website for any reason.
</p>

<p>
No representations, warranties, and/or promises of any kind, expressed
or implied, are given as to the nature, standard, accuracy, timeliness,
completeness, reliability, legality, or otherwise of the information
provided in this website nor to the suitability or otherwise of the
information to your particular circumstances. WSDOT expressly disclaims
all warranties, express or implied, including, without limitation, any
warranty of merchantability, fitness for a particular purpose, or
non-infringement or any other implied warranty under the uniform
computer information transactions act as enacted by any state. There are
no warranties which extend beyond the description hereof.
</p>

<p>
WSDOT cannot and will not guarantee that this website is free from
computer viruses or anything else that has destructive properties.
</p>

<p>
In no event shall WSDOT be liable for any indirect, punitive,
incidental, special, or consequential damages including, but not limited
to, loss of profits, loss of data, loss of business or other loss
arising out of or in any way connected with the use of (or inability to
use) this website or from your use of (or failure to use) the
information on this site, whether based in contract, negligence, tort,
strict liability, or otherwise, even if WSDOT has been advised of the
possibility of such damages.
</p>

<p>
This website provides links to other websites owned by third parties.
The content of such third party sites is not within
WSDOT&CloseCurlyQuote;s control, and we cannot and will not take
responsibility for the information or content thereon. Links to such
third party sites are not to be taken as an endorsement by WSDOT of the
third party site, or any information or products promoted, offered or
sold on the third party site, nor that such sites are free from computer
viruses or anything else that has destructive properties. WSDOT cannot
and does not take responsibility for the collection or use of personal
data from any third party site. In addition, WSDOT will not accept
responsibility for the accuracy, relevancy, timeliness, or completeness
of any information or advertising on these third party websites.
</p>
<footer slot="footer">
&copy;
<abbr title="Washington State Department of Transportation">WSDOT</abbr>
All Rights Reserved
</footer>
</calcite-dialog>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
77 changes: 0 additions & 77 deletions src/components/disclaimer/content.html

This file was deleted.

35 changes: 13 additions & 22 deletions src/components/disclaimer/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
import content from "./content.html?raw";

/**
* Creates the disclaimer modal
* @returns The disclaimer modal
*/
export function createModal() {
const modal = document.createElement("calcite-modal");
modal.setAttribute("aria-labelledby", "modal-title");

modal.innerHTML = content;
return modal;
}

/**
* Sets up a link to open a modal when it is clicked.
* @param link - The link that will open the modal when clicked.
* @param modal - The modal that will be opened. If omitted, a new
* @param dialog - The modal that will be opened. If omitted, a new
* one will be created and appended to the document.
* @returns The link and the modal.
*/
export function setupDisclaimerLink(
link: HTMLElement,
modal?: HTMLCalciteModalElement,
dialog?: HTMLCalciteDialogElement,
) {
if (!modal) {
modal = createModal();
document.body.appendChild(modal);
if (!dialog) {
dialog =
document.body.querySelector<HTMLCalciteDialogElement>(
"#disclaimer-dialog",
) ?? undefined;
}
if (!dialog) {
throw new Error("Could not find disclaimer dialog.");
}
if (/WSDOT-FOOTER/i.test(link.tagName)) {
// Setup disclaimer modal
link.addEventListener("disclaimer-link-clicked", () => {
modal.open = true;
dialog.open = true;
});
} else {
// Setup disclaimer modal
link.addEventListener("click", (e) => {
modal.open = true;
dialog.open = true;
e.preventDefault();
});
}

return {
modal,
modal: dialog,
link,
};
}
33 changes: 1 addition & 32 deletions src/components/wsdot-header/content.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
<header>
<div><!-- blank space --></div>
<div class="logo-section">
<a href="https://wsdot.wa.gov" target="_blank" rel="noopener noreferrer">
<img
class="wsdot-logo-white"
alt="Washington State Department of Transportation"
/>
</a>
<h1><slot name="title"></slot></h1>
</div>
<h1><slot name="title"></slot></h1>
</header>

<calcite-navigation>
<calcite-menu slot="content-center">
<calcite-menu-item
text="Travel"
href="https://wsdot.wa.gov/travel"
target="_blank"
></calcite-menu-item>
<calcite-menu-item
text="Construction & planning"
href="https://wsdot.wa.gov/construction-planning"
target="_blank"
></calcite-menu-item>
<calcite-menu-item
text="Business with WSDOT"
href="https://wsdot.wa.gov/business-wsdot"
target="_blank"
></calcite-menu-item>
<calcite-menu-item
text="Engineering & standards"
href="https://wsdot.wa.gov/engineering-standards"
target="_blank"
></calcite-menu-item>
<calcite-menu-item
text="About"
href="https://wsdot.wa.gov/about"
target="_blank"
></calcite-menu-item>
</calcite-menu>
</calcite-navigation>
19 changes: 6 additions & 13 deletions src/components/wsdot-header/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,18 @@
padding-bottom: 8px;
}

calcite-navigation {
max-height: 44px;
}

.logo-section > a {
padding-left: 20px;
margin-top: 8px;
margin-bottom: 8px;
}

h1 {
display: inline;
text-align: right;
margin-left: 1em;
color: white;
}

header {
background-color: var(--wsdot-logo-green);
display: grid;
grid-template-columns: 1fr 4fr 1fr;
display: flex;
flex: auto;
h1 {
margin-left: 1em;
color: white;
}
}
10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import config from "@arcgis/core/config";
import { whenOnce } from "@arcgis/core/core/reactiveUtils";
import PortalItem from "@arcgis/core/portal/PortalItem";
import MapView from "@arcgis/core/views/MapView";
import Expand from "@arcgis/core/widgets/Expand";
import Home from "@arcgis/core/widgets/Home";
import ScaleBar from "@arcgis/core/widgets/ScaleBar";
import "@esri/calcite-components";
Expand Down Expand Up @@ -414,8 +415,11 @@ if (!testWebGL2Support()) {

view.popup.defaultPopupTemplateEnabled = true;

const search = setupSearch(view);
search.view.ui.add(search, {
const searchGroup = new Expand({
icon: "search",
content: setupSearch(view),
});
view.ui.add(searchGroup, {
index: 0,
position: UIAddPositions.topTrailing,
});
Expand All @@ -432,7 +436,7 @@ if (!testWebGL2Support()) {
const clearButton = createClearButton({
layers: [milepostLayer, tempLayer],
});
view.ui.add([home, clearButton], UIAddPositions.topTrailing);
view.ui.add([home, clearButton], UIAddPositions.topLeading);
},
(reason: unknown) => {
console.error("Failed to setup clear button", reason);
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/route-input/createComboBoxItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function* getComboboxItems(routes: Map<string, string[]>) {
for (const [routeId, directions] of routes.entries()) {
const element = document.createElement("calcite-combobox-item");
element.value = routeId;
element.textLabel = routeId;
element.heading = routeId;
element.dataset.directions = directions.join("");
yield element;
}
Expand Down
5 changes: 4 additions & 1 deletion tools/get-arcgis-core-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export async function* getArcGisFiles(
// Get the current directory entry.
let currentDirent = await dirHandler.read();
while (currentDirent !== null) {
const currentFilePath = join(currentDirent.path, currentDirent.name);
const currentFilePath = join(
currentDirent.parentPath,
currentDirent.name,
);
// Test to see if the current file should be skipped.
const skipReason = isUnwanted(currentDirent);
let message: string;
Expand Down