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

Release/0.68.0 #1757

Merged
merged 4 commits into from
Dec 19, 2023
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v0.68.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.67.0...v0.68.0)

- fix: missing style for nps modal [`#1755`](https://github.com/isomerpages/isomercms-frontend/pull/1755)
- fix: remove date validation in announcements [`#1754`](https://github.com/isomerpages/isomercms-frontend/pull/1754)
- release/0.67.0 [`#1751`](https://github.com/isomerpages/isomercms-frontend/pull/1751)

#### [v0.67.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.66.0...v0.67.0)

> 19 December 2023

- feat(tables): add merge/split functionality [`#1750`](https://github.com/isomerpages/isomercms-frontend/pull/1750)
- release/0.66.0 [`#1748`](https://github.com/isomerpages/isomercms-frontend/pull/1748)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms-frontend",
"version": "0.67.0",
"version": "0.68.0",
"private": true,
"engines": {
"node": ">=16.0.0"
Expand Down
45 changes: 45 additions & 0 deletions src/theme/components/Rating.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { createMultiStyleConfigHelpers } from "@chakra-ui/react"
import { anatomy } from "@chakra-ui/theme-tools"

import { textStyles } from "theme/textStyles"

const parts = anatomy("rating").parts("button", "container")

const {
definePartsStyle,
defineMultiStyleConfig,
} = createMultiStyleConfigHelpers(parts.keys)

const baseStyle = definePartsStyle({
container: {
display: "flex",
flexFlow: "row nowrap",
listStyleType: "none",
alignItems: "flex-start",
gap: "1.5rem",
w: "full",
alignSelf: "center",
px: "1.16rem",
py: "0.5rem",
},
button: {
...textStyles["subhead-2"],
minH: "auto",
minW: "auto",
_active: {
bg: "interaction.support.selected",
color: "base.content.inverse",
_hover: {
bg: "interaction.support.selected",
},
_disabled: {
bg: "interaction.support.disabled",
color: "interaction.support.disabled-content",
},
},
},
})

export const Rating = defineMultiStyleConfig({
baseStyle,
})
2 changes: 2 additions & 0 deletions src/theme/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Card, CARD_THEME_KEY } from "./Card"
import { Checkbox } from "./Checkbox"
import { DISPLAY_CARD_THEME_KEY, DisplayCard } from "./DisplayCard"
import { Infobox } from "./Infobox"
import { Rating } from "./Rating"

// eslint-disable-next-line import/prefer-default-export
export const components = {
Expand All @@ -13,4 +14,5 @@ export const components = {
Breadcrumb,
Infobox,
Attachment,
Rating,
}
9 changes: 0 additions & 9 deletions src/utils/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ const validateNonFutureResourceDate = (dateStr) => {
const daysDiff = today - chosenDate
return daysDiff >= 0
}

const validateNonFutureAnnouncementDate = (dateStr) => {
const today = moment().tz("Asia/Singapore")
const isoDateStr = moment(dateStr, "DD MMMM YYYY", true)
return isoDateStr.isAfter(today)
}

// Homepage Editor
// ==========
// Returns new errors.highlights[index] object
Expand Down Expand Up @@ -289,8 +282,6 @@ const validateAnnouncementItems = (announcementError, field, value) => {
case "date": {
if (!moment(value, "DD MMMM YYYY", true).isValid()) {
errorMessage = `Date is invalid`
} else if (validateNonFutureAnnouncementDate(value)) {
errorMessage = `Date cannot be in the future`
}

break
Expand Down
Loading