summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-02-19 21:26:07 +0000
committerLuke Bennett <lbennett@gitlab.com>2019-03-06 10:40:19 +0000
commit1263c79095c30fbdeecb26935aded531163c1b3e (patch)
tree572cfa6b06911395d0f6c772ffb82cdf52d17ec3 /app/assets
parentc9e5ce8dbd25203484b43c48f0a55a5d7bf396e8 (diff)
downloadgitlab-ce-1263c79095c30fbdeecb26935aded531163c1b3e.tar.gz
Add PersistentUserCallout factory method
Use factory method to DRY safe instantiation. Add tests for PersistentUserCallout.
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/persistent_user_callout.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/persistent_user_callout.js b/app/assets/javascripts/persistent_user_callout.js
index 1e34e74a152..4a08e158f6b 100644
--- a/app/assets/javascripts/persistent_user_callout.js
+++ b/app/assets/javascripts/persistent_user_callout.js
@@ -31,4 +31,12 @@ export default class PersistentUserCallout {
Flash(__('An error occurred while dismissing the alert. Refresh the page and try again.'));
});
}
+
+ static factory(container) {
+ if (!container) {
+ return undefined;
+ }
+
+ return new PersistentUserCallout(container);
+ }
}