Merge branch 'main' of https://github.com/meauxt/donetick-frontend
This commit is contained in:
commit
c06d5f1f30
4 changed files with 106 additions and 64 deletions
40
.github/workflows/build.yml
vendored
Normal file
40
.github/workflows/build.yml
vendored
Normal file
|
@ -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
|
|
@ -321,7 +321,7 @@ const ChoreEdit = () => {
|
||||||
// }, [userLabels, labelsV2])
|
// }, [userLabels, labelsV2])
|
||||||
|
|
||||||
useEffect(() => {
|
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) {
|
if (!NO_DUE_DATE_REQUIRED_TYPE.includes(frequencyType) && !dueDate) {
|
||||||
setDueDate(moment(new Date()).format('YYYY-MM-DDTHH:mm:00'))
|
setDueDate(moment(new Date()).format('YYYY-MM-DDTHH:mm:00'))
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { UserContext } from '../../contexts/UserContext'
|
||||||
import { isPlusAccount } from '../../utils/Helpers'
|
import { isPlusAccount } from '../../utils/Helpers'
|
||||||
import ThingTriggerSection from './ThingTriggerSection'
|
import ThingTriggerSection from './ThingTriggerSection'
|
||||||
|
|
||||||
const FREQUANCY_TYPES_RADIOS = [
|
const FREQUENCY_TYPES_RADIOS = [
|
||||||
'daily',
|
'daily',
|
||||||
'weekly',
|
'weekly',
|
||||||
'monthly',
|
'monthly',
|
||||||
|
@ -37,23 +37,6 @@ const FREQUENCY_TYPE_MESSAGE = {
|
||||||
custom: 'This chore will be scheduled based on a custom frequency.',
|
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 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 = [
|
const MONTHS = [
|
||||||
'january',
|
'january',
|
||||||
'february',
|
'february',
|
||||||
|
@ -93,7 +76,6 @@ const RepeatOnSections = ({
|
||||||
const [daysOfTheWeek, setDaysOfTheWeek] = useState({})
|
const [daysOfTheWeek, setDaysOfTheWeek] = useState({})
|
||||||
const [monthsOfTheYear, setMonthsOfTheYear] = useState({})
|
const [monthsOfTheYear, setMonthsOfTheYear] = useState({})
|
||||||
const [intervalUnit, setIntervalUnit] = useState('days')
|
const [intervalUnit, setIntervalUnit] = useState('days')
|
||||||
const [frequancyMetadata, setFrequancyMetadata] = useState({})
|
|
||||||
const [time, setTime] = useState('18:00')
|
const [time, setTime] = useState('18:00')
|
||||||
const timePickerComponent = (
|
const timePickerComponent = (
|
||||||
<Grid item sm={12} sx={{ display: 'flex', alignItems: 'center' }}>
|
<Grid item sm={12} sx={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
@ -393,7 +375,7 @@ const RepeatSection = ({
|
||||||
'--ListItem-radius': '20px',
|
'--ListItem-radius': '20px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{FREQUANCY_TYPES_RADIOS.map((item, index) => (
|
{FREQUENCY_TYPES_RADIOS.map((item, index) => (
|
||||||
<ListItem key={item}>
|
<ListItem key={item}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
// disabled={index === 0}
|
// disabled={index === 0}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import {
|
||||||
CircularProgress,
|
CircularProgress,
|
||||||
Container,
|
Container,
|
||||||
Divider,
|
Divider,
|
||||||
|
FormControl,
|
||||||
|
FormHelperText,
|
||||||
Input,
|
Input,
|
||||||
Typography,
|
Typography,
|
||||||
} from '@mui/joy'
|
} from '@mui/joy'
|
||||||
|
@ -28,6 +30,7 @@ import {
|
||||||
PutWebhookURL,
|
PutWebhookURL,
|
||||||
UpdatePassword,
|
UpdatePassword,
|
||||||
} from '../../utils/Fetcher'
|
} from '../../utils/Fetcher'
|
||||||
|
import { isPlusAccount } from '../../utils/Helpers'
|
||||||
import PassowrdChangeModal from '../Modals/Inputs/PasswordChangeModal'
|
import PassowrdChangeModal from '../Modals/Inputs/PasswordChangeModal'
|
||||||
import APITokenSettings from './APITokenSettings'
|
import APITokenSettings from './APITokenSettings'
|
||||||
import NotificationSetting from './NotificationSetting'
|
import NotificationSetting from './NotificationSetting'
|
||||||
|
@ -327,6 +330,7 @@ const Settings = () => {
|
||||||
services when events happen in your Circle. Use the webhook URL
|
services when events happen in your Circle. Use the webhook URL
|
||||||
below to
|
below to
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<FormControl sx={{ mt: 1 }}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={webhookURL !== null}
|
checked={webhookURL !== null}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -337,8 +341,22 @@ const Settings = () => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
variant='soft'
|
variant='soft'
|
||||||
label={'Enable Webhook'}
|
label='Enable Webhook'
|
||||||
|
disabled={!isPlusAccount(userProfile)}
|
||||||
|
overlay
|
||||||
/>
|
/>
|
||||||
|
<FormHelperText
|
||||||
|
sx={{
|
||||||
|
opacity: !isPlusAccount(userProfile) ? 0.5 : 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Enable webhook notifications for tasks and things updates.{' '}
|
||||||
|
{userProfile && !isPlusAccount(userProfile) && (
|
||||||
|
<Chip variant='soft' color='warning'>
|
||||||
|
Not available in Basic Plan
|
||||||
|
</Chip>
|
||||||
|
)}
|
||||||
|
</FormHelperText>
|
||||||
<>
|
<>
|
||||||
{webhookURL !== null && (
|
{webhookURL !== null && (
|
||||||
<Typography level='title-sm'>
|
<Typography level='title-sm'>
|
||||||
|
@ -359,7 +377,7 @@ const Settings = () => {
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
variant='soft'
|
variant='soft'
|
||||||
sx={{ width: '110px' }}
|
sx={{ width: '110px', mt: 1 }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
PutWebhookURL(webhookURL).then(resp => {
|
PutWebhookURL(webhookURL).then(resp => {
|
||||||
if (resp.ok) {
|
if (resp.ok) {
|
||||||
|
@ -369,10 +387,12 @@ const Settings = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
disabled={!isPlusAccount(userProfile)}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
</FormControl>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue