Skip to content

Commit

Permalink
Created new notification class with stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
FireLemons committed Sep 29, 2023
1 parent a14dea3 commit 7162832
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/javascript/__tests__/notifier.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env jest */

require('jest')
const Notifier = require('../src/notifier.js')
const { Notifier } = require('../src/notifier.js')

let notificationsElement
let notifier
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/all_casa_admin/patch_notes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Notifier = require('../notifier')
const { Notifier } = require('../notifier')
const TypeChecker = require('../type_checker')
const patchNotePath = window.location.pathname
const patchNoteFormBeforeEditData = {}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/case_emancipation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env jquery */
/* global $ */

const Notifier = require('./notifier')
const { Notifier } = require('./notifier')
const TypeChecker = require('./type_checker')

const emancipationPage = {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global alert */
/* global $ */
const Notifier = require('./notifier')
const { Notifier } = require('./notifier')
let pageNotifier

const defineCaseContactsTable = function () {
Expand Down
40 changes: 39 additions & 1 deletion app/javascript/src/notifier.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
/* global $ */
const TypeChecker = require('./type_checker.js')

module.exports = class Notifier {
class Notification {
constructor (notificationElementAsJQuery) {
TypeChecker.checkNonEmptyJQueryObject(notificationElementAsJQuery, 'notificationElementAsJQuery')

this.notificationElement = notificationElementAsJQuery
}

dismiss () {

}

getText () {

}

isDismissable () {

}

isDismissed () {

}

setDismissable () {

}

setText () {

}

toggleDismissable () {

}
}

class Notifier {
// @param {object} notificationsElement The notification DOM element as a jQuery object
constructor (notificationsElement) {
TypeChecker.checkNonEmptyJQueryObject(notificationsElement, 'notificationsElement')
Expand Down Expand Up @@ -116,3 +152,5 @@ module.exports = class Notifier {
}
}
}

module.exports = { Notifier, Notification }

0 comments on commit 7162832

Please sign in to comment.