Skip to content

Commit

Permalink
Merge branch 'master' into app-component
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 authored Nov 23, 2023
2 parents 7fbc518 + 4612fe0 commit bddc36b
Show file tree
Hide file tree
Showing 21 changed files with 643 additions and 541 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Bug report
about: Report a bug so we can fix and improve
labels: bug
---

#### Describe the bug
A clear and concise description of what the bug is.

#### How to Reproduce
Steps to reproduce the issue. Attach all resources that can help us understand the issue:

- Screenshots
- Link to GitHub repository with project that has issues
- Files that can help reproduce the issue, like your AsyncAPI file, either paste inside the issue in a code block or in a sharable [gist](https://gist.github.com/)

#### Expected behavior
A clear and concise description of what you expected to happen.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Project Communication
url: https://github.com/asyncapi/asyncapi/issues/115
about: Check out all the options to communicate with AsyncAPI community.
- name: Slack
url: https://www.asyncapi.com/slack-invite/
about: Don't open issues for questions or support, better talk to us on Slack first.
- name: AsyncAPI Website
url: https://www.asyncapi.com/
about: For more information about AsyncAPI visit our website.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest how we can improve
labels: enhancement
---

#### Reason/Context
Please try answering few of those questions
- Why we need this improvement?
- How will this change help?
- What is the motivation?


#### Description
Please try answering few of those questions
- What changes have to be introduced?
- Will this be a breaking change?
- How could it be implemented/designed?
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/pitch.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pitch
description: 'Do you have an idea and a product enhancement? Time to pitch!'
title: '[PITCH]:'
labels: ['Pitch']
labels: ['pitch']
body:
- type: markdown
attributes:
Expand Down
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Thank you for your contribution. Before you submit the pull request:
1. Follow our contribution guidelines
2. Test your changes and attach their results to the pull request.
3. Update the relevant documentation.
-->

**Description**

- ...
- ...
- ...

**Related issue(s)**
<!-- If you refer to a particular issue, provide its number, otherwise, remove this section.
For example, `Resolves #123`, `Fixes #43`, or `See also #33`. The `See also #33` option will not automatically close the issue after the PR merge. -->
119 changes: 0 additions & 119 deletions .github/workflows/add-scope-to-bet.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
GITHUB_LOGIN: asyncapi-bot
MERGE_LABELS: ""
MERGE_LABELS: "!do-not-merge"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
MERGE_RETRIES: "20"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issues-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:shapeitapp/shapeitapp created:${{ env.last_month }}'
SEARCH_QUERY: 'repo:asyncapi/studio created:${{ env.last_month }}'

- name: Create issue
uses: peter-evans/create-issue-from-file@v4
Expand Down
12 changes: 6 additions & 6 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"./LICENSE"
],
"dependencies": {
"@asyncapi/avro-schema-parser": "^3.0.2",
"@asyncapi/converter": "^1.3.1",
"@asyncapi/avro-schema-parser": "^3.0.5",
"@asyncapi/converter": "^1.4.2",
"@asyncapi/openapi-schema-parser": "^3.0.4",
"@asyncapi/parser": "^3.0.0-next-major-spec.3",
"@asyncapi/react-component": "^1.0.2",
"@asyncapi/parser": "^3.0.0-next-major-spec.12",
"@asyncapi/react-component": "^1.2.2",
"@asyncapi/specs": "^6.0.0-next-major-spec.6",
"@ebay/nice-modal-react": "^1.2.10",
"@headlessui/react": "^1.7.4",
Expand Down Expand Up @@ -75,8 +75,8 @@
},
"devDependencies": {
"@asyncapi/dotnet-nats-template": "^0.12.1",
"@asyncapi/go-watermill-template": "^0.2.43",
"@asyncapi/html-template": "^0.28.4",
"@asyncapi/go-watermill-template": "^0.2.46",
"@asyncapi/html-template": "^1.0.0",
"@asyncapi/java-spring-cloud-stream-template": "^0.13.4",
"@asyncapi/java-spring-template": "^1.4.0",
"@asyncapi/java-template": "^0.2.1",
Expand Down
5 changes: 2 additions & 3 deletions apps/studio/src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Template } from './Template';
import { VisualiserTemplate } from './Visualiser';

import { debounce } from '../helpers';
import { usePanelsState, useDocumentsState, useSettingsState } from '../state';
import { usePanelsState, useDocumentsState } from '../state';

import type { FunctionComponent } from 'react';

