Skip to content

Commit 118945c

Browse files
committed
Updated default branch docs (manually)
1 parent cf26f6f commit 118945c

6 files changed

Lines changed: 32 additions & 35 deletions

File tree

esw-gateway-ui-example/flows/base-flow.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ <h2><a href="#generate-application" name="generate-application" class="anchor"><
164164
</code></pre>
165165
<p>This will generate a sample folder with <code>docs</code> and <code>src</code> folders. For a sanity check, let&rsquo;s go ahead and build the frontend created by the template. This will also help ensure you have the necessary tools installed.</p>
166166
<h3><a href="#compile-the-frontend" name="compile-the-frontend" class="anchor"><span class="anchor-link"></span></a>Compile the Frontend</h3>
167-
<p>The <code>sample/src</code> sub-folder is where your frontend application is located. It uses Typescript, React and node. Make sure node version <code>v16.0.0</code> or higher is installed in your machine. Let&rsquo;s compile our generated application.</p>
167+
<p>The <code>sample/src</code> sub-folder is where your frontend application is located. It uses Typescript, React and node. Make sure node version <code>v22.15.1</code> and npm 10.9.2 or higher are installed on your machine. Let&rsquo;s compile our generated application.</p>
168168
<pre class="prettyprint"><code class="language-bash">cd sample
169169
npm install
170170
npm start
@@ -188,7 +188,7 @@ <h3><a href="#create-login-component" name="create-login-component" class="ancho
188188
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/Login.tsx#L2-L11" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">import React, { useEffect } from &#39;react&#39;
189189
import { useAuth } from &#39;../hooks/useAuth&#39;
190190

