Skip to content

ABTIB improvements #230

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

Merged
merged 3 commits into from
Aug 18, 2021
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
2 changes: 1 addition & 1 deletion src/backend
Submodule backend updated 1 files
+47 −1 src/Objects/Utils.ts
32 changes: 3 additions & 29 deletions src/pages/Components/FloatingActionButton.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//import { IonModal, IonContent, IonSelect, IonSelectOption } from '@ionic/react';
import React, { useState } from 'react';
import './FloatingActionButton.css';
import * as chrono from 'chrono-node';
import {useSpring, animated} from 'react-spring'
import Task from '../../backend/src/Objects/Task';

import { ParseABTIBIntention } from '../../backend/src/Objects/Utils'


/*
Expand Down Expand Up @@ -79,33 +78,8 @@ function ABTIB(props) {
if (event.key === 'Enter') {
event.persist(); //https://reactjs.org/docs/events.html#event-pooling
setisSaving(true);
let taskName = event.target.value;
let dateInfo = chrono.parse(taskName);
let due = undefined;
let defer = undefined;
if (dateInfo.length > 0) {
// we got a date!
if (dateInfo[0].end) {
// both start (defer) and end (due)
// get end (due) date
due = dateInfo[0].end.date();
defer = dateInfo[0].start.date();
// strip the due date string
taskName = taskName.replace(dateInfo[0].text, "").trim();

}
else {
// only start (due)
due = dateInfo[0].start.date();
// strip the due date string
taskName = taskName.replace(dateInfo[0].text, "").trim();
}
}
Task.create(
props.cm, taskName, undefined, undefined, due, defer
).then(()=>{
event.target.blur();
});
ParseABTIBIntention(props.cm, event.target.value)
.then(()=>{ event.target.blur(); });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Components/Task.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class Task extends Component {
e = e.target; //assign the element clicked to e
}

if (e.className && (e.className.indexOf('cm-link') != -1 || e.className.indexOf('cm-url') != -1)) {
if (e.className && e.className.indexOf && (e.className.indexOf('cm-link') != -1 || e.className.indexOf('cm-url') != -1)) {
Browser.open({ url: e.innerText });
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Upcoming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

.workspaces-popover {
--background: var(--ion-background);
--background: var(--ion-background-color);
--width: 200px;
font-size: 14px;
margin-top: 3px;
Expand Down