Expand All @@ -15,8 +15,7 @@ interface ContentProps {}
export const Content: FunctionComponent<ContentProps> = () => { // eslint-disable-line sonarjs/cognitive-complexity
const { show, secondaryPanelType } = usePanelsState();
const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null;
const v3Enabled = useSettingsState(state => state.editor.v3support) || false;
const isV3 = document?.version() === '3.0.0' && v3Enabled;
const isV3 = document?.version() === '3.0.0';
const navigationEnabled = show.primarySidebar;
const editorEnabled = show.primaryPanel;
const viewEnabled = show.secondaryPanel;
Expand Down
18 changes: 1 addition & 17 deletions apps/studio/src/components/Modals/Settings/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ export const SettingsModal = create<SettingsModalProps>(({ activeTab = 'editor'
const [governanceHints, setGovernanceHints] = useState(settings.governance.show.hints);
const [autoRendering, setAutoRendering] = useState(settings.templates.autoRendering);
const [confirmDisabled, setConfirmDisabled] = useState(true);
const [v3support, setV3support] = useState(settings.editor.v3support);

const createNewState = (): SettingsState => {
return {
editor: {
autoSaving,
savingDelay,
v3support
},
governance: {
show: {
Expand All @@ -88,7 +86,7 @@ export const SettingsModal = create<SettingsModalProps>(({ activeTab = 'editor'
const newState = createNewState();
const isThisSameObjects = settingsSvc.isEqual(newState);
setConfirmDisabled(isThisSameObjects);
}, [autoSaving, savingDelay, autoRendering, governanceWarnings, governanceInformations, governanceHints, v3support]);
}, [autoSaving, savingDelay, autoRendering, governanceWarnings, governanceInformations, governanceHints]);

const onCancel = useCallback(() => {
modal.hide();
Expand Down Expand Up @@ -131,20 +129,6 @@ export const SettingsModal = create<SettingsModalProps>(({ activeTab = 'editor'
Save automatically after each change in the document or manually.
</div>
</div>
<div className="flex flex-col mt-4 text-sm">
<div className="flex flex-row content-center justify-between">
<label
htmlFor="settings-auto-saving"
className="flex justify-right items-center w-1/2 content-center font-medium text-gray-700"
>
Enable v3 support
</label>
<Switch
toggle={v3support}
onChange={(v) => setV3support(v)}
/>
</div>
</div>
<div className="flex flex-col mt-4 text-sm">
<div className="flex flex-row content-center justify-between">
<label
Expand Down
5 changes: 2 additions & 3 deletions apps/studio/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { show as showModal } from '@ebay/nice-modal-react';
import { Tooltip } from './common';
import { SettingsModal, NewFileModal } from './Modals';

import { usePanelsState, panelsState, useDocumentsState, useSettingsState } from '../state';
import { usePanelsState, panelsState, useDocumentsState } from '../state';

import type { FunctionComponent, ReactNode } from 'react';
import type { PanelsState } from '../state/panels.state';
Expand Down Expand Up @@ -53,8 +53,7 @@ interface SidebarProps {}
export const Sidebar: FunctionComponent<SidebarProps> = () => {
const { show, secondaryPanelType } = usePanelsState();
const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null;
const v3Enabled = useSettingsState(state => state.editor.v3support) || false;
const isV3 = document?.version() === '3.0.0' && v3Enabled;
const isV3 = document?.version() === '3.0.0';

if (show.activityBar === false) {
return null;
Expand Down
5 changes: 2 additions & 3 deletions apps/studio/src/components/Terminal/TerminalTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';

import { TerminalInfo } from './TerminalInfo';
import { otherState, useSettingsState, useDocumentsState } from '../../state';
import { otherState, useDocumentsState } from '../../state';

export interface TerminalTab {
name: string;
Expand All @@ -20,8 +20,7 @@ export const TerminalTabs: React.FunctionComponent<TerminalTabsProps> = ({
}) => {
const [activeTab, setActiveTab] = useState(active);
const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null;
const v3Enabled = useSettingsState(state => state.editor.v3support) || false;
const isV3 = document?.version() === '3.0.0' && v3Enabled;
const isV3 = document?.version() === '3.0.0';
if (tabs.length === 0) {
return null;
}
Expand Down
27 changes: 19 additions & 8 deletions apps/studio/src/examples/tutorials/invalid.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# This invalid file exists solely for educational purposes, and if you come across it, here is the tutorial: https://www.asyncapi.com/docs/tutorials/studio-document-validation

asyncapi: '1.0.0'
asyncapi: 3.0.0
info:
title: Streetlights API
version: '1.0.0'
description: |
The Smartylighting Streetlights API allows you
to remotely manage the city lights.
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'

servers:
mosquitto:
url: mqtt://test.mosquitto.org
url: test.mosquitto.org
protocol: mqtt

channels:
light/measured:
publish:
summary: Inform about environmental lighting conditions for a particular streetlight.
operationId: onLightMeasured
message:
lightMeasured:
address: 'light/measured'
messages:
lightMeasuredMessage:
name: LightMeasured
payload:
type: object
Expand All @@ -30,6 +34,13 @@ channels:
minimum: 0
description: Light intensity measured in lumens.
sentAt:
type: integer
type: string
format: date-time
description: Date and time when the message was sent.

operations:
onLightMeasured:
action: 'receive'
summary: Inform about environmental lighting conditions for a particular streetlight.
channel:
$ref: '#/channels/lightMeasured'
Loading

0 comments on commit bddc36b

Please sign in to comment.