Skip to content

Commit

Permalink
v0.1.6
Browse files Browse the repository at this point in the history
- Enter now submits login form #36
- Minor bug fixes
  • Loading branch information
aa-tree committed Jun 6, 2023
1 parent 7380e3c commit bc6419e
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 52 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.1.6
- Enter now submits login form #36
- Minor bug fixes

- Bumped up some of packages' version numbers

Fixed error reporting in case registering CalDAV account fails.
Expand Down
4 changes: 3 additions & 1 deletion COMMITMESSAGE.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Bumped up some of packages' version numbers
v0.1.6
- Enter now submits login form #36
- Minor bug fixes
12 changes: 6 additions & 6 deletions docker-compose.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ services:

## AES Encryption Password
## This is used to encrypt CalDAV passwords in the database.
AES_PASSWORD : uqu8aiH9oz7aeB5quiegh6toot0haa0ite9Iedivaej8cuC5fahvoh0aetheeboo
AES_PASSWORD : NEW_AES_PASSWORD

############################################################
## The following variables aren't required for basic functionality,
## but might be required to be set for some additional features.
############################################################

SMTP_HOST : smtp.ethereal.email
SMTP_USERNAME : matteo.robel@ethereal.email
SMTP_PASSWORD : 4TrWWnX7uh1vW3Gmtk
SMTP_FROMEMAIL : matteo.robel@ethereal.email
SMTP_HOST : smtp.example.com
SMTP_USERNAME : example@example.comm
SMTP_PASSWORD : password
SMTP_FROMEMAIL : example@example.comm
SMTP_PORT : 587
SMTP_USESECURE : "false"

Expand Down Expand Up @@ -94,7 +94,7 @@ services:
## The following variables must not be changed.
############################################################

NEXT_PUBLIC_VERSION_NUMBER: "0.1.5"
NEXT_PUBLIC_VERSION_NUMBER: "0.1.6"
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manage-my-damn-life-nextjs",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion sample.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ NEXT_PUBLIC_TEST_MODE=false
## The following variables must not be changed.
############################################################

NEXT_PUBLIC_VERSION_NUMBER=0.1.5
NEXT_PUBLIC_VERSION_NUMBER=0.1.6
2 changes: 1 addition & 1 deletion sample.env.local.docker
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ NEXT_PUBLIC_TEST_MODE=false
## The following variables must not be changed.
############################################################

