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.
Merge branch 'master' into alerting/consumer-based-rbac
* master: (32 commits) [Ingest Pipelines] Load from json (elastic#70297) [Rum Dashbaord] Rum selected service view (elastic#70579) [Uptime] Prevent duplicate requests on load for index status (elastic#70585) [ML] Changing shared module setup function parameters (elastic#70589) [Ingest Manager] Add ability to sort to agent configs and package configs (elastic#70676) [Alerting] document requirements for developing new action types (elastic#69164) Fixed adding an extra space character on selecting alert variable in action text fields (elastic#70028) [Maps] show vector tile labels on top (elastic#69444) chore(NA): upgrade to lodash@4 (elastic#69868) Add Snapshot Restore README with quick-testing steps. (elastic#70494) [EPM] Use higher priority than default templates (elastic#70640) [Maps] Fix cannot select Solid fill-color when removing fields (elastic#70621) [kbn/optimizer] only build specified themes (elastic#70389) Fix saved query modal overlay (elastic#68826) Update component templates list to render empty prompt inside of content container. Show detail panel when deep-linked, even if there are no component templates. (elastic#70633) [Security Solution] Renames the `Investigate in Resolver` Timeline action (elastic#70634) fix 400 error on initial signals search (elastic#70618) [Maps] fix unable to edit heatmap metric (elastic#70606) Update network idle timeout (elastic#70629) [APM] Disable flaky useFetcher test (elastic#70638) ...
- Loading branch information
Showing
638 changed files
with
7,478 additions
and
3,248 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,15 @@ | ||
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli) | ||
# Visit https://fossa.com to learn more | ||
|
||
version: 2 | ||
cli: | ||
server: https://app.fossa.com | ||
fetcher: custom | ||
project: kibana | ||
analyze: | ||
modules: | ||
- name: kibana | ||
type: nodejs | ||
strategy: yarn.lock | ||
target: . | ||
path: . |
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
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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...bn-optimizer/src/__fixtures__/mock_repo/src/legacy/ui/public/styles/_globals_v7light.scss
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 @@ | ||
$globalStyleConstant: 11; |
1 change: 1 addition & 0 deletions
1
...kbn-optimizer/src/__fixtures__/mock_repo/src/legacy/ui/public/styles/_globals_v8dark.scss
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 @@ | ||
$globalStyleConstant: 12; |
1 change: 1 addition & 0 deletions
1
...bn-optimizer/src/__fixtures__/mock_repo/src/legacy/ui/public/styles/_globals_v8light.scss
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 @@ | ||
$globalStyleConstant: 13; |
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,92 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { parseThemeTags } from './theme_tags'; | ||
|
||
it('returns default tags when passed undefined', () => { | ||
expect(parseThemeTags()).toMatchInlineSnapshot(` | ||
Array [ | ||
"v7dark", | ||
"v7light", | ||
] | ||
`); | ||
}); | ||
|
||
it('returns all tags when passed *', () => { | ||
expect(parseThemeTags('*')).toMatchInlineSnapshot(` | ||
Array [ | ||
"v7dark", | ||
"v7light", | ||
"v8dark", | ||
"v8light", | ||
] | ||
`); | ||
}); | ||
|
||
it('returns specific tag when passed a single value', () => { | ||
expect(parseThemeTags('v8light')).toMatchInlineSnapshot(` | ||
Array [ | ||
"v8light", | ||
] | ||
`); | ||
}); | ||
|
||
it('returns specific tags when passed a comma separated list', () => { | ||
expect(parseThemeTags('v8light, v7dark,v7light')).toMatchInlineSnapshot(` | ||
Array [ | ||
"v7dark", | ||
"v7light", | ||
"v8light", | ||
] | ||
`); | ||
}); | ||
|
||
it('returns specific tags when passed an array', () => { | ||
expect(parseThemeTags(['v8light', 'v7light'])).toMatchInlineSnapshot(` | ||
Array [ | ||
"v7light", | ||
"v8light", | ||
] | ||
`); | ||
}); | ||
|
||
it('throws when an invalid tag is in the array', () => { | ||
expect(() => parseThemeTags(['v8light', 'v7light', 'bar'])).toThrowErrorMatchingInlineSnapshot( | ||
`"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light]"` | ||
); | ||
}); | ||
|
||
it('throws when an invalid tags in comma separated list', () => { | ||
expect(() => parseThemeTags('v8light ,v7light,bar,box ')).toThrowErrorMatchingInlineSnapshot( | ||
`"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light]"` | ||
); | ||
}); | ||
|
||
it('returns tags in alphabetical order', () => { | ||
const tags = parseThemeTags(['v7light', 'v8light']); | ||
expect(tags).toEqual(tags.slice().sort((a, b) => a.localeCompare(b))); | ||
}); | ||
|
||
it('returns an immutable array', () => { | ||
expect(() => { | ||
const tags = parseThemeTags('v8light'); | ||
// @ts-expect-error | ||
tags.push('foo'); | ||
}).toThrowErrorMatchingInlineSnapshot(`"Cannot add property 1, object is not extensible"`); | ||
}); |
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,65 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { ascending } from './array_helpers'; | ||
|
||
const tags = (...themeTags: string[]) => | ||
Object.freeze(themeTags.sort(ascending((tag) => tag)) as ThemeTag[]); | ||
|
||
const validTag = (tag: any): tag is ThemeTag => ALL_THEMES.includes(tag); | ||
const isArrayOfStrings = (input: unknown): input is string[] => | ||
Array.isArray(input) && input.every((v) => typeof v === 'string'); | ||
|
||
export type ThemeTags = readonly ThemeTag[]; | ||
export type ThemeTag = 'v7light' | 'v7dark' | 'v8light' | 'v8dark'; | ||
export const DEFAULT_THEMES = tags('v7light', 'v7dark'); | ||
export const ALL_THEMES = tags('v7light', 'v7dark', 'v8light', 'v8dark'); | ||
|
||
export function parseThemeTags(input?: any): ThemeTags { | ||
if (!input) { | ||
return DEFAULT_THEMES; | ||
} | ||
|
||
if (input === '*') { | ||
return ALL_THEMES; | ||
} | ||
|
||
if (typeof input === 'string') { | ||
input = input.split(',').map((tag) => tag.trim()); | ||
} | ||
|
||
if (!isArrayOfStrings(input)) { | ||
throw new Error(`Invalid theme tags, must be an array of strings`); | ||
} | ||
|
||
if (!input.length) { | ||
throw new Error( | ||
`Invalid theme tags, you must specify at least one of [${ALL_THEMES.join(', ')}]` | ||
); | ||
} | ||
|
||
const invalidTags = input.filter((t) => !validTag(t)); | ||
if (invalidTags.length) { | ||
throw new Error( | ||
`Invalid theme tags [${invalidTags.join(', ')}], options: [${ALL_THEMES.join(', ')}]` | ||
); | ||
} | ||
|
||
return tags(...input); | ||
} |
Oops, something went wrong.