Skip to content

Commit

Permalink
Increment version to 1.3.18
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh committed Jul 8, 2024
1 parent edbcf46 commit 4b24ac6
Show file tree
Hide file tree
Showing 52 changed files with 4,144 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/doc_issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**Is your feature request related to a problem?**
A new feature has been added.

**What solution would you like?**
Document the usage of the new feature.

**What alternatives have you considered?**
N/A

**Do you have any additional context?**
See please
42 changes: 42 additions & 0 deletions .github/workflows/create_doc_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create Documentation Issue
on:
pull_request:
types:
- labeled
env:
PR_NUMBER: ${{ github.event.number }}

jobs:
create-issue:
if: ${{ github.event.label.name == 'needs-documentation' }}
runs-on: ubuntu-latest
name: Create Documentation Issue
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
# opensearch-trigger-bot installation ID
installation_id: 22958780

- name: Checkout code
uses: actions/checkout@v2

- name: Edit the issue template
run: |
echo "https://github.com/opensearch-project/OpenSearch-Dashboards/pull/${{ env.PR_NUMBER }}." >> ./.github/doc_issue_template.md
- name: Create Issue From File
id: create-issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Add documentation related to new feature
content-filepath: ./.github/doc_issue_template.md
labels: documentation
repository: opensearch-project/documentation-website
token: ${{ steps.github_app_token.outputs.token }}

- name: Print Issue
run: echo "Created related documentation issue ${{ steps.create-issue.outputs.issue-number }}"
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# use stylelint
*.scss
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
target
19 changes: 19 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends:
- stylelint-config-standard-scss
rules:
# while we still use node-sass, only legacy rgb() notation is allowed
color-function-notation: "legacy"
# recommended to turn off descending specificity since we use a lot of nesting:
# https://stylelint.io/user-guide/rules/list/no-descending-specificity/
no-descending-specificity: null
# need to use global function/value names from EUI
function-name-case: null
value-keyword-case: null
scss/no-global-function-names: null
# camelCase names
keyframes-name-pattern: "^[a-z][a-zA-Z0-9_-]+$"
selector-class-pattern: "^[a-z][a-zA-Z0-9_-]+$"
selector-id-pattern: "^[a-z][a-zA-Z0-9_-]+$"
scss/at-mixin-pattern: "^[a-z][a-zA-Z0-9_-]+$"
scss/at-function-pattern: "^[a-z][a-zA-Z0-9_-]+$"
scss/dollar-variable-pattern: "^[a-z][a-zA-Z0-9_-]+$"
15 changes: 15 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scanSettings": {
"configMode": "LOCAL",
"configExternalURL": "",
"projectToken": "",
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# CHANGELOG
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased](https://github.com/opensearch-project/OpenSearch-Dashboards/compare/1.3.16...1.3)

### 💥 Breaking Changes

### Deprecations

### 🛡 Security

### 📈 Features/Enhancements

### 🐛 Bug Fixes

### 🚞 Infrastructure

### 📝 Documentation

### 🛠 Maintenance

- [Version] Increment version to 1.3.18 ([](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/))

### 🪛 Refactoring

### 🔩 Tests

## [1.3.17 - 2024-06-06](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/1.3.17)

### 💥 Breaking Changes
Expand Down
15 changes: 15 additions & 0 deletions dev-tools/get-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0

set -e

PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d [:space:])

echo "$PACKAGE_VERSION"
12 changes: 12 additions & 0 deletions examples/expressions_example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
root: true,
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],
rules: {
'@osd/eslint/require-license-header': 'off',
},
};
7 changes: 7 additions & 0 deletions examples/expressions_example/.i18nrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"prefix": "expressionsExample",
"paths": {
"expressionsExample": "."
},
"translations": ["translations/ja-JP.json"]
}
11 changes: 11 additions & 0 deletions examples/expressions_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# expressions_example

An OpenSearch Dashboards example plugin to demonstrate the expressions plugin

---

## Development

See the [OpenSearch Dashboards contributing
guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/master/CONTRIBUTING.md) for instructions
setting up your development environment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export * from './quick_form_fn';
export * from './quick_form_renderer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from '@osd/i18n';
import {
ExpressionFunctionDefinition,
Render,
} from '../../../../../src/plugins/expressions/public';
import { QuickFormRenderValue } from './quick_form_renderer';

type Arguments = QuickFormRenderValue;

export const quickFormFn = (): ExpressionFunctionDefinition<
'quick-form',
unknown,
Arguments,
Render<QuickFormRenderValue>
> => ({
name: 'quick-form',
type: 'render',
help: i18n.translate('expressionsExample.function.avatar.help', {
defaultMessage: 'Render a simple form that sends the value back as an event on click',
}),
args: {
label: {
types: ['string'],
help: i18n.translate('expressionsExample.function.form.args.label.help', {
defaultMessage: 'Form label',
}),
default: i18n.translate('expressionsExample.function.form.args.label.default', {
defaultMessage: 'Input',
}),
},
buttonLabel: {
types: ['string'],
help: i18n.translate('expressionsExample.function.form.args.buttonLabel.help', {
defaultMessage: 'Button label',
}),
default: i18n.translate('expressionsExample.function.form.args.buttonLabel.default', {
defaultMessage: 'Submit',
}),
},
},
fn: (input, args) => {
return {
type: 'render',
as: 'quick-form-renderer',
value: { ...args },
};
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useCallback, useState } from 'react';
import { EuiForm, EuiFormRow, EuiButton, EuiFieldText } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import { render, unmountComponentAtNode } from 'react-dom';
import { ExpressionRenderDefinition } from '../../../../../src/plugins/expressions/public';

export interface QuickFormRenderValue {
label: string;
buttonLabel: string;
}

export const quickFormRenderer: ExpressionRenderDefinition<QuickFormRenderValue> = {
name: 'quick-form-renderer',
displayName: i18n.translate('expressionsExample.form.render.help', {
defaultMessage: 'Render a simple input form',
}),
reuseDomNode: true,
render: (domNode, config, handlers) => {
handlers.onDestroy(() => {
unmountComponentAtNode(domNode);
});

render(
<QuickForm
{...config}
onSubmit={(value) =>
handlers.event({
data: value,
})
}
/>,
domNode,
handlers.done
);
},
};

interface QuickFormProps extends QuickFormRenderValue {
onSubmit: Function;
}

const QuickForm = ({ onSubmit, buttonLabel, label }: QuickFormProps) => {
const [value, setValue] = useState('');
const handleClick = useCallback(() => {
onSubmit(value);
}, [onSubmit, value]);

return (
<EuiForm>
<EuiFormRow label={label}>
<EuiFieldText value={value} onChange={(e) => setValue(e.target.value)} />
</EuiFormRow>
<EuiButton onClick={handleClick}>{buttonLabel}</EuiButton>
</EuiForm>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export * from './sleep';
export * from './square';
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from '@osd/i18n';
import { ExpressionFunctionDefinition } from '../../../../../src/plugins/expressions/public';

interface Arguments {
time: number;
}

export const sleep = (): ExpressionFunctionDefinition<'sleep', any, Arguments, any> => ({
name: 'sleep',
help: i18n.translate('expressionsExample.function.sleep.help', {
defaultMessage: 'Generates range object',
}),
args: {
time: {
types: ['number'],
help: i18n.translate('expressionsExample.function.sleep.time.help', {
defaultMessage: 'Time for settimeout',
}),
required: false,
},
},
fn: async (input, args, context) => {
await new Promise((r) => setTimeout(r, args.time));
return input;
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { i18n } from '@osd/i18n';
import { ExpressionFunctionDefinition } from '../../../../../src/plugins/expressions/public';

export const square = (): ExpressionFunctionDefinition<'square', number, {}, any> => ({
name: 'square',
help: i18n.translate('expressionsExample.function.square.help', {
defaultMessage: 'Squares the input',
}),
args: {},
fn: async (input, args, context) => {
return input * input;
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export * from './basic';
export * from './render';
export * from './action';
Loading

0 comments on commit 4b24ac6

Please sign in to comment.