Skip to content
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

Js Fixes #263

Merged
merged 6 commits into from
Dec 3, 2024
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
1 change: 1 addition & 0 deletions CalendarUtils.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions Events.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
9 changes: 9 additions & 0 deletions assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use humhub\components\assets\AssetBundle;
use humhub\modules\tasks\controllers\ListController;
use humhub\modules\tasks\controllers\SearchController;
use Yii;

class Assets extends AssetBundle
{
Expand Down Expand Up @@ -49,6 +50,14 @@ public static function register($view)
. '.task-overview #task-filter-nav .task-bottom-panel .filterInput[data-filter-type=checkbox] .fa.fa-check-square-o{border-color:var(--info);background:var(--info)}');
}

$view->registerJsConfig([
'task' => [
'text' => [
'success.delete' => Yii::t('base', 'Deleted'),
],
],
]);

return parent::register($view);
}
}
1 change: 1 addition & 0 deletions controllers/ConfigContainerController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2023 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions controllers/GlobalController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: kingb
Expand Down
1 change: 1 addition & 0 deletions controllers/ListController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions controllers/SearchController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
14 changes: 3 additions & 11 deletions controllers/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function actionEdit($id = null, $cal = false, $redirect = false, $listId
$taskForm->createNew($this->contentContainer);
} else {
$taskForm = new TaskForm([
'task' => Task::find()->contentContainer($this->contentContainer)->where(['task.id' => $id])->one(),
'task' => $this->getTaskById($id),
'cal' => $cal,
'redirect' => $redirect,
'wall' => $wall,
Expand Down Expand Up @@ -162,11 +162,7 @@ public function actionTaskResponsiblePicker($keyword = '')

public function actionView($id)
{
$task = Task::find()->contentContainer($this->contentContainer)->where(['task.id' => $id])->one();

if (!$task) {
throw new HttpException(404);
}
$task = $this->getTaskById($id);

if (!$task->content->canView()) {
throw new HttpException(403);
Expand All @@ -179,11 +175,7 @@ public function actionView($id)

public function actionLoadAjaxTask($id)
{
$task = Task::find()->contentContainer($this->contentContainer)->where(['task.id' => $id])->one();

if (!$task) {
throw new HttpException(404);
}
$task = $this->getTaskById($id);

if (!$task->content->canView()) {
throw new HttpException(403);
Expand Down
1 change: 1 addition & 0 deletions controllers/rest/TaskListController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2019 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions controllers/rest/TasksController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2019 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
- Enh #258: By default, enabled "Mobile" notification types for those enabled for "Web"
- Enh #259: Replace theme variables with CSS variables
- Enh #260: Use PHP CS Fixer
- Fix #263: Fixed deleted tasks visibility, reload after deletion, reload after state change

1.8.5 (March 14, 2024)
----------------------
Expand Down
1 change: 1 addition & 0 deletions helpers/RestDefinitions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2019 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions integration/calendar/TaskCalendar.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions integration/calendar/TaskCalendarQuery.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions jobs/SendReminder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/Sortable.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: buddha
Expand Down
1 change: 1 addition & 0 deletions models/Task.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/checklist/TaskItem.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/forms/ConfigureContainerForm.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2023 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/forms/ItemDrop.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/forms/TaskFilter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/lists/TaskList.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/lists/TaskListInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: buddha
Expand Down
1 change: 1 addition & 0 deletions models/lists/TaskListSettings.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/scheduling/TaskReminder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/scheduling/TaskScheduling.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/search/TaskPicker.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions models/user/TaskUser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
15 changes: 15 additions & 0 deletions resources/js/humhub.task.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ humhub.module('task', function (module, require, $) {
});
};

var deleteTaskFromContext = function(evt) {
var widget = Widget.closest(evt.$trigger);
widget.$.fadeOut('fast');

client.post(evt).then(function() {
event.trigger('task.afterDelete');
$('#task-space-menu').find('a:first').click();
module.log.success(module.text('success.delete'));
}).catch(function(e) {
widget.$.fadeIn('fast');
module.log.error(e, true);
});
};

/**
* @param evt
*/
Expand Down Expand Up @@ -255,6 +269,7 @@ humhub.module('task', function (module, require, $) {
init: init,
Form: Form,
deleteTask: deleteTask,
deleteTaskFromContext: deleteTaskFromContext,
changeState: changeState,
extensionrequest:extensionrequest
});
Expand Down
4 changes: 2 additions & 2 deletions resources/js/humhub.task.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ humhub.module('task.list', function (module, require, $) {
that.$.find('.task-list-task-details').hide();
}

if (that.isCompleted()) {
if (that.isCompleted() && that.parent()) {
that.parent().prependCompleted(that);
} else if(that.$.closest('.tasks-completed')) {
} else if(that.$.closest('.tasks-completed') && that.parent()) {
that.parent().prependPending(that);
} else {
that.$.fadeIn();
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/_support/FunctionalTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/_support/UnitTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/acceptance/TaskListCest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/acceptance/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
* in @tests/config/functional.php
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/api/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
* in @tests/config/functional.php
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/functional/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
* in @tests/config/functional.php
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/unit/TaskNotificationTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/unit/TaskQueryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/unit/TaskSortTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/unit/TaskStateTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/codeception/unit/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
* in @tests/config/functional.php
Expand Down
1 change: 1 addition & 0 deletions tests/config/api.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Here you can overwrite your functional humhub config. The default config resiedes in @humhubTests/codeception/config/config.php
*/
Expand Down
1 change: 1 addition & 0 deletions tests/config/common.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This config is shared by all suites (unit/functional/acceptance) and can be overwritten by a suite config (e.g. functional.php)
*/
Expand Down
1 change: 1 addition & 0 deletions tests/config/functional.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Here you can overwrite the default config for the functional suite. The default config resides in @humhubTests/codeception/config/config.php
*/
Expand Down
1 change: 1 addition & 0 deletions tests/config/test.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions tests/config/unit.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Here you can overwrite your functional humhub config. The default config resiedes in @humhubTests/codeception/config/config.php
*/
Expand Down
1 change: 1 addition & 0 deletions widgets/AddItemsInput.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions widgets/ContentTagDropDown.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2022 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions widgets/MyTasks.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
1 change: 1 addition & 0 deletions widgets/TaskBadge.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
Expand Down
Loading