Skip to content
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

Features/824 redesign data pages #1133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Feb 6, 2025

Closes getodk/central#824

What has been done to verify that this works as intended?

Manual verification.

Why is this the best possible solution? Were any other approaches considered?

Most of it is HTML/CSS changes. Though not specified in the release criteria, I have made the similar changes on Audits page.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

No

Does this change require updates to user documentation? If so, please file an issue here and include the link below.

No

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@sadiqkhoja sadiqkhoja force-pushed the features/824-redesign-data-pages branch from 5ad7c12 to 0e82126 Compare February 6, 2025 21:17
@sadiqkhoja sadiqkhoja force-pushed the features/824-redesign-data-pages branch 3 times, most recently from fc7f618 to 3cf4135 Compare February 28, 2025 20:40
@sadiqkhoja sadiqkhoja force-pushed the features/824-redesign-data-pages branch from 3cf4135 to 3e59dc2 Compare February 28, 2025 20:57
@sadiqkhoja sadiqkhoja marked this pull request as ready for review February 28, 2025 20:57
Comment on lines +13 to +14
<label id="audit-filters-action" for="audit-actions" class="form-group">
<select id="audit-actions" ref="auditActions" class="form-control" :value="modelValue"
Copy link
Member

Choose a reason for hiding this comment

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

If the form control is in the <label>, I don't think the <label> needs for. From MDN:

you can nest the <input> directly inside the <label>, in which case the for and id attributes are not needed because the association is implicit

:aria-disabled="disabled" v-tooltip.aria-describedby="disabledMessage"
:placeholder="requiredLabel(placeholder, required)" autocomplete="off"
:placeholder="$t('common.none')" autocomplete="off"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's possible to use a single word for "none" for different filters, since some languages inflect "none" based on what it describes. For example, we translate submission.noSubmission and entity.noEntity separately. I think each filter probably needs its own translation for "none".

@@ -10,19 +10,23 @@ including this file, may be copied, modified, propagated, or distributed
except according to the terms contained in the LICENSE file.
-->
<template>
<div ref="dropdown" class="multiselect form-group">
<label ref="dropdown" :for="toggleId" class="multiselect form-group">
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefit of making this a <label>? Since this is the root element, and it encloses the .dropdown-menu, I'd be slightly concerned that it'd include that content in the label. The <select> has an aria-label, so I don't think a <label> element is essential here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make all elements clickable to open the dropdown menu, but I see what you are saying. I am removing it and just wrapping select, span for {{ label }} and span.icon in a new div with data-toggle

@@ -10,14 +10,15 @@ including this file, may be copied, modified, propagated, or distributed
except according to the terms contained in the LICENSE file.
-->
<template>
<label class="form-group"><!-- eslint-disable-line vuejs-accessibility/label-has-for -->
Copy link
Member

Choose a reason for hiding this comment

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

The linter doesn't usually yell at us about label-has-for. I think it's doing so here because it doesn't understand that <flatpickr> is really an <input> element. As long as the <label> wraps the <input>, we shouldn't need for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the for attribute and add a rule in eslintrc so that it recognizes flatpickr as a control component.

<!-- Specifying @mousedown.prevent so that clicking the select element does
not show a menu with the placeholder option. This approach seems to work
across browsers. -->
<select :id="toggleId" ref="toggle" class="form-control"
:class="{ none: modelValue?.length === options?.length }"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:class="{ none: modelValue?.length === options?.length }"
:class="{ none: defaultToAll && modelValue?.length === options?.length }"

If defaultToAll is false (the default), then the user can actually uncheck all options. In that case, modelValue.length === 0. All and none are only the same if defaultToAll is true.

@@ -133,6 +137,10 @@ const props = defineProps({
type: String,
required: true
},
hideLabel: {
Copy link
Member

Choose a reason for hiding this comment

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

This section of props is about customizing text, so I'd put this prop somewhere else. Maybe nearby the disabled prop?

@analyze="analyze.show()"/>
<entity-download-button
:aria-disabled="deleted"
v-tooltip.aria-describedby="deleted ? $t('downloadDisabled') : null"/>
Copy link
Member

Choose a reason for hiding this comment

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

I think the message for downloadDisabled needs to be moved from EntityList. You can use @transifexKey to prevent the message from being retranslated after it's moved.

import { apiPaths } from '../../util/request';
import { useI18nUtils } from '../../util/i18n';
import { useRequestData } from '../../request-data';

const props = defineProps({
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look like DatasetEntities passes an odataFilter prop to this component anymore. If the component doesn't use the prop anymore, it could remove the prop. But it sounds to me from the release criteria that the component does need the prop:

  • Except if I have an active filter then above the checkboxes I should see a dropdown with two options:
    • Download # submissions matching the filter
    • Download all # submissions

<odata-data-access :analyze-disabled="analyzeDisabled"
:analyze-disabled-message="analyzeDisabledMessage"
@analyze="analyzeModal.show()"/>
<submission-download-button :form-version="form"
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we could leave the download button in SubmissionList, but make it teleport here. Then the button would still be able to communicate with the download modal easily. Also, we wouldn't need to copy the downloadDisabled message here.

Just an idea!

@matthew-white
Copy link
Member

One other thing that the release criteria mention is:

Except in the popup, I should see the “Other” renamed to “Other (API)”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redesign submissions and entities tables
2 participants