NEXT_PUBLIC_VERSION_NUMBER="0.1.5"
NEXT_PUBLIC_VERSION_NUMBER="0.1.6"
36 changes: 28 additions & 8 deletions src/components/tasks/GenerateTaskUIList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,37 @@ import TaskUI from './TaskUI';
import { getRandomString } from '@/helpers/crypto';
import Collapse from 'react-bootstrap/Collapse';
import { TaskWithFilters } from './TaskWithFilters';
import { varNotEmpty } from "@/helpers/general";
import { logError, varNotEmpty } from "@/helpers/general";
import { majorTaskFilter } from "@/helpers/frontend/events";
import { TaskPending } from "@/helpers/api/tasks";
import { Loading } from "../common/Loading";
export default class GenerateTaskUIList extends Component{
constructor(props)
{
super(props)

this.i18next=getI18nObject()
this.state={collapsed: props.collapsed, showDone:false, output: null}
this.state={collapsed: props.collapsed, showDone:false, output: <Loading centered={true} padding={10} />}
this.collapseButtonClicked= this.collapseButtonClicked.bind(this)
this.getTaskstoRender = this.getTaskstoRender.bind(this)
this.renderTasks = this.renderTasks.bind(this)
}

componentDidMount(){
this.setState({showDone: this.props.showDone, })

//this.renderTasks(false)

}

renderTasks()
{
var output = this.getTaskstoRender(this.state.showDone)
this.setState({output: output})
}

componentDidUpdate(prevProps, prevState)
{

var same = true
if(varNotEmpty(prevProps.collapsed))
{
Expand All @@ -49,8 +58,19 @@ export default class GenerateTaskUIList extends Component{
if(prevProps.showDone!=this.props.showDone)
{
this.setState({showDone: !prevState.showDone})

}

// try{
// if(JSON.stringify(this.props)===JSON.stringify(prevProps))
// {
// this.renderTasks()
// }

// }catch(e)
// {
// console.error("GenerateTaskUIList.componentDidUpdate", e)
// }

}
collapseButtonClicked(key)
{
Expand Down Expand Up @@ -199,14 +219,14 @@ export default class GenerateTaskUIList extends Component{

listitem=(
<div key={key} style={{marginTop: marginTop}}> <TaskUI scheduleItem={this.props.scheduleItem} id={key} key={key} collapseButtonClicked={this.collapseButtonClicked} collapsed={collapsed} hasChildren={hasChildren} unparsedData={todoList[2]} data={todoList[1][key].todo} todoList={todoList} fetchEvents={this.props.fetchEvents} title={todoList[1][key].todo.summary} dueDate={dueDate} dueDateinWords="Words" level={level} priority={todoList[1][key].todo.priority} listColor={listColor} completion={todoList[1][key].todo.completion} labels={todoList[1][key].todo.category}/>
</div>
</div>
)
tempToReturn.push(listitem)
if (list[i].length> 2) {
if(collapsed==false)
{

listitem=( <GenerateTaskUIList showDone={this.state.showDone}collapseButtonClicked={this.props.collapseButtonClicked} collapsed={this.state.collapsed} scheduleItem={this.props.scheduleItem} collpased={this.state.collapsed} key={"LIST_"+key} fetchEvents={this.props.fetchEvents} list={list[i][2]} todoList={todoList} level={level} context={context} listColor={listColor} />)
listitem=( <GenerateTaskUIList showDone={this.state.showDone} collapseButtonClicked={this.props.collapseButtonClicked} collapsed={this.state.collapsed} scheduleItem={this.props.scheduleItem} collpased={this.state.collapsed} key={"SUBLIST_"+key} fetchEvents={this.props.fetchEvents} list={list[i][2]} todoList={todoList} level={level} context={context} listColor={listColor} />)
tempToReturn.push(listitem)

}
Expand All @@ -222,7 +242,7 @@ export default class GenerateTaskUIList extends Component{

if (toReturn != [] && toReturn.length>0) {

return( <div key={getRandomString(5)} style={{marginBottom: 5}}>
return( <div style={{marginBottom: 5}}>

{toReturn}

Expand All @@ -239,6 +259,6 @@ export default class GenerateTaskUIList extends Component{
}
render(){
var output = this.getTaskstoRender()
return(output)
return(output )
}
}
59 changes: 27 additions & 32 deletions src/components/tasks/TaskUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ export default class TaskUI extends Component {
this.isRepeatingTask()
if (this.props.todoList != null && this.props.data.relatedto != null && this.props.data.relatedto != "" && this.props.level == 0) {
var parentID = this.taskObj.getParent()
if(varNotEmpty(parentID) && parentID!="")
{
if (varNotEmpty(parentID) && parentID != "") {
var newTaskTitle = (<div><span style={{ color: "gray" }}>{this.props.todoList[1][this.taskObj.getParent()].todo.summary + " > "}</span> {this.props.title}</div>)
this.setState({ taskTitle: newTaskTitle })

}
}
var collapseButton = null
Expand Down Expand Up @@ -116,7 +115,7 @@ export default class TaskUI extends Component {
}
}
*/

}
}

Expand All @@ -140,8 +139,8 @@ export default class TaskUI extends Component {
componentDidUpdate(prevProps, prevState) {

if (this.props.collapsed !== prevProps.collapsed) {
if (debugging()) console.log("this.props.`isCollapsed`", this.props.isCollapsed)
if (this.props.isCollapsed == true) {
if (debugging()) console.log("this.props.`isCollapsed`", this.props.collapsed)
if (this.props.collapsed == true) {
this.setState({ collapseButton: <FcExpand value={this.props.data.uid} key={this.props.data.uid} id={this.props.data.uid} onClick={this.collapseButtonClicked} /> })

} else {
Expand All @@ -165,14 +164,13 @@ export default class TaskUI extends Component {
// first check if the task already has label for my day.
var newDataArray = _.cloneDeep(this.state.data)
//change Rrule to RruleObject
if(varNotEmpty(this.state.data.rrule) && this.state.data.rrule!="")
{
newDataArray["rrule"]= RRuleHelper.rruleToObject(newDataArray.rrule)
if (varNotEmpty(this.state.data.rrule) && this.state.data.rrule != "") {
newDataArray["rrule"] = RRuleHelper.rruleToObject(newDataArray.rrule)
}
/* console.log(newDataArray)
var todo = new VTodoGenerator(newDataArray)
console.log(todo.generate())
*/
/* console.log(newDataArray)
var todo = new VTodoGenerator(newDataArray)
console.log(todo.generate())
*/
if (this.state.data.category != null && Array.isArray(this.state.data.category)) {
var found = false

Expand Down Expand Up @@ -207,7 +205,7 @@ export default class TaskUI extends Component {
console.log(newDataArray)
var todo = new VTodoGenerator(newDataArray)
console.log(todo.generate())

//this.setState({data: newDataArray, showTaskEditor: true, })
var body = await updateTodo(this.state.data.calendar_id, this.state.data.url_internal, this.state.data.etag, newDataArray)
this.onTaskSubmittoServer(body)
Expand All @@ -223,11 +221,10 @@ export default class TaskUI extends Component {
var newCategoryArray = removeMyDayLabelFromArray(this.state.data.category)
var newData = _.cloneDeep(this.state.data)
newData.categories = newCategoryArray
if(varNotEmpty(this.state.data.rrule) && this.state.data.rrule!="")
{
newData["rrule"]= RRuleHelper.rruleToObject(newData.rrule)
if (varNotEmpty(this.state.data.rrule) && this.state.data.rrule != "") {
newData["rrule"] = RRuleHelper.rruleToObject(newData.rrule)
}

//this.setState({data: newData, showTaskEditor: true})
var body = await updateTodo(this.props.data.calendar_id, this.props.data.url_internal, this.props.data.etag, newData)
this.onTaskSubmittoServer(body)
Expand All @@ -250,7 +247,7 @@ export default class TaskUI extends Component {
}
checkBoxClicked() {


this.setState(function (previousState, currentProps) {

var newData = JSON.parse(JSON.stringify(previousState.data))
Expand Down Expand Up @@ -438,36 +435,34 @@ export default class TaskUI extends Component {
var priorityColor = ""

var timeDifferenceinWords = timeDifferencefromNowinWords(this.props.dueDate)

var dueDateColor = "green"

var dueDateText = ""

if(this.state.repeatingTask==true)
{
if(varNotEmpty(this.state.data.recurrences))
{
if (this.state.repeatingTask == true) {
if (varNotEmpty(this.state.data.recurrences)) {
var recurrenceObj = new RecurrenceHelper(this.state.data)
var newDueDate = recurrenceObj.getNextDueDate()
var timeDifference = Math.floor((moment(newDueDate).unix() - Math.floor(Date.now() / 1000)) / 86400)
if (timeDifference < 0) {
dueDateColor = 'red'
}

timeDifferenceinWords= timeDifferencefromNowinWords_Generic( newDueDate)
dueDateText = moment(newDueDate).format("DD/MM/YYYY HH:mm")+ " " + timeDifferenceinWords
timeDifferenceinWords = timeDifferencefromNowinWords_Generic(newDueDate)
dueDateText = moment(newDueDate).format("DD/MM/YYYY HH:mm") + " " + timeDifferenceinWords
}

}else{
} else {
dueDateText = this.props.dueDate + " " + timeDifferenceinWords
if (this.props.dueDate != null) {
var timeDifference = Math.floor((dueDatetoUnixStamp(this.props.dueDate) - Math.floor(Date.now() / 1000)) / 86400)
if (timeDifference < 0) {
dueDateColor = 'red'
}

}

}
if (window != undefined) {
// window.addEventListener('resize', this.updateDimensions);
Expand Down Expand Up @@ -525,7 +520,7 @@ export default class TaskUI extends Component {
}
var hasDescriptionIcon = null
if (varNotEmpty(this.state.data.description) && this.state.data.description.toString().trim() != "") {
hasDescriptionIcon = ( <MdSpeakerNotes />)
hasDescriptionIcon = (<MdSpeakerNotes />)

}

Expand All @@ -549,7 +544,7 @@ export default class TaskUI extends Component {
{progressBar}

</div>
<div className="col-1">
<div className="col-1">
{repeatingTaskIcon} {hasDescriptionIcon}
</div>

Expand Down
15 changes: 13 additions & 2 deletions src/pages/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getAuthenticationHeadersforUser, setLoginCookie } from '@/helpers/front
import { getMessageFromAPIResponse } from '@/helpers/frontend/response';
import { getAPIURL, logVar } from '@/helpers/general';
import { getErrorResponse } from '@/helpers/errros';
import { fetchLatestEvents } from '@/helpers/frontend/sync';
class Login extends Component{

constructor(props)
Expand All @@ -26,6 +27,7 @@ class Login extends Component{
this.passWordChanged = this.passWordChanged.bind(this)
this.loginButtonClicked= this.loginButtonClicked.bind(this)
this.processReponse = this.processReponse.bind(this)
this.onKeyDown = this.onKeyDown.bind(this)

}
componentDidMount()
Expand Down Expand Up @@ -88,8 +90,16 @@ class Login extends Component{
}
usernameChanged(e)
{

this.setState({username: e.target.value})
}
onKeyDown(e)
{
if(e.key=="Enter")
{
this.loginButtonClicked()
}
}
passWordChanged(e)
{
this.setState({password: e.target.value})
Expand Down Expand Up @@ -152,6 +162,7 @@ class Login extends Component{
{
//Save userhash and SSID
setLoginCookie(message.userhash, message.ssid)
fetchLatestEvents()
var redirectURL="/"
if(window!=undefined){
const queryString = window.location.search;
Expand Down Expand Up @@ -202,9 +213,9 @@ class Login extends Component{
<h2 style={{textAlign:'center', }}>{this.i18next.t("APP_NAME")}</h2>
<br />
<h1>{this.i18next.t("LOGIN")}</h1>
<Form.Control maxLength={40} value={this.state.username} onChange={this.usernameChanged} placeholder={this.i18next.t("ENTER_USERNAME")} />
<Form.Control onKeyDown={this.onKeyDown} maxLength={40} value={this.state.username} onChange={this.usernameChanged} placeholder={this.i18next.t("ENTER_USERNAME")} />
<br />
<Form.Control onChange={this.passWordChanged} value={this.state.password} type="password" maxLength={40} placeholder={this.i18next.t("ENTER_A_PASSWORD")} />
<Form.Control onKeyDown={this.onKeyDown} onChange={this.passWordChanged} value={this.state.password} type="password" maxLength={40} placeholder={this.i18next.t("ENTER_A_PASSWORD")} />
<br />
<div style={{textAlign:'center',}}><Button onClick={this.loginButtonClicked} > {this.i18next.t("LOGIN")}</Button></div>
<div style={{marginBottom:20}} />
Expand Down

0 comments on commit bc6419e

Please sign in to comment.