Skip to content

Commit 78bfddc

Browse files
author
Plamen Yordanov
committed
GDB-13261 add guide step for viewing created similarity index
## What Add a new guide step to view created similarity index ## Why To enhance user experience by providing clear instructions on how to locate and view the newly created similarity index. ## How Created `similarity-view-created-index`, which highlights the first or `options.rowIndex`th element in the similarity table - Added guide-selector for the rows - Added `skipPoint: false` to the submenu step of `click-main-menu`. This allows the usage of the step ## Testing n/a
1 parent a045bb5 commit 78bfddc

File tree

7 files changed

+472
-3
lines changed

7 files changed

+472
-3
lines changed

docs/guides_main-menu_click-main-menu.js.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,10 @@ <h1>guides/main-menu/click-main-menu.js</h1>
291291

292292
return Promise.resolve();
293293
},
294-
...options
294+
...options,
295+
// We might want to click menu + submenu, without intro message. If we configure a skipPoint
296+
// then it will be added to both steps
297+
skipPoint: false,
295298
}
296299
});
297300
}
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
2+
3+
<!DOCTYPE html>
4+
<html lang="en">
5+
6+
<head>
7+
8+
<meta charset="utf-8">
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<title> guides/similarity-index/similarity-view-created-index.js</title>
11+
12+
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
13+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
14+
<script src="./build/entry.js"></script>
15+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
16+
<!--[if lt IE 9]>
17+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
18+
<![endif]-->
19+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
20+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
21+
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
22+
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
23+
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
24+
<link type="text/css" rel="stylesheet" href="">
25+
<script async defer src="https://buttons.github.io/buttons.js"></script>
26+
27+
28+
</head>
29+
30+
31+
32+
<body class="layout small-header">
33+
<div id="stickyNavbarOverlay"></div>
34+
35+
36+
<div class="top-nav">
37+
<div class="inner">
38+
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
39+
<span aria-hidden="true"></span>
40+
<span aria-hidden="true"></span>
41+
<span aria-hidden="true"></span>
42+
</a>
43+
<div class="logo">
44+
45+
46+
<a href="index.html">
47+
<h1 class="navbar-item">GraphDB Workbench Plugins</h1>
48+
</a>
49+
50+
</div>
51+
<div class="menu">
52+
53+
<div class="navigation">
54+
<a
55+
href="index.html"
56+
class="link"
57+
>
58+
Documentation
59+
</a>
60+
61+
62+
63+
</div>
64+
</div>
65+
</div>
66+
</div>
67+
<div id="main">
68+
<div
69+
class="sidebar "
70+
id="sidebarNav"
71+
>
72+
73+
<nav>
74+
75+
<h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Modules</h3><ul><li><a href="module-Interactive%2520Guide.html">Interactive Guide</a></li></ul><h3>Classes</h3><ul><li><a href="PluginServiceInterface.html">PluginServiceInterface</a></li></ul><h3>Global</h3><ul><li><a href="global.html#COMMON_DOM_EVENTS">COMMON_DOM_EVENTS</a></li><li><a href="global.html#_configureInteractions">_configureInteractions</a></li><li><a href="global.html#allowAll">allowAll</a></li><li><a href="global.html#allowEvents">allowEvents</a></li><li><a href="global.html#beforeShowPromise">beforeShowPromise</a></li><li><a href="global.html#preventDefault">preventDefault</a></li></ul></div>
76+
77+
</nav>
78+
</div>
79+
<div class="core" id="main-content-wrapper">
80+
<div class="content">
81+
<header class="page-title">
82+
<p>Source</p>
83+
<h1>guides/similarity-index/similarity-view-created-index.js</h1>
84+
</header>
85+
86+
87+
88+
89+
90+
<section>
91+
<article>
92+
<pre class="prettyprint source linenums"><code>const CREATE_SIMILARITY_INDEX_DEFAULT = 'guide.step-action.create-similarity-index';
93+
const VIEW_CREATED_INDEX_DEFAULT = 'guide.step_plugin.similarity-view-created-index';
94+
95+
/**
96+
* @name similarity-view-created-index
97+
* @memberof module:Interactive Guide
98+
*
99+
* @description
100+
* This step highlights the newly created similarity index in the Existing Indexes table. The default index to highlight
101+
* is the first index, unless &lt;code>options.rowIndex&lt;/code> is specified.
102+
*
103+
* View the newly created similarity index&lt;br>
104+
* &lt;img src="resources/guides/similarity-index/similarity-view-created-index.png" style="height:200px; border: solid; border-width:1px"/>&lt;br>
105+
*
106+
* This step can be configured using the common options defined in [Options](#.Options). Additionally, it supports:
107+
*
108+
* @property {string} [options.content] - The content of the dialog.
109+
* @property {string} [options.title] - The title of the dialog.
110+
* @property {number} [options.rowIndex] - The index of the row to focus on.
111+
*
112+
* @example
113+
* ```JSON
114+
* {
115+
* "guideBlockName": "similarity-view-created-index",
116+
* "options": {
117+
* "title": {
118+
* "en": "Explore Similarity index"
119+
* },
120+
* "content": "In the &lt;b>Existing Indexes&lt;/b> table, you can now see the &lt;b>SpellSimIndex&lt;/b> which is the similarity index we created with the previous query.",
121+
* "rowIndex": 1
122+
* }
123+
* }
124+
*
125+
*/
126+
const step = {
127+
guideBlockName: 'similarity-view-created-index',
128+
getSteps: (options, services) => {
129+
const GuideUtils = services.GuideUtils;
130+
return [
131+
{
132+
guideBlockName: 'focus-element',
133+
options: {
134+
content: options.content || 'guide.step_plugin.similarity-view-created-index',
135+
class: 'view-created-index',
136+
...(options.title ?? {title: CREATE_SIMILARITY_INDEX_DEFAULT}),
137+
...options,
138+
elementSelector: GuideUtils.getGuideElementSelector(`similarity-index-name-${options.rowIndex || 0}`)
139+
}
140+
}
141+
];
142+
},
143+
translationBundle: {
144+
en: {
145+
[CREATE_SIMILARITY_INDEX_DEFAULT]: 'Create Similarity index',
146+
[VIEW_CREATED_INDEX_DEFAULT]: 'In the &lt;b>Existing Indexes&lt;/b> table, you can now see the &lt;b>SpellSimIndex&lt;/b> which is the similarity index we created with the previous query.',
147+
},
148+
fr: {
149+
[CREATE_SIMILARITY_INDEX_DEFAULT]: 'Créer un indice de similitude',
150+
[VIEW_CREATED_INDEX_DEFAULT]: 'Dans le tableau &lt;b>Index existants&lt;/b>, vous pouvez maintenant voir le &lt;b>SpellSimIndex&lt;/b> qui est l\'index de similarité que nous avons créé avec la requête précédente.'
151+
}
152+
}
153+
};
154+
155+
export function register(registry) {
156+
registry.add('guide.step', step);
157+
}
158+
</code></pre>
159+
</article>
160+
</section>
161+
162+
163+
164+
165+
</div>
166+
167+
168+
169+
</div>
170+
<div id="side-nav" class="side-nav">
171+
</div>
172+
</div>
173+
<script src="scripts/app.min.js"></script>
174+
<script>PR.prettyPrint();</script>
175+
<script src="scripts/linenumber.js"> </script>
176+
177+
178+
</body>
179+
</html>

docs/guides_ttyg_ttyg-similarity-select-index.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ <h1>guides/ttyg/ttyg-similarity-select-index.js</h1>
120120

121121
return [
122122
{
123-
guideBlockName: 'clickable-element',
123+
guideBlockName: 'focus-element',
124124
options: {
125125
content: translate(this.translationBundle, SELECT_INDEX),
126126
class: 'select-similarity-index',

0 commit comments

Comments
 (0)