From f2022c9360fa2484030d530ac39f3f86354127bd Mon Sep 17 00:00:00 2001 From: Dany Khalife Date: Sat, 11 Jan 2025 08:39:59 -0800 Subject: [PATCH 1/3] add gh workflow --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8087038 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build validation + +on: + push: + branches: [ "main", "develop" ] + pull_request: + branches: [ "main", "develop" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm i + - run: npm run build + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + - name: Install dependencies + run: npm i + # Lint currently reporting lots of preexisting issues + # - run: npm run lint From 05cfa9e8473a89868b4c87cede84ba286a4e500f Mon Sep 17 00:00:00 2001 From: Dany Khalife Date: Sat, 11 Jan 2025 08:55:03 -0800 Subject: [PATCH 2/3] fix typo and cleanup --- src/views/ChoreEdit/ChoreEdit.jsx | 2 +- src/views/ChoreEdit/RepeatSection.jsx | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/views/ChoreEdit/ChoreEdit.jsx b/src/views/ChoreEdit/ChoreEdit.jsx index ec5625f..8a2736a 100644 --- a/src/views/ChoreEdit/ChoreEdit.jsx +++ b/src/views/ChoreEdit/ChoreEdit.jsx @@ -317,7 +317,7 @@ const ChoreEdit = () => { // }, [userLabels, labelsV2]) useEffect(() => { - // if frequancy type change to somthing need a due date then set it to the current date: + // if frequency type change to somthing need a due date then set it to the current date: if (!NO_DUE_DATE_REQUIRED_TYPE.includes(frequencyType) && !dueDate) { setDueDate(moment(new Date()).format('YYYY-MM-DDTHH:mm:00')) } diff --git a/src/views/ChoreEdit/RepeatSection.jsx b/src/views/ChoreEdit/RepeatSection.jsx index f9a578c..f8cfb72 100644 --- a/src/views/ChoreEdit/RepeatSection.jsx +++ b/src/views/ChoreEdit/RepeatSection.jsx @@ -22,7 +22,7 @@ import { UserContext } from '../../contexts/UserContext' import { isPlusAccount } from '../../utils/Helpers' import ThingTriggerSection from './ThingTriggerSection' -const FREQUANCY_TYPES_RADIOS = [ +const FREQUENCY_TYPES_RADIOS = [ 'daily', 'weekly', 'monthly', @@ -37,23 +37,6 @@ const FREQUENCY_TYPE_MESSAGE = { custom: 'This chore will be scheduled based on a custom frequency.', } const REPEAT_ON_TYPE = ['interval', 'days_of_the_week', 'day_of_the_month'] -const FREQUANCY_TYPES = [ - 'once', - 'daily', - 'weekly', - 'monthly', - 'yearly', - 'adaptive', - ...REPEAT_ON_TYPE, -] -const MONTH_WITH_NO_31_DAYS = [ - // TODO: Handle these months if day is 31 - 'february', - 'april', - 'june', - 'september', - 'november', -] const MONTHS = [ 'january', 'february', @@ -93,7 +76,6 @@ const RepeatOnSections = ({ const [daysOfTheWeek, setDaysOfTheWeek] = useState({}) const [monthsOfTheYear, setMonthsOfTheYear] = useState({}) const [intervalUnit, setIntervalUnit] = useState('days') - const [frequancyMetadata, setFrequancyMetadata] = useState({}) const [time, setTime] = useState('18:00') const timePickerComponent = ( @@ -393,7 +375,7 @@ const RepeatSection = ({ '--ListItem-radius': '20px', }} > - {FREQUANCY_TYPES_RADIOS.map((item, index) => ( + {FREQUENCY_TYPES_RADIOS.map((item, index) => ( Date: Wed, 12 Feb 2025 00:31:50 -0500 Subject: [PATCH 3/3] Update webhook settings UI and functionality --- src/views/Settings/Settings.jsx | 106 +++++++++++++++++++------------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/src/views/Settings/Settings.jsx b/src/views/Settings/Settings.jsx index 8ec486c..55ca372 100644 --- a/src/views/Settings/Settings.jsx +++ b/src/views/Settings/Settings.jsx @@ -7,6 +7,8 @@ import { CircularProgress, Container, Divider, + FormControl, + FormHelperText, Input, Typography, } from '@mui/joy' @@ -28,6 +30,7 @@ import { PutWebhookURL, UpdatePassword, } from '../../utils/Fetcher' +import { isPlusAccount } from '../../utils/Helpers' import PassowrdChangeModal from '../Modals/Inputs/PasswordChangeModal' import APITokenSettings from './APITokenSettings' import NotificationSetting from './NotificationSetting' @@ -327,52 +330,69 @@ const Settings = () => { services when events happen in your Circle. Use the webhook URL below to - { - if (webhookURL === null) { - setWebhookURL('') - } else { - setWebhookURL(null) - } - }} - variant='soft' - label={'Enable Webhook'} - /> - <> - {webhookURL !== null && ( - - Webhook URL - setWebhookURL(e.target.value)} - size='lg' - sx={{ - width: '220px', - mb: 1, - }} - /> - - {webhookError} - - - )} - - + Enable webhook notifications for tasks and things updates.{' '} + {userProfile && !isPlusAccount(userProfile) && ( + + Not available in Basic Plan + + )} + + <> + {webhookURL !== null && ( + + Webhook URL + setWebhookURL(e.target.value)} + size='lg' + sx={{ + width: '220px', + mb: 1, + }} + /> + + {webhookError} + + + )} + + + )}