Skip to content

Commit

Permalink
fix: Student Projects feedback and accordions (#622)
Browse files Browse the repository at this point in the history
* using a specific red for bulleted items in PageEduStudentProject

* adjusting styles for BlockText ul bullets at different viewports, adding ability to style all filters in a group the same, even if mixing accordions and non-accordions

* switching accordion close icon

* removing unused import

* removing router links from listing page results

* moving BlockText scss back to common package
  • Loading branch information
stephiescastle committed Sep 17, 2024
1 parent cc7199b commit 2f88340
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
22 changes: 22 additions & 0 deletions packages/common/src/scss/components/_BlockText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@
@apply mb-0;
}
}
&.-medium {
ul {
li {
&::before {
@apply mt-3;
@screen lg {
@apply mt-3.5;
}
}
}
}
}
// other sizes
&.-small {
p {
Expand Down Expand Up @@ -243,5 +255,15 @@
}
}
}
ul {
li {
&::before {
@apply mt-2.5;
@screen lg {
@apply mt-3;
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { computed, reactive, ref } from 'vue'
import type { AccordionItemObject } from './../../interfaces.ts'
import { uniqueId } from 'lodash'
import IconPlus from './../Icons/IconPlus.vue'
import IconMinus from './../Icons/IconMinus.vue'
export interface BaseAccordionItemProps {
headingLevel?: string
Expand Down Expand Up @@ -76,9 +77,9 @@ const emit = defineEmits(['accordionItemOpened', 'accordionItemClosed'])
</slot>
<span
class="BaseAccordion-icon pointer-events-none text-xs text-action flex-shrink-0 transform transition-transform"
:class="{ 'rotate-45': !isHidden }"
>
<IconPlus />
<IconPlus v-if="isHidden" />
<IconMinus v-else />
</span>
</button>
</component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
<!-- correct for zero based index -->
<div
v-if="!truncateFilters || index <= checkbox.checkboxLimit - 1"
class="flex my-2"
class="flex"
:class="{ 'pt-2 mt-2 mb-3': styleAsAccordion, 'my-2': !styleAsAccordion }"
>
<input
:id="
Expand All @@ -102,9 +103,10 @@
: generateId(bucket.key, groupKey)
"
class="form-check-label pl-2 tracking-normal align-middle"
:class="{ 'font-extrabold': styleAsAccordion }"
>
{{ prettyFilterNames(bucket.key_as_string ? bucket.key_as_string : bucket.key) }}
<span class="text-gray-mid-dark text-sm">
<span class="text-gray-mid-dark text-sm font-normal">
({{ bucket.doc_count.toLocaleString() }})
</span>
</label>
Expand Down Expand Up @@ -180,6 +182,12 @@ export default {
subFilterAggKey: {
type: String,
default: undefined
},
// force accordion styles and spacing even if there are no subfilters
// useful when mixing filters with and without subfilters together
styleAsAccordion: {
type: Boolean,
default: false
}
},
emits: ['update:filterBy'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, reactive, ref } from 'vue'
import { uniqueId } from 'lodash'
import IconPlus from './../Icons/IconPlus.vue'
import IconMinus from './../Icons/IconMinus.vue'
export interface SearchFilterGroupAccordionItemProps {
initOpen?: boolean
Expand Down Expand Up @@ -57,10 +58,10 @@ const emit = defineEmits(['filterGroupAccordionItemOpened', 'filterGroupAccordio
@click="handleClick()"
>
<span
class="SearchFilterGroupAccordionItem-icon inline-block text-xs text-action flex-shrink-0 transform transition-transform"
:class="{ '!rotate-45': !isHidden }"
class="SearchFilterGroupAccordionItem-icon inline-block text-xs text-action flex-shrink-0"
>
<IconPlus />
<IconPlus v-if="isHidden" />
<IconMinus v-else />
</span>
</button>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@ export default defineComponent({
page.id = page._id
page.score = page._score
// ensure router links
// TODO: issues with router links so disabling for now
// page.url = page._source.url
// ? page._source.url.replace(/^[^:]+:\/\/[^/?#]+/, '')
// : undefined
page.url = page._source.url
? page._source.url.replace(/^[^:]+:\/\/[^/?#]+/, '')
: undefined
page.title = page._source.title
page.type = pageType
page.topic = topic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ const computedClass = computed((): string => {
ul {
li {
&::before {
@apply bg-secondary;
// intentionally using a specific red
@apply bg-jpl-red;
}
}
}
Expand Down

0 comments on commit 2f88340

Please sign in to comment.