Skip to content
Snippets Groups Projects
Select Git revision
  • 8b323add53b1633a372e6198b321b676110a259c
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

report.ts

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    report.ts 1.13 KiB
    /**
     * Message reporting
     *
     * @author      Viktoria Wiebe
     * @author      Jan-Hendrik Willms <tleilax+studip@gmail.com>
     * @version     1.0
     * @since       Stud.IP 4.5
     * @license     GLP2 or any later version
     * @copyright   2019 Stud.IP Core Group
     */
    import eventBus from "./event-bus";
    
    export default class Report
    {
        // Info message
        static info (title: string, content: string) {
            Report.#reportMessage('info', title, content);
        }
    
        // Success message
        static success (title: string, content: string) {
            Report.#reportMessage('success', title, content);
        }
    
        // Warning message
        static warning (title: string, content: string) {
            Report.#reportMessage('warning', title, content);
        }
    
        // Error message
        static error (title: string, content: string) {
            Report.#reportMessage('error', title, content);
        }
    
        static #reportMessage(type: string, title: string, content: string) {
            eventBus.emit(
                'push-system-notification',
                {
                    type: type,
                    message: title,
                    details: content
                }
            );
        }
    }