191-
export const Login = (): JSX.Element =&gt; {
191+
export const Login = (): React.JSX.Element =&gt; {
192192
const { login } = useAuth()
193193

194194
useEffect(login, [login])
@@ -205,7 +205,7 @@ <h3><a href="#update-main-app-component-with-authentication" name="update-main-a
205205
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/Main.tsx#L2-L55" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">import * as React from &#39;react&#39;
206206
import { useAuth } from &#39;../hooks/useAuth&#39;
207207
import { Login } from &#39;./Login&#39;
208-
export const Main = (): JSX.Element =&gt; {
208+
export const Main = (): React.JSX.Element =&gt; {
209209
const { auth } = useAuth()
210210
if (!auth) return &lt;div&gt;Loading&lt;/div&gt;
211211
const isAuthenticated = auth?.isAuthenticated() ?? false
@@ -235,7 +235,7 @@ <h3><a href="#update-main-app-component-with-authentication" name="update-main-a
235235
LocationService,
236236
loadGlobalConfig
237237
} from &#39;@tmtsoftware/esw-ts&#39;
238-
const App = (): JSX.Element =&gt; {
238+
export const App = (): React.JSX.Element =&gt; {
239239
// ..
240240
// ..
241241
const { error, data: initialised } = useQuery(() =&gt;
@@ -259,7 +259,7 @@ <h3><a href="#update-main-app-component-with-authentication" name="update-main-a
259259
<p>After adding this section, run the following command to see the progress that we made till now.</p>
260260
<pre class="prettyprint"><code class="language-bash">npm start
261261
</code></pre>
262-
<p>You should now see <code>Loading...</code> on the browser screen. </p>
262+
<p>You should now see <code>Loading...</code> on the browser screen.</p>
263263
<p><img src="../images/login.png" alt="login" /></p>
264264
<p>This is because the UI is now trying to find the AAS authorization server, but we have not yet started CSW services. We will start them now, as well as the UI Gateway which will be needed for our subsequent flows.</p>
265265
<h2><a href="#starting-backend-services" name="starting-backend-services" class="anchor"><span class="anchor-link"></span></a>Starting backend services</h2>
@@ -269,7 +269,7 @@ <h2><a href="#starting-backend-services" name="starting-backend-services" class=
269269
</code></pre>
270270
<p>Start the UI Gateway Service using esw-services.</p>
271271
<pre class="prettyprint"><code class="language-bash">cs install esw-services
272-
esw-services start -g
272+
esw-services start start-eng-ui-services
273273

274274
</code></pre>
275275
<p>Now try reloading the front end in browser. If the page is still up, refresh the page. If you closed it, restart the server using:</p>
@@ -278,8 +278,8 @@ <h2><a href="#starting-backend-services" name="starting-backend-services" class=
278278
<p>You should be getting redirected to keycloak login page.</p>
279279
<p><img src="../images/user-login.png" alt="user-login" /></p>
280280
<p>Try logging in with one of predefined users in csw-services.</p>
281-
<p>Visit <a href="https://tmtsoftware.github.io/csw/0.1.0-SNAPSHOT/apps/cswservices.html#predefined-users-">here</a> to find the predefined users.</p>
282-
<p>Visit <a href="https://tmtsoftware.github.io/esw/0.1.0-SNAPSHOT/uisupport/gateway.html">here</a> to know more about users &amp; the roles.</p>
281+
<p>Visit <a href="https://tmtsoftware.github.io/csw/6.0.0/apps/cswservices.html#predefined-users-">here</a> to find the predefined users.</p>
282+
<p>Visit <a href="https://tmtsoftware.github.io/esw/1.0.2/uisupport/gateway.html">here</a> to know more about users &amp; the roles.</p>
283283
<p>Once you are logged in, you would be greeted again with <code>Hello world</code>.</p>
284284
<p>Now, we can make use of authorization data to send a request to a protected route of the Gateway server.</p>
285285
<h3><a href="#cleanup" name="cleanup" class="anchor"><span class="anchor-link"></span></a>Cleanup</h3>

esw-gateway-ui-example/flows/submit-commands.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@
156156
<div class="md-content__searchable">
157157
<h1><a href="#adding-a-submit-command" name="adding-a-submit-command" class="anchor"><span class="anchor-link"></span></a>Adding a Submit Command</h1>
158158
<p>In this part of the tutorial, we want to send a Setup Command to an Assembly from the UI application via Gateway server.</p>
159-
<p>Visit <a href="https://tmtsoftware.github.io/csw/0.1.0-SNAPSHOT/params/commands.html">here</a> to learn more about commands.</p>
160-
<p>Visit <a href="https://tmtsoftware.github.io/csw/0.1.0-SNAPSHOT/commons/create-component.html">here</a> to learn more about components.</p>
159+
<p>Visit <a href="https://tmtsoftware.github.io/csw/6.0.0/params/commands.html">here</a> to learn more about commands.</p>
160+
<p>Visit <a href="https://tmtsoftware.github.io/csw/6.0.0/commons/create-component.html">here</a> to learn more about components.</p>
161161
<h2><a href="#start-an-assembly-using-esw-shell" name="start-an-assembly-using-esw-shell" class="anchor"><span class="anchor-link"></span></a>Start an Assembly using esw-shell</h2>
162-
<p>We will use the esw-shell utility to create and start a simple Assembly. The esw-shell is a REPL application that provides numerous tools for TMT programming. Visit <a href="https://tmtsoftware.github.io/esw/0.1.0-SNAPSHOT/eswshell/esw-shell.html">here</a> to learn more about the esw-shell utility.</p>
162+
<p>We will use the esw-shell utility to create and start a simple Assembly. The esw-shell is a REPL application that provides numerous tools for TMT programming. Visit <a href="https://tmtsoftware.github.io/esw/1.0.2/eswshell/esw-shell.html">here</a> to learn more about the esw-shell utility.</p>
163163
<pre class="prettyprint"><code class="language-bash">cs install esw-shell
164164
esw-shell start
165165
@ // you are inside ammonite repl now
166166
</code></pre>
167-
<p>We will use an esw-shell <a href="https://tmtsoftware.github.io/esw/0.1.0-SNAPSHOT/technical/apps/esw-shell.html#using-custom-component-handlers">feature</a> that allows the dynamic creation of component by specifying command handler functionality when spawning the component.</p>
167+
<p>We will use an esw-shell <a href="https://tmtsoftware.github.io/esw/1.0.2/technical/apps/esw-shell.html#using-custom-component-handlers">feature</a> that allows the dynamic creation of component by specifying command handler functionality when spawning the component.</p>
168168
<p>Our assembly will take a <code>sleep</code> command with <code>sleepInSeconds</code> (LongKey) parameter. This is a long-running command which will return a <code>Started</code> response immediately and then a <code>Completed</code> response after sleeping the time provided in the parameter. Any other command other than <code>sleep</code> immediately returns a <code>Completed</code> response.</p>
169169
<p>Run this command inside esw-shell&rsquo;s ammonite shell:</p>
170170
<pre class="prettyprint"><code class="language-bash">spawnAssemblyWithHandler(
@@ -194,7 +194,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
194194
<dl>
195195
<dt>Typescript</dt>
196196
<dd>
197-
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L2-L179" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">import {
197+
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L2-L178" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">import {
198198
CommandService,
199199
ComponentId,
200200
longKey,
@@ -237,7 +237,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
237237
_commandService
238238
}: {
239239
_commandService?: CommandService
240-
}): JSX.Element =&gt; {
240+
}): React.JSX.Element =&gt; {
241241
const { auth } = useAuth()
242242
const authData = { tokenFactory: () =&gt; auth?.token() }
243243

@@ -272,8 +272,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
272272
switch (result._type) {
273273
case &#39;Started&#39;:
274274
setResult(result)
275-
const res = await commandService.queryFinal(result.runId, 5)
276-
setResult(res)
275+
setResult(await commandService.queryFinal(result.runId, 5))
277276
break
278277
default:
279278
setResult(result)
@@ -391,7 +390,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
391390
<dl>
392391
<dt>Typescript</dt>
393392
<dd>
394-
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L63-L95" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">const submit = async () =&gt; {
393+
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L63-L94" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">const submit = async () =&gt; {
395394
try {
396395
const sleepInMs = longKey(&#39;sleepInSeconds&#39;).set([
397396
sleepTime ? sleepTime : 0
@@ -413,8 +412,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
413412
switch (result._type) {
414413
case &#39;Started&#39;:
415414
setResult(result)
416-
const res = await commandService.queryFinal(result.runId, 5)
417-
setResult(res)
415+
setResult(await commandService.queryFinal(result.runId, 5))
418416
break
419417
default:
420418
setResult(result)
@@ -429,7 +427,7 @@ <h2><a href="#add-submit-command-component" name="add-submit-command-component"
429427
<dl>
430428
<dt>Typescript</dt>
431429
<dd>
432-
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L165-L174" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">&lt;Typography.Title level={2}&gt;Result&lt;/Typography.Title&gt;
430+
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/SubmitCommand.tsx#L164-L173" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">&lt;Typography.Title level={2}&gt;Result&lt;/Typography.Title&gt;
433431
&lt;Typography.Paragraph&gt;
434432
{result &amp;&amp; (
435433
&lt;Badge.Ribbon
@@ -465,7 +463,7 @@ <h2><a href="#integrate-submitcommand-component" name="integrate-submitcommand-c
465463
<dl>
466464
<dt>Typescript</dt>
467465
<dd>
468-
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/Main.tsx#L11-L32" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">export const Main = (): JSX.Element =&gt; {
466+
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/tmtsoftware/esw-gateway-ui-example/tree/master/src/components/Main.tsx#L11-L32" target="_blank" title="Go to snippet source">source</a><code class="language-tsx">export const Main = (): React.JSX.Element =&gt; {
469467
const { auth } = useAuth()
470468
if (!auth) return &lt;div&gt;Loading&lt;/div&gt;
471469
const isAuthenticated = auth?.isAuthenticated() ?? false

0 commit comments

Comments
 (0)