-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate
WCF.User.Profile.ActivityPointList
to Typescript
Closes #6092
- Loading branch information
Showing
6 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Shows the activity point list for users. | ||
* | ||
* @author Marcel Werk | ||
* @copyright 2001-2024 WoltLab GmbH | ||
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | ||
* @since 6.2 | ||
*/ | ||
|
||
import { dboAction } from "WoltLabSuite/Core/Ajax"; | ||
import { promiseMutex } from "WoltLabSuite/Core/Helper/PromiseMutex"; | ||
import { wheneverFirstSeen } from "WoltLabSuite/Core/Helper/Selector"; | ||
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog"; | ||
import { getPhrase } from "WoltLabSuite/Core/Language"; | ||
|
||
type ResponseGetDetailedActivityPointList = { | ||
template: string; | ||
}; | ||
|
||
async function showDialog(userId: number): Promise<void> { | ||
const response = (await dboAction("getDetailedActivityPointList", "wcf\\data\\user\\UserProfileAction") | ||
.objectIds([userId]) | ||
.dispatch()) as ResponseGetDetailedActivityPointList; | ||
|
||
const dialog = dialogFactory().fromHtml(response.template).withoutControls(); | ||
dialog.show(getPhrase("wcf.user.activityPoint")); | ||
} | ||
|
||
export function setup(): void { | ||
wheneverFirstSeen(".activityPointsDisplay", (button) => { | ||
button.addEventListener( | ||
"click", | ||
promiseMutex((event) => { | ||
event.preventDefault(); | ||
return showDialog(parseInt(button.dataset.userId!)); | ||
}), | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
wcfsetup/install/files/js/WoltLabSuite/Core/Component/User/ActivityPointList.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.