Esempio n. 1
0
        public async Task AddTaskAsync(Guid listId, TodoListTask task, CancellationToken cancelationToken)
        {
            var dseList = await _storageContext.TodoLists.Get(listId, cancelationToken);

            if (dseList == null)
            {
                throw new ItemNotFoundException(listId);
            }

            var dseTask = _mapper.Map <Dse.TodoListTask>(task);

            dseTask.ListId = listId;
            await _storageContext.Tasks.Add(dseTask, cancelationToken);
        }
	public void SetTask( TodoListTask task )
	{
		Task = task;

		if( Task.DueDate != 0 )
		{
			System.DateTime date = TodoList.FromUnixTimestamp( Task.DueDate );

			NewDay = date.Day.ToString( "00" );
			NewMonth = date.Month.ToString( "00" );
			NewYear = date.Year.ToString( "0000" );
		}

		if( Task.DueTime != 0 )
		{
			System.DateTime date = TodoList.FromUnixTimestamp( Task.DueTime );

			NewHour = date.Hour.ToString( "00" );
			NewMinute = date.Minute.ToString( "00" );
		}
	}
Esempio n. 3
0
	public void AddTask( TodoListTask newTask )
	{
		TaskList.Add( newTask );
	}
Esempio n. 4
0
	public override void OnTaskChanged( TodoListTask changedTask, string undoDescription = "Edit Task" )
	{
		base.OnTaskChanged( changedTask );

		Undo.RegisterUndo( ListObject, undoDescription );
		EditorUtility.SetDirty( ListObject );
	}
        public async Task <IActionResult> Post(Guid id, [FromBody] TodoListTask task)
        {
            await _tasksService.AddTaskAsync(id, task, HttpContext.RequestAborted);

            return(StatusCode((int)HttpStatusCode.Created));
        }
Esempio n. 6
0
	public virtual void OnTaskDeleted( TodoListTask deletedTask )
	{
		foreach( TodoListTask task in GetTaskList() )
		{
			if( task.Order > deletedTask.Order )
			{
				task.Order--;
			}
		}
	}
Esempio n. 7
0
	int TaskListSortByDeveloperDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		int returnUnassignedValue = 0;
		if( ReturnUnassignedSortingValues( obj1.Developer, obj2.Developer, out returnUnassignedValue ) )
		{
			return returnUnassignedValue;
		}

		return obj2.Developer.CompareTo( obj1.Developer );
	}
Esempio n. 8
0
	int TaskListSortBySprintDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		int returnUnassignedValue = 0;
		if( ReturnUnassignedSortingValues( obj1.SprintIndex, obj2.SprintIndex, out returnUnassignedValue ) )
		{
			return returnUnassignedValue;
		}

		return obj2.SprintIndex.CompareTo( obj1.SprintIndex );
	}
Esempio n. 9
0
	public override void OnTaskDeleted( TodoListTask deletedTask )
	{

	}
Esempio n. 10
0
	void DisplayTaskDeveloper( TodoListTask task )
	{
		string[] options = Window.GetCurrentList().GetDevelopersStringList();

		int currentIndex = Window.GetCurrentList().GetDevelopersList().IndexOf( task.Developer ) + 1;

		GUIStyle popupStyle = new GUIStyle( EditorStyles.popup );
		popupStyle.margin.top = 4;

		int newIndex = EditorGUILayout.Popup( currentIndex, options, popupStyle, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Developer ) - 8 ) );

		GUILayout.Space( 4 );
		if( newIndex != currentIndex )
		{
			Window.GetCurrentList().OnTaskChanged( task, "Edit Task Developer" );

			if( newIndex == 0 )
			{
				task.Developer = "Unassigned";
			}
			else
			{
				task.Developer = Window.GetCurrentList().GetDevelopersList()[ newIndex - 1 ];
			}

			task.AddPost( "", "", task.Developer );
		}
	}
Esempio n. 11
0
	void DisplayTaskCategory( TodoListTask task )
	{
		string[] options = Window.GetCurrentList().GetCategoriesStringList();

		int currentIndex = Window.GetCurrentList().GetCategoriesList().IndexOf( task.Category ) + 1;

		GUIStyle popupStyle = new GUIStyle( EditorStyles.popup );
		popupStyle.margin.top = 4;

		int newIndex = EditorGUILayout.Popup( currentIndex, options, popupStyle, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Category ) - 8 ) );
		GUILayout.Space( 4 );
		if( newIndex != currentIndex )
		{
			Window.GetCurrentList().OnTaskChanged( task, "Edit Task Category" );
			
			if( newIndex == 0 )
			{
				task.Category = "Unassigned";
			}
			else
			{
				task.Category = Window.GetCurrentList().GetCategoriesList()[ newIndex - 1 ];
			}
		}
	}
Esempio n. 12
0
	void DisplayTaskSprint( TodoListTask task )
	{
		TodoList.DisplayTaskSprint( task, TodoList.SprintFieldWidth - 6, Window );
	}
Esempio n. 13
0
	void DisplayTaskStatus( TodoListTask task )
	{
		GUILayout.Label( task.Status, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Status ) - 28 ) );

		List<string> transitions = Window.GetCurrentList().GetTransitions( task.Status );
		transitions.Insert( 0, "" );

		GUIStyle popupStyle = new GUIStyle( EditorStyles.popup );
		popupStyle.margin.top = 4;
		popupStyle.margin.right = 8;

		int selectedIndex = 0;

		if( transitions.Count > 1 )
		{
			selectedIndex = EditorGUILayout.Popup( 0, transitions.ToArray(), popupStyle, GUILayout.Width( 16 ) );
		}
		else
		{
			GUILayout.Space( 24 );
		}
		
		if( selectedIndex != 0 )
		{
			Window.GetCurrentList().OnTaskChanged( task, "Edit Task Status" );

			task.SetCompleted( Window.GetCurrentList().IsStatusFinished( transitions[ selectedIndex ] ) );

			task.Status = transitions[ selectedIndex ];

			task.AddPost( "", transitions[ selectedIndex ], "" );
		}
	}
Esempio n. 14
0
	void DisplayTaskEffort( TodoListTask task )
	{
		if( GetFieldSize( TodoListFieldTypes.Progress ) > 0 )
		{
			GUILayout.Space( 2 );
		}

		TodoList.DisplayTaskEffort( task, GetFieldSize( TodoListFieldTypes.Effort ) - 6, Window );

		GUILayout.Space( 2 );
	}
Esempio n. 15
0
	void AddNewTodoListItem()
	{
		if( AddItemDesc == "" )
		{
			return;
		}

		TodoListTask task = new TodoListTask();
		string[] initialStatusList = GetInitialStatusList().ToArray();

		task.Description = AddItemDesc;
		task.Status = initialStatusList[ StatusIndex ];
		task.Effort = AddItemEffort;
		task.SprintIndex = AddItemSprint;

		if( Window.GetCurrentList().GetCategoriesList().Count > 0 )
		{
			string cat = "Unassigned";

			if( CategoryIndex > 0 && CategoryIndex < Window.GetCurrentList().GetCategoriesList().Count + 1 )
			{
				cat = Window.GetCurrentList().GetCategoriesList()[ CategoryIndex - 1 ];
			}

			task.Category = cat;
		}

		if( Window.GetCurrentList().GetDevelopersList().Count > 0 )
		{
			string dev = "Unassigned";

			if( DeveloperIndex > 0 && DeveloperIndex < Window.GetCurrentList().GetDevelopersList().Count + 1 )
			{
				dev = Window.GetCurrentList().GetDevelopersList()[ DeveloperIndex - 1 ];
			}

			task.Developer = dev;
		}

		if( Window.GetDisplayOption( TodoListDisplayOptions.ShowDueDate ) )
		{
			if( DueDateToggle )
			{
				int day = System.Convert.ToInt32( DueDateDay );
				int month = System.Convert.ToInt32( DueDateMonth );
				int year = System.Convert.ToInt32( DueDateYear );

				task.DueDate  = TodoList.ToUnixTimestamp( year, month, day );
			}
			else
			{
				task.DueDate = 0;
			}
		}

		if( Window.GetDisplayOption( TodoListDisplayOptions.ShowDueTime ) )
		{
			if( DueTimeToggle )
			{
				int hour = System.Convert.ToInt32( DueTimeHour );
				int min = System.Convert.ToInt32( DueTimeMin );

				task.DueTime  = TodoList.ToUnixTimestamp( 1970, 1, 1, hour, min );
			}
			else
			{
				task.DueTime = 0;
			}
		}

		task.Tags = "";
		task.Order = Window.GetCurrentList().GetHighestOrder() + 1;

		task.TimeCreated = TodoList.GetUnixTimestampNow();
		task.TimeCompleted = 0;

		task.IsMatchingSearchString = true;
		Window.GetCurrentList().AddTask( task );

		AddItemDesc = "";
		AddItemEffort = 1;
		AddItemSprint = -1;

		GUIUtility.keyboardControl = 0;
		Window.Repaint();
	}
Esempio n. 16
0
	void DisplayTaskProgress( TodoListTask task )
	{
		GUIStyle style = new GUIStyle();
		style.fixedWidth = GetFieldSize( TodoListFieldTypes.Progress ) - 4;
		style.fixedHeight = 24;

		EditorGUILayout.BeginHorizontal( style, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Progress ) - 4 ) );
		{
			float newValue = GUILayout.HorizontalSlider( task.Progress, 0f, 1f, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Progress ) - 8 - 35 ) );

			GUILayout.Label( Mathf.FloorToInt( newValue * 100 ) + "%", GUILayout.Width( 35 ) );
			if( newValue != task.Progress )
			{
				Window.GetCurrentList().RegisterUndo( "Edit Task Progress" );
				task.Progress = newValue;
				Window.GetCurrentList().OnTaskChanged( task );
			}
		}
		EditorGUILayout.EndHorizontal();
	}
Esempio n. 17
0
	public override void OnTaskChanged( TodoListTask changedTask, string undoDescription = "Edit Task" )
	{

	}
Esempio n. 18
0
	int TaskListSortByCategoryDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		int returnUnassignedValue = 0;
		if( ReturnUnassignedSortingValues( obj1.Category, obj2.Category, out returnUnassignedValue ) )
		{
			return returnUnassignedValue;
		}

		return obj2.Category.CompareTo( obj1.Category );
	}
Esempio n. 19
0
	public override void AddTask( TodoListTask newTask )
	{

	}
Esempio n. 20
0
	public abstract void AddTask( TodoListTask newTask );
Esempio n. 21
0
	int TaskListSortByDescriptionDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj2.Description.CompareTo( obj1.Description );
	}
Esempio n. 22
0
	public virtual void OnTaskChanged( TodoListTask changedTask, string undoDescription = "Edit Task" )
	{
		
	}
Esempio n. 23
0
	int TaskListSortByDueDateAsc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj1.DueDate.CompareTo( obj2.DueDate );
	}
Esempio n. 24
0
	public override void OnTaskDeleted( TodoListTask deletedTask )
	{
		base.OnTaskDeleted( deletedTask );

		Undo.RegisterUndo( ListObject, "Delete Task" );
		EditorUtility.SetDirty( ListObject );
	}
Esempio n. 25
0
	int TaskListSortByDueTimeDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj2.DueTime.CompareTo( obj1.DueTime );
	}
Esempio n. 26
0
	public override void AddTask( TodoListTask newTask )
	{
		ListObject.AddTask( newTask );
		OnTaskAdded();
	}
Esempio n. 27
0
	int TaskListSortByOrderDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj2.Order.CompareTo( obj1.Order );
	}
Esempio n. 28
0
 public async Task UpdateTaskAsync(TodoListTask task, CancellationToken cancelationToken)
 {
     await _storageContext.Tasks.Update(_mapper.Map <Dse.TodoListTask>(task));
 }
Esempio n. 29
0
	int TaskListSortByStatusDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj2.Status.CompareTo( obj1.Status );
	}
Esempio n. 30
0
	void AddTestData()
	{
		for( int i = 0; i < 50; ++i )
		{
			TodoListTask task = new TodoListTask();

			task.Description = "Test " + i;
			task.TimeCreated = TodoList.ToUnixTimestamp( 2012, Random.Range( 1, 5 ), Random.Range( 1, 30 ), Random.Range( 1, 24 ), Random.Range( 0, 60 ) );
			task.Status = "Task not started";

			task.SetCompleted( true );
			task.TimeCompleted = task.TimeCreated + 60 * 60 * 24 * Random.Range( 50, 90 );
			task.Status = "Completed";

			task.Developer = "Unassigned";
			task.Category = "Unassigned";

			task.IsMatchingSearchString = true;
			task.Order = Window.GetCurrentList().GetHighestOrder() + 1;

			Window.GetCurrentList().AddTask( task );
		}
	}
Esempio n. 31
0
	int TaskListSortByEffortDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		return obj2.Effort.CompareTo( obj1.Effort );
	}
Esempio n. 32
0
	int TaskListSortByPriorityDesc( TodoListTask obj1, TodoListTask obj2 )
	{
		int returnUnassignedValue = 0;
		if( ReturnUnassignedSortingValues( obj1.Priority, obj2.Priority, out returnUnassignedValue ) )
		{
			return returnUnassignedValue;
		}

		List<string> priorityList = new List<string>( GetPriorityList() );

		return priorityList.FindIndex( item => item == obj2.Priority ).CompareTo( priorityList.FindIndex( item => item == obj1.Priority ) );
	}
Esempio n. 33
0
	void DisplayTaskDesc( TodoListTask task, GUIStyle style )
	{
		int id = GUIUtility.GetControlID( FocusType.Keyboard );

		if( GUIUtility.keyboardControl == id + 1 )
		{
			style = EditorStyles.textField;

			if( Event.current.type == EventType.keyDown )
			{
				if( Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter )
				{
					GUIUtility.keyboardControl = 0;
					Window.Repaint();
				}
			}
		}

		int widthModifier = 6;

		if( GetFieldSize( TodoListFieldTypes.Progress ) == 0 && GetFieldSize( TodoListFieldTypes.Effort ) > 0 )
		{
			widthModifier = 8;
		}
		string newDesc = GUILayout.TextField( task.Description, style, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Description ) - widthModifier ) );

		if( IsDragging == false )
		{
			EditorGUIUtility.AddCursorRect( GUILayoutUtility.GetLastRect(), MouseCursor.Text );
		}

		if( newDesc != task.Description )
		{
			Window.GetCurrentList().RegisterUndo( "Edit Task Description" );
			task.Description = newDesc;
			Window.GetCurrentList().OnTaskChanged( task );
			ResortList = true;
		}
	}