Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync integration-tutorials with master #8237

Merged
merged 19 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions _data/release_notes_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1338,5 +1338,23 @@
],
"api-docs": "ballerina-api-docs-1.2.46.zip",
"release-notes": "ballerina-release-notes-1.2.46.md"
},
{
"version":"1.2.47",
"release-date":"2023-11-08",
"windows-installer":"ballerina-windows-installer-x64-1.2.47.msi",
"windows-installer-size":"148mb",
"linux-installer":"ballerina-linux-installer-x64-1.2.47.deb",
"linux-installer-size":"145mb",
"macos-installer":"ballerina-macos-installer-x64-1.2.47.pkg",
"macos-installer-size":"165mb",
"rpm-installer":"ballerina-linux-installer-x64-1.2.47.rpm",
"rpm-installer-size":"168mb",
"other-artefacts":[
"ballerina-1.2.47.zip",
"ballerina-1.2.47.vsix"
],
"api-docs":"ballerina-api-docs-1.2.47.zip",
"release-notes":"ballerina-release-notes-1.2.47.md"
}
]
21 changes: 21 additions & 0 deletions _data/swanlake_release_notes_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,27 @@
"api-docs": "ballerina-api-docs-2201.5.3.zip",
"release-notes": "ballerina-release-notes-2201.5.3.md"
},
{
"version":"2201.5.4",
"short-version":"2201.5.4",
"display-version":"2201.5.4 (Swan Lake Update 5)",
"release-date":"2023-11-08",
"windows-installer":"ballerina-2201.5.4-swan-lake-windows-x64.msi",
"windows-installer-size":"183mb",
"linux-installer":"ballerina-2201.5.4-swan-lake-linux-x64.deb",
"linux-installer-size":"205mb",
"macos-installer":"ballerina-2201.5.4-swan-lake-macos-x64.pkg",
"macos-installer-size":"245mb",
"macos-arm-installer":"ballerina-2201.5.4-swan-lake-macos-arm-x64.pkg",
"macos-arm-installer-size":"244mb",
"rpm-installer":"ballerina-2201.5.4-swan-lake-linux-x64.rpm",
"rpm-installer-size":"249mb",
"other-artefacts":[
"ballerina-2201.5.4-swan-lake.zip"
],
"api-docs":"ballerina-api-docs-2201.5.4.zip",
"release-notes":"ballerina-release-notes-2201.5.4.md"
},
{
"version":"2201.6.0",
"short-version":"2201.6.0",
Expand Down
1 change: 1 addition & 0 deletions community/proposals/active-proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ permalink: /community/active-proposals

|Proposal|Author|Comments|Created date|Status|
|---|----|----|----|---|
|[Data mapping ballerna openapi extension](https://github.com/ballerina-platform/ballerina-library/issues/5742)|[niveathika](https://github.com/niveathika)|1|2023-11-08|Draft|
|[Add new APIs to support read/write file operations for ndjson format](https://github.com/ballerina-platform/ballerina-library/issues/5099)|[daneshk](https://github.com/daneshk)|2|2023-10-27|Draft|
|[Proposal: Map Ballerina HATEOAS Links to OpenAPI Specification](https://github.com/ballerina-platform/ballerina-library/issues/5087)|[SachinAkash01](https://github.com/SachinAkash01)|6|2023-10-25|N/A|
|[Proposal: Ballerina GraphQL Schema Registry](https://github.com/ballerina-platform/ballerina-library/issues/4820)|[zetcco](https://github.com/zetcco)|0|2023-09-19|Active|
Expand Down
35 changes: 35 additions & 0 deletions components/learn/pattern/CodeView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use client'
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { FaRegCopy, FaCheck } from 'react-icons/fa';
import styles from './CodeView.module.css';
import { useState } from 'react'

export default function Counter(props) {
const [visible, setVisible] = useState(false);

const [copied, setCopied] = useState(false);

const codeCopy = () => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 3000);
}

const headerStyle = visible ? {} : {display: "none"};
const showToggler = props.header.length > 0;
return (
<div>
<div className={styles.code}>
<CopyToClipboard className={styles.copyToClipboard} text={props.raw} onCopy={() => codeCopy()}>
{
copied ? <FaCheck className={styles.copied} title="Copied" /> : <FaRegCopy title="Copy" />
}
</CopyToClipboard>
{showToggler && <div dangerouslySetInnerHTML={{ __html: props.header }} style={headerStyle}/>}
{showToggler && <div className={styles.collapse} onClick={() => setVisible(!visible)}>{visible?"↥":"⋯"}</div> }
<div dangerouslySetInnerHTML={{ __html: props.main }} />
</div>
</div>
)
}
24 changes: 24 additions & 0 deletions components/learn/pattern/CodeView.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.code {
background: #eeeeee;
padding: 10px;
border-radius: 5px;
margin-top: 20px;
background-color: #eeeeee !important;
}

.collapse {
background: #ddd;
padding-left: 15px;
margin-right: 25px;
user-select: none;
cursor: pointer;
}

.copyToClipboard {
float: right;
margin-top: 4px;
}

.copied {
color: #20b6b0;
}
34 changes: 34 additions & 0 deletions components/learn/pattern/readPattern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import path from 'path';
import fs from 'fs';
import { getHighlighter } from "shiki";
import { load } from "js-yaml";

export async function readPattern(pattern) {
const baseDirectory = path.resolve("pages/learn/enterprise-integration-patterns/enterprise-integration-patterns");
const highlighter = await getHighlighter({ theme: 'github-light' });
const ymlPath = path.join(baseDirectory, pattern, pattern + ".yml");
const source = fs.readFileSync(path.join(baseDirectory, pattern, pattern + ".bal"), "utf-8");
const [header, main] = split(source);
const headerCode = header.length > 0 ? highlighter.codeToHtml(header, { lang: 'ballerina' }) : "";
const mainCode = highlighter.codeToHtml(main, { lang: 'ballerina' });
const name = pattern.replace(/-.|^./g, x => " " + x.slice(-1).toUpperCase());
if (!fs.existsSync(ymlPath)) {
return { props: { mainCode, headerCode, name } };
}
const yml = fs.readFileSync(ymlPath, "utf-8");
var patternProps = load(yml) || {};
patternProps.headerCode = headerCode;
patternProps.mainCode = mainCode;
patternProps.name = patternProps.name ?? name;
patternProps.raw = source;
return { props: patternProps };
}

function split(content){
const regex = /\n(service|function|public function)/g;
const i = content.search(regex);
if(i < 80) {
return ["", content];
}
return [content.slice(0, i), content.slice(i)];
}
32 changes: 32 additions & 0 deletions downloads/1.2.x-release-notes/1.2.47.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
layout: ballerina-left-nav-release-notes
title: 1.2.47
permalink: /downloads/1.2.x-release-notes/1.2.47/
active: 1.2.47
redirect_from:
- /downloads/1.2.x-release-notes/
---

### Overview of jBallerina 1.2.47

The jBallerina 1.2.47 patch release improves upon the 1.2.46 release by addressing an [issue](https://github.com/ballerina-platform/ballerina-lang/issues/41555).

You can use the update tool to update to jBallerina 1.2.47 as follows.

**For existing users:**
If you are already using jBallerina version 1.2.14, or above, you can directly update your distribution to jBallerina 1.2.46 by executing the following command:

```
bal dist update
```

However, if you are using

- jBallerina 1.2.0 to 1.2.13, run `ballerina dist update` to update
- jBallerina 1.2.0 but being switched to a previous version, run `ballerina dist pull jballerina-1.2.47` to update
- a jBallerina version below 1.1.0, install via the [installers](https://ballerina.io/downloads/)

**For new users:**
If you have not installed jBallerina, then download the [installers](https://ballerina.io/downloads/) to install.

<style>.cGitButtonContainer, .cBallerinaTocContainer {display:none;}</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: ballerina-left-nav-release-notes
title: 2201.5.4 (Swan Lake)
permalink: /downloads/swan-lake-release-notes/2201-5-4/
active: 2201-5-4
redirect_from:
- /downloads/swan-lake-release-notes/2201-5-4
- /downloads/swan-lake-release-notes/2201.5.4/
- /downloads/swan-lake-release-notes/2201-5-4-swan-lake/
- /downloads/swan-lake-release-notes/2201-5-4-swan-lake
---

## Overview of Ballerina Swan Lake 2201.5.4

<em>Swan Lake 2201.5.4 is the fourth patch release of Ballerina 2201.5.0 (Swan Lake Update 5) and it includes a few security improvements</em>

## Update Ballerina

Update your current Ballerina installation directly to 2201.5.4 by using the [Ballerina Update Tool](/learn/update-tool/) as follows.

1. Run `bal update` to get the latest version of the Update Tool.
2. Run `bal dist pull 2201.5.4` to update to this latest distribution.

## Install Ballerina

If you have not installed Ballerina, then, download the [installers](/downloads/#swanlake) to install.
51 changes: 7 additions & 44 deletions pages/learn/enterprise-integration-patterns/[pattern].js
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,21 @@ import React from "react";
import Link from "next/link";
import Head from "next/head";
import { Row, Container, Col, Badge, Table } from "react-bootstrap";
import { CopyToClipboard } from 'react-copy-to-clipboard';
import Layout from "../../../layouts/LayoutLearn";
import { useRouter } from "next/router";
import { getHighlighter } from "shiki";
import styles from './Patterns.module.css';
import ReactMarkdown from 'react-markdown';
import { FaRegCopy, FaCheck, FaExternalLinkAlt } from 'react-icons/fa';

const baseDirectory = path.resolve("pages/learn/enterprise-integration-patterns/enterprise-integration-patterns");
import { FaExternalLinkAlt } from 'react-icons/fa';
import CodeView from '../../../components/learn/pattern/CodeView';
import { readPattern } from '../../../components/learn/pattern/readPattern';

export async function getStaticProps({ params }) {
const highlighter = await getHighlighter({ theme: 'github-light' });
const ymlPath = path.join(baseDirectory, params.pattern, params.pattern + ".yml");
const content = fs.readFileSync(path.join(baseDirectory, params.pattern, params.pattern + ".bal"), "utf-8");
const code = highlighter.codeToHtml(content, { lang: 'ballerina' });
const name = params.pattern.replace(/-.|^./g, x => " " + x.slice(-1).toUpperCase());
if (!fs.existsSync(ymlPath)) {
return { props: { code, name, content } };
}
const yml = fs.readFileSync(ymlPath, "utf-8");
var props = load(yml) || {};
props.code = code;
props.name = props.name ?? name;
props.content = content;
return { props };
return readPattern(params.pattern);
}

const baseDirectory = path.resolve("pages/learn/enterprise-integration-patterns/enterprise-integration-patterns");

export async function getStaticPaths() {
const files = fs.readdirSync(baseDirectory);
var paths = [];
Expand All @@ -68,16 +56,6 @@ export async function getStaticPaths() {

export default function Pattern(props) {
const router = useRouter();

const [copied, setCopied] = React.useState(false);

const codeCopy = () => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 3000);
}

return (
<>
<Head>
Expand Down Expand Up @@ -223,22 +201,7 @@ export default function Pattern(props) {
<Row className="pageContentRow llanding" >
<Col xs={12}>
<Container>

<div style={{
background: "#eeeeee", padding: "10px",
borderRadius: "5px",
marginTop: "20px",
backgroundColor: "#eeeeee !important"
}}>
<CopyToClipboard text={props.content}
onCopy={() => codeCopy()} style={{ float: "right" }}>
{
copied ? <FaCheck style={{ color: "20b6b0" }} title="Copied" /> : <FaRegCopy title="Copy" />
}
</CopyToClipboard>

<div className="highlight" dangerouslySetInnerHTML={{ __html: props.code }} />
</div>
<CodeView header={props.headerCode} main={props.mainCode} raw={props.raw}/>
</Container>
</Col>
</Row>
Expand Down
Binary file not shown.
Loading
Loading