-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@kong-ui-public/expressions): add router-playground-modal [KM-299]
- Loading branch information
Showing
31 changed files
with
2,004 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
component: { | ||
devServer: { | ||
framework: 'vue', | ||
bundler: 'vite', | ||
}, | ||
}, | ||
}) |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
Empty file.
12 changes: 12 additions & 0 deletions
12
packages/core/expressions/cypress/support/component-index.html
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,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>Components App</title> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
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,32 @@ | ||
// *********************************************************** | ||
// This example support/component.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
|
||
import { mount } from 'cypress/vue' | ||
|
||
// Augment the Cypress namespace to include type definitions for | ||
// your custom command. | ||
// Alternatively, can be defined in cypress/support/component.d.ts | ||
// with a <reference path="./component" /> at the top of your spec. | ||
|
||
Cypress.Commands.add('mount', mount) | ||
|
||
// Example use: | ||
// cy.mount(MyComponent) |
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,27 @@ | ||
declare namespace Cypress { | ||
interface Chainable { | ||
/** | ||
* @description Custom alias command for cy.get() to select DOM element by data-testid attribute. | ||
* @param {string} dataTestId | ||
* @example cy.dataTestId('kong-auth-login-submit') | ||
*/ | ||
getTestId(dataTestId: string): Chainable<Element> | ||
|
||
/** | ||
* @description Custom alias command for cy.find() to select DOM element by data-testid attribute. | ||
* @param {string} dataTestId | ||
* @example cy.findTestId('kong-auth-login-submit') | ||
*/ | ||
findTestId(dataTestId: string): Chainable<Element> | ||
|
||
/** | ||
* @description Custom command to mount a Vue component inside Cypress browser. | ||
* @example cy.mount(component, optionsOrProps) | ||
* @param {any} component target component | ||
* @param {any} options Options or props | ||
*/ | ||
mount(component: any, options?: any): Chainable | ||
|
||
assertValueCopiedToClipboard(value: string): Chainable | ||
} | ||
} |
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,2 @@ | ||
// Import custom Cypress commands | ||
import './commands' |
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,80 @@ | ||
# RouterPlaygroundModal | ||
|
||
A Monaco-based editor with autocomplete and syntax highlighting support for the expressions language. | ||
|
||
- [Requirements](#requirements) | ||
- [Usage](#usage) | ||
- [Install](#install) | ||
- [Props](#props) | ||
- [Events](#events) | ||
- [Usage example](#usage-example) | ||
- [TypeScript definitions](#typescript-definitions) | ||
|
||
## Requirements | ||
|
||
[See requirements for the `@kong-ui-public/expressions` package.](../README.md#requirements) | ||
|
||
## Usage | ||
|
||
### Install | ||
|
||
[See instructions for installing the `@kong-ui-public/expressions` package.](../README.md#install) | ||
|
||
### Props | ||
|
||
#### `isVisible` | ||
|
||
- type: `boolean` | ||
- required: `true` | ||
- default: `false` | ||
|
||
Controls whether the modal is visible or not. | ||
|
||
#### `localstorageKey` | ||
|
||
- type: `String` | ||
- required: `optional` | ||
- default: `kong-manager-router-playground-requests` | ||
|
||
The key to use for storing the playground requests in the local storage. | ||
|
||
#### `hideEditorActions` | ||
|
||
- type: `boolean` | ||
- required: `false` | ||
- default: `false` | ||
|
||
Controls whether the editor actions should be hidden or not. | ||
|
||
#### `initialExpression` | ||
|
||
- type: `string` | ||
- required: `false` | ||
|
||
The initial expression to be displayed in the editor. | ||
|
||
### Events | ||
|
||
#### change | ||
|
||
An `change` event is emitted when the expression has been updated. | ||
|
||
#### commit | ||
|
||
An `commit` event is emitted when the expression has been committed. | ||
|
||
#### cancel | ||
|
||
A `cancel` event is emitted when the modal's cancel button has been clicked. | ||
|
||
#### notify | ||
|
||
A `notify` event is emitted when the component needs to notify some information to user. | ||
|
||
### Usage example | ||
|
||
Please refer to the [sandbox](../sandbox/App.vue). | ||
|
||
## TypeScript definitions | ||
|
||
TypeScript definitions are bundled with the package and can be directly imported into your host application. |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import '@kong/kongponents/dist/style.css' | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import Kongponents from '@kong/kongponents' | ||
|
||
const app = createApp(App) | ||
|
||
app.use(Kongponents) | ||
app.mount('#app') |
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.