From f07252b3f2cd03f1ffbc998860fac79628bde27c Mon Sep 17 00:00:00 2001 From: nakamu-kazu222 Date: Wed, 1 May 2024 17:20:54 +0900 Subject: [PATCH] =?UTF-8?q?6=E6=97=A5=E4=BB=A5=E4=B8=8A=E7=B5=8C=E9=81=8E?= =?UTF-8?q?=E3=80=815=E6=97=A5=E7=B5=8C=E9=81=8E=E3=80=814=E6=97=A5?= =?UTF-8?q?=E7=B5=8C=E9=81=8E=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/components/ElapsedDays.jsx | 14 +++++++------- app/javascript/components/Products.jsx | 16 ++++++++-------- app/javascript/elapsed_days.vue | 20 ++++++++++---------- app/javascript/products.vue | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/javascript/components/ElapsedDays.jsx b/app/javascript/components/ElapsedDays.jsx index 840d4daa9dd..c93cb4a8eed 100644 --- a/app/javascript/components/ElapsedDays.jsx +++ b/app/javascript/components/ElapsedDays.jsx @@ -11,35 +11,35 @@ export default function ElapsedDays({ countProductsGroupedBy }) {
  1. - 7日以上経過{` (${countProductsGroupedBy(7)})`} + 6日以上経過{` (${countProductsGroupedBy(6)})`}
  2. - 6日経過{` (${countProductsGroupedBy(6)})`} + 5日経過{` (${countProductsGroupedBy(5)})`}
  3. - 5日経過{` (${countProductsGroupedBy(5)})`} + 4日経過{` (${countProductsGroupedBy(4)})`}
  4. - {[4, 3, 2, 1].map((passedDay) => { + {[3, 2, 1].map((passedDay) => { return (
  5. { + const isNotProduct4daysElapsed = () => { const elapsedDays = [] data.productsGroupedByElapsedDays.forEach((group) => { elapsedDays.push(group.elapsed_days) }) - return elapsedDays.every((day) => day < 5) + return elapsedDays.every((day) => day < 4) } const elapsedDaysId = (elapsedDays) => { return `${elapsedDays}days-elapsed` @@ -97,13 +97,13 @@ export default function Products({ ) - } else if (isDashboard() && isNotProduct5daysElapsed()) { + } else if (isDashboard() && isNotProduct4daysElapsed()) { return (
    -

    5日経過した提出物はありません

    +

    4日経過した提出物はありません

    ) } else if (selectedTab !== 'unassigned') { @@ -210,18 +210,18 @@ function ProductHeader({ countProductsGroupedBy }) { let headerClass = 'card-header a-elapsed-days' - if (productsNDaysPassed.elapsed_days === 5) { + if (productsNDaysPassed.elapsed_days === 4) { headerClass += ' is-reply-warning' - } else if (productsNDaysPassed.elapsed_days === 6) { + } else if (productsNDaysPassed.elapsed_days === 5) { headerClass += ' is-reply-alert' - } else if (productsNDaysPassed.elapsed_days >= 7) { + } else if (productsNDaysPassed.elapsed_days >= 6) { headerClass += ' is-reply-deadline' } const headerLabel = () => { if (productsNDaysPassed.elapsed_days === 0) { return '今日提出' - } else if (productsNDaysPassed.elapsed_days === 7) { + } else if (productsNDaysPassed.elapsed_days === 6) { return `${productsNDaysPassed.elapsed_days}日以上経過` } else { return `${productsNDaysPassed.elapsed_days}日経過` diff --git a/app/javascript/elapsed_days.vue b/app/javascript/elapsed_days.vue index 2bad0b57ed4..dd975ae4804 100644 --- a/app/javascript/elapsed_days.vue +++ b/app/javascript/elapsed_days.vue @@ -3,25 +3,25 @@ nav.page-body__column.is-sub .page-nav.a-card ol.page-nav__items.elapsed-days li.page-nav__item.is-reply-deadline( - :class='activeClass(countProductsByElapsedDays(7))') + :class='activeClass(countProductsByElapsedDays(6))') a.page-nav__item-link(href='#6days-elapsed') span.page-nav__item-link-inner - | 7日以上経過 - | ({{ countProductsByElapsedDays(7) }}) + | 6日以上経過 + | ({{ countProductsByElapsedDays(6) }}) li.page-nav__item.is-reply-alert( - :class='activeClass(countProductsByElapsedDays(6))') + :class='activeClass(countProductsByElapsedDays(5))') a.page-nav__item-link(href='#5days-elapsed') span.page-nav__item-link-inner - | 6日経過 - | ({{ countProductsByElapsedDays(6) }}) + | 5日経過 + | ({{ countProductsByElapsedDays(5) }}) li.page-nav__item.is-reply-warning( - :class='activeClass(countProductsByElapsedDays(5))') + :class='activeClass(countProductsByElapsedDays(4))') a.page-nav__item-link(href='#4days-elapsed') span.page-nav__item-link-inner - | 5日経過 - | ({{ countProductsByElapsedDays(5) }}) + | 4日経過 + | ({{ countProductsByElapsedDays(4) }}) li.page-nav__item( - v-for='passedDay in [4, 3, 2, 1]', + v-for='passedDay in [3, 2, 1]', :class='activeClass(countProductsByElapsedDays(passedDay))') a.page-nav__item-link(:href='"#" + passedDay + "days-elapsed"') span.page-nav__item-link-inner diff --git a/app/javascript/products.vue b/app/javascript/products.vue index 5eab3b8a8d9..e5371646517 100644 --- a/app/javascript/products.vue +++ b/app/javascript/products.vue @@ -25,7 +25,7 @@ .page-body__column.is-main template(v-for='product_n_days_passed in productsGroupedByElapsedDays') .a-card( - v-if='!isDashboard || (isDashboard && product_n_days_passed.elapsed_days >= 4 && product_n_days_passed.elapsed_days <= 6)') + v-if='!isDashboard || (isDashboard && product_n_days_passed.elapsed_days >= selectedDays && product_n_days_passed.elapsed_days <= selectedDays + 2)') //- TODO 以下を共通化する //- prettier-ignore: need space between v-if and id header.card-header.a-elapsed-days( @@ -40,7 +40,7 @@ v-else-if='product_n_days_passed.elapsed_days === 4', id='4days-elapsed' ) h2.card-header__title - | {{ product_n_days_passed.elapsed_days }}日経過 + | {{ selectedDays }}日経過 span.card-header__count(v-if='selectedTab === "unassigned"') | ({{ countProductsGroupedBy(product_n_days_passed) }}) //- prettier-ignore: need space between v-else-if and id @@ -48,7 +48,7 @@ v-else-if='product_n_days_passed.elapsed_days === 5', id='5days-elapsed' ) h2.card-header__title - | {{ product_n_days_passed.elapsed_days }}日経過 + | {{ selectedDays + 1 }}日経過 span.card-header__count(v-if='selectedTab === "unassigned"') | ({{ countProductsGroupedBy(product_n_days_passed) }}) //- prettier-ignore: need space between v-else-if and id @@ -56,7 +56,7 @@ v-else-if='product_n_days_passed.elapsed_days === 6', id='6days-elapsed' ) h2.card-header__title - | {{ product_n_days_passed.elapsed_days }}日以上経過 + | {{ selectedDays + 2 }}日以上経過 span.card-header__count(v-if='selectedTab === "unassigned"') | ({{ countProductsGroupedBy(product_n_days_passed) }}) header.card-header.a-elapsed-days(