forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting] New Platform: moves most of our libs/constants and utils …
…to np shims (elastic#55935) * Moves a majority of our UI lib/component and utils to np shims * Fixing some slight np differences from legacy * Mostly shimmed client, save for a few APIs and routing * Fixing canvas job notifier * Un-needed typedef file Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
ab84c5a
commit cb12d2a
Showing
11 changed files
with
105 additions
and
124 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
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
13 changes: 0 additions & 13 deletions
13
x-pack/legacy/plugins/reporting/public/lib/job_completion_notifications.d.ts
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
x-pack/legacy/plugins/reporting/public/lib/job_completion_notifications.js
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
x-pack/legacy/plugins/reporting/public/lib/job_completion_notifications.ts
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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY } from '../../common/constants'; | ||
|
||
type jobId = string; | ||
|
||
const set = (jobs: any) => { | ||
sessionStorage.setItem(JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY, JSON.stringify(jobs)); | ||
}; | ||
|
||
const getAll = () => { | ||
const sessionValue = sessionStorage.getItem(JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY); | ||
return sessionValue ? JSON.parse(sessionValue) : []; | ||
}; | ||
|
||
export const add = (jobId: jobId) => { | ||
const jobs = getAll(); | ||
jobs.push(jobId); | ||
set(jobs); | ||
}; | ||
|
||
export const remove = (jobId: jobId) => { | ||
const jobs = getAll(); | ||
const index = jobs.indexOf(jobId); | ||
|
||
if (!index) { | ||
throw new Error('Unable to find job to remove it'); | ||
} | ||
|
||
jobs.splice(index, 1); | ||
set(jobs); | ||
}; |
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
Oops, something went wrong.