Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/puny-teams-show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@getodk/web-forms': patch
---

Changed the map tooltips to a dialog that explains the actions.
6 changes: 3 additions & 3 deletions packages/web-forms/e2e/page-objects/controls/MapControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ export class MapControl {
}

async zoomToFitAll(mapComponent: Locator) {
const button = mapComponent.locator('button[title="Zoom to fit"]');
const button = mapComponent.locator('button.zoom-fit-all');
await expect(button).toBeVisible();
await button.click();
}

async centerCurrentLocation(mapComponent: Locator) {
const button = mapComponent.locator('button[title="Zoom to current location"]');
const button = mapComponent.locator('button.zoom-current-location');
await expect(button).toBeVisible();
await button.click();
// Wait for the current location icon to appear on the map.
await this.page.waitForTimeout(this.ANIMATION_TIME);
}

async toggleFullScreen(mapComponent: Locator) {
const button = mapComponent.locator('button[title="Full Screen"]');
const button = mapComponent.locator('button.fullscreen');
await expect(button).toBeVisible();
await button.click();
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion packages/web-forms/src/assets/styles/map-block.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.map-block-component {
--odk-map-controls-spacing: 8px;
--odk-map-bottom-placeholder-height: 60px;
}

@mixin map-block-sm {
@container map-block (max-height: 333px) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS doesn't support CSS variables in media or container queries. Instead of adding SASS variables, we try to avoid doing so. I considered using mixins instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're on board with using mixins for media or container queries, I'd be happy to open a follow-up PR for that small refactor :)

@content;
}
}

@mixin map-control-bar {
Expand All @@ -11,7 +18,7 @@
background: none;
overflow: hidden;
gap: var(--odk-map-controls-spacing);
z-index: var(--odk-z-index-form-floating);
z-index: var(--odk-z-index-form-content);
}

@mixin map-control-bar-vertical {
Expand Down
6 changes: 5 additions & 1 deletion packages/web-forms/src/assets/styles/primevue.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use './style' as odk;

.odk-form {
.p-datepicker-input:disabled,
.p-datepicker-input:disabled + .p-datepicker-input-icon-container,
Expand Down Expand Up @@ -36,13 +38,15 @@
.p-dialog-header,
.p-dialog-content,
.p-dialog-footer {
padding: 20px;
padding: var(--odk-spacing-xl);
}

.p-dialog-content,
.p-dialog-footer {
padding-top: 0;
}

@include odk.toggle-visibility();
}

.p-disabled,
Expand Down
14 changes: 5 additions & 9 deletions packages/web-forms/src/assets/styles/select-options.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
@use 'primeflex/core/_variables.scss' as pf;

.value-option {
--text-content-margin: 15px;
}

.value-option {
display: flex;
align-items: center;
Expand Down Expand Up @@ -58,7 +54,7 @@

:deep(.media-content) {
background: transparent;
height: calc(100% - (var(--odk-base-font-size) + (var(--text-content-margin) * 2)));
height: calc(100% - (var(--odk-base-font-size) + (var(--odk-spacing-l) * 2)));
min-height: 54px;
flex: 0 1 auto;
margin-left: auto;
Expand All @@ -70,15 +66,15 @@

:deep(.p-checkbox),
:deep(.p-radiobutton) {
margin: auto 0 auto 20px;
margin: auto 0 auto var(--odk-spacing-xl);
align-self: flex-start;
}

:deep(.text-content) {
width: fit-content;
min-width: unset;
max-width: calc(100% - 70px);
margin: var(--text-content-margin) 20px;
margin: var(--odk-spacing-l) var(--odk-spacing-xl);
flex: 1 1 auto;
}
}
Expand All @@ -94,7 +90,7 @@
}

.value-option:not(.no-buttons) :deep(.text-content) {
margin-left: 10px;
margin-left: var(--odk-spacing-m);
}

.select-with-images .value-option {
Expand All @@ -108,7 +104,7 @@
align-items: center;
width: 100%;
justify-content: flex-start;
gap: 10px;
gap: var(--odk-spacing-m);

.media-block {
border-radius: 0;
Expand Down
64 changes: 50 additions & 14 deletions packages/web-forms/src/assets/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
--odk-max-image-height: 300px;
--odk-image-container-size: 300px;

--odk-spacing-s: 5px;
--odk-spacing-m: 10px;
--odk-spacing-l: 15px;
--odk-spacing-xl: 20px;
--odk-spacing-xxl: 30px;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh I need this one! :)


/*
* This project uses a centralized z-index layering system to manage the stacking order of UI
* elements, preventing overlap issues and ensuring maintainability.
Expand Down Expand Up @@ -89,6 +95,36 @@
--odk-z-index-topmost: 1000;
}

@mixin toggle-visibility($display: inline-block) {
/**
* The "!important" is intentional here. These visibility toggles must strictly enforce their state
* and override any nested component styles.
*/
.desktop-only {
display: #{$display} !important;
}

.mobile-only {
display: none !important;
}

@media screen and (max-width: #{pf.$sm}) {
.desktop-only {
display: none !important;
}

.mobile-only {
display: #{$display} !important;
}
}
}

@mixin sm-constrained {
@media (width <= #{pf.$sm}) and (orientation: portrait), (height <= #{pf.$sm}) and (orientation: landscape) {
@content;
}
}

.odk-form {
@keyframes shimmer {
0% {
Expand All @@ -112,23 +148,23 @@
animation: shimmer 1.5s infinite;
}

.desktop-only {
display: inline;
}

.mobile-only {
display: none;
}
@include toggle-visibility();
}

@media screen and (max-width: #{pf.$sm}) {
.odk-form {
.desktop-only {
display: none;
}
.odk-form-list {
margin: 0;
padding: 0;
list-style: none;
overflow: auto;

.mobile-only {
display: inline;
.odk-form-list-item {
display: block;
padding: var(--odk-spacing-l) 0;
width: 100%;
border: none;

&:not(:first-child) {
border-top: 1px solid var(--odk-border-color);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const detail = computed((): FormLoadErrorDetail | null => {

<style lang="scss" scoped>
.form-load-failure-dialog .message {
margin: 10px 0 30px 0;
margin: var(--odk-spacing-m) 0 var(--odk-spacing-xxl) 0;
color: var(--odk-error-text-color);
font-size: var(--odk-base-font-size);
white-space: pre-wrap;
Expand Down
14 changes: 7 additions & 7 deletions packages/web-forms/src/components/OdkWebForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@ onUnmounted(() => {
flex-direction: column;
max-width: var(--odk-max-form-width);
margin: auto;
padding-top: 10px;
padding-top: var(--odk-spacing-m);

.questions-card {
border-radius: var(--odk-radius);
box-shadow: none;
border-top: none;
margin-top: 20px;
margin-top: var(--odk-spacing-xl);
}

.questions-card > :deep(.p-card-body) {
Expand All @@ -396,7 +396,7 @@ onUnmounted(() => {
top: 1rem;

:deep(.p-message-wrapper) {
padding: 8px 15px;
padding: 8px var(--odk-spacing-l);
flex-grow: 1;
}

Expand All @@ -407,7 +407,7 @@ onUnmounted(() => {
}

.odk-icon {
margin-right: 10px;
margin-right: var(--odk-spacing-m);
}

.form-error-text-wrap {
Expand All @@ -416,7 +416,7 @@ onUnmounted(() => {
padding: 0;

li:not(:last-child) {
margin-bottom: 10px;
margin-bottom: var(--odk-spacing-m);
}
}
}
Expand Down Expand Up @@ -463,7 +463,7 @@ onUnmounted(() => {
font-size: 14px;
font-weight: 300;
color: var(--odk-muted-text-color);
margin-top: 5px;
margin-top: var(--odk-spacing-s);
}
}
}
Expand Down Expand Up @@ -501,7 +501,7 @@ onUnmounted(() => {
.footer {
order: 4;
button {
margin-right: 20px;
margin-right: var(--odk-spacing-xl);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const nColumnstyle = computed(() => {
.columns-pack {
display: flex;
flex-wrap: wrap;
gap: 20px;
gap: var(--odk-spacing-xl);

:deep(.value-option) .text-content {
min-width: fit-content;
Expand All @@ -33,7 +33,7 @@ const nColumnstyle = computed(() => {

.columns {
display: grid;
gap: 20px;
gap: var(--odk-spacing-xl);
grid-template-columns: repeat(2, 1fr);

@media screen and (min-width: #{pf.$md}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defineProps<{ appearances: SelectNodeAppearances }>();
justify-content: flex-start;
border-radius: var(--odk-radius);
margin-bottom: 6px;
padding-left: 10px;
padding-left: var(--odk-spacing-m);

:deep(.control-text) {
margin-bottom: 0;
Expand All @@ -40,7 +40,7 @@ defineProps<{ appearances: SelectNodeAppearances }>();
min-width: 50px;
text-align: center;
vertical-align: middle;
padding: 15px 0;
padding: var(--odk-spacing-l) 0;
outline: none;
background-color: unset;

Expand Down Expand Up @@ -114,7 +114,7 @@ defineProps<{ appearances: SelectNodeAppearances }>();

:deep(.value-option) {
position: relative;
gap: 10px;
gap: var(--odk-spacing-m);
justify-content: center;

.p-checkbox,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const locationPoints = computed<GeolocationValue>(() => {
}

.geolocation-formatted-value > span {
margin-right: 10px;
margin-right: var(--odk-spacing-m);
font-size: var(--odk-answer-font-size);
font-weight: 300;
}
Expand All @@ -59,7 +59,7 @@ const locationPoints = computed<GeolocationValue>(() => {
.geolocation-formatted-value {
display: flex;
flex-direction: column;
gap: 10px;
gap: var(--odk-spacing-m);
}
}
</style>
2 changes: 2 additions & 0 deletions packages/web-forms/src/components/common/IconSVG.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
mdiFileOutline,
mdiFullscreen,
mdiImage,
mdiInformationSlabCircleOutline,
mdiMapMarkerOutline,
mdiMenu,
mdiPencil,
Expand Down Expand Up @@ -65,6 +66,7 @@ const iconMap: Record<string, string> = {
mdiFileOutline,
mdiFullscreen,
mdiImage,
mdiInformationSlabCircleOutline,
mdiMapMarkerOutline,
mdiMenu,
mdiPencil,
Expand Down
10 changes: 5 additions & 5 deletions packages/web-forms/src/components/common/LikertWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ defineEmits(['change']);
flex-wrap: nowrap;
cursor: pointer;
outline: none;
padding: 10px 0;
margin-left: 10px;
margin-right: 10px;
padding: var(--odk-spacing-m) 0;
margin-left: var(--odk-spacing-m);
margin-right: var(--odk-spacing-m);
background: transparent;

&:last-of-type::before {
Expand Down Expand Up @@ -72,10 +72,10 @@ defineEmits(['change']);

.text-content {
text-align: center;
margin: -11.5px 0 10px 0;
margin: -11.5px 0 var(--odk-spacing-m) 0;
width: fit-content;
position: relative;
padding-top: 20px;
padding-top: var(--odk-spacing-xl);
word-break: break-word;
max-width: unset;
}
Expand Down
Loading
Loading