Skip to content

Commit e425ffb

Browse files
#RI-2450-resolve comments
1 parent f567ab4 commit e425ffb

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

redisinsight/ui/src/constants/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ enum ApiEndpoints {
4545
WORKBENCH_COMMAND_EXECUTIONS = 'workbench/command-executions',
4646

4747
REDIS_COMMANDS = 'commands',
48-
GUIDES = 'static/workbench/guides/guides.json',
48+
GUIDES = 'static/guides/guides.json',
4949
// TODO double check it, when tutorials will be completed
50-
TUTORIALS = 'static/workbench/tutorials/tutorials.json',
50+
TUTORIALS = 'static/tutorials/tutorials.json',
5151
PLUGINS = 'plugins',
5252
STATE = 'state',
5353
CONTENT_CREATE_DATABASE = 'static/content/create-redis.json',
54-
ENABLEMENT_AREA_PATH = 'static/workbench',
54+
ENABLEMENT_AREA_PATH = 'static',
5555
}
5656

5757
export const DEFAULT_SEARCH_MATCH = '*'

redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/EnablementArea.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const EnablementArea = ({ items, openScript, loading, onOpenInternalPage, isCode
4040
const pagePath = new URLSearchParams(search).get('item')
4141
if (pagePath) {
4242
setIsInternalPageVisible(true)
43-
setInternalPage({ path: `${ApiEndpoints.ENABLEMENT_AREA_PATH}/${pagePath}` })
43+
setInternalPage({ path: `${ApiEndpoints.ENABLEMENT_AREA_PATH}${pagePath}` })
4444

4545
return
4646
}
4747
if (itemFromContext) {
48-
handleOpenInternalPage({ path: `${ApiEndpoints.ENABLEMENT_AREA_PATH}/${itemFromContext}` })
48+
handleOpenInternalPage({ path: `${ApiEndpoints.ENABLEMENT_AREA_PATH}${itemFromContext}` })
4949
return
5050
}
5151
setIsInternalPageVisible(false)

redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyCodeButton/LazyCodeButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const LazyCodeButton = ({ path = '', ...rest }: Props) => {
2323
setLoading(true)
2424
setError('')
2525
try {
26-
const { data, status } = await resourcesService.get<string>(`${ApiEndpoints.ENABLEMENT_AREA_PATH}/${path}`)
26+
const { data, status } = await resourcesService.get<string>(`${ApiEndpoints.ENABLEMENT_AREA_PATH}${path}`)
2727
if (isStatusSuccessful(status)) {
2828
setLoading(false)
2929
const pageInfo = getFileInfo(path)

redisinsight/ui/src/pages/workbench/components/enablement-area/EnablementArea/components/LazyInternalPage/LazyInternalPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface Props {
3434

3535
const LazyInternalPage = ({ onClose, title, path }: Props) => {
3636
const history = useHistory()
37-
const { ItemScrollTop } = useSelector(appContextWorkbenchEA)
37+
const { itemScrollTop } = useSelector(appContextWorkbenchEA)
3838
const guides = useSelector(workbenchGuidesSelector)
3939
const [isLoading, setLoading] = useState<boolean>(false)
4040
const [error, setError] = useState<string>('')
@@ -88,7 +88,7 @@ const LazyInternalPage = ({ onClose, title, path }: Props) => {
8888
content={pageData.content}
8989
error={error}
9090
onScroll={handlePageScroll}
91-
scrollTop={ItemScrollTop}
91+
scrollTop={itemScrollTop}
9292
pagination={pageData.relatedPages}
9393
/>
9494
)

redisinsight/ui/src/slices/app/context.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export const initialState: StateAppContext = {
2222
workbench: {
2323
script: '',
2424
enablementArea: {
25-
ItemPath: '',
26-
ItemScrollTop: 0,
25+
itemPath: '',
26+
itemScrollTop: 0,
2727
},
2828
panelSizes: {
2929
vertical: {}
@@ -72,18 +72,18 @@ const appContextSlice = createSlice({
7272
state.lastPage = payload
7373
},
7474
setWorkbenchEAItem: (state, { payload }: { payload: any }) => {
75-
const prevValue = state.workbench.enablementArea.ItemPath
76-
state.workbench.enablementArea.ItemPath = payload
75+
const prevValue = state.workbench.enablementArea.itemPath
76+
state.workbench.enablementArea.itemPath = payload
7777
if (prevValue !== payload) {
78-
state.workbench.enablementArea.ItemScrollTop = 0
78+
state.workbench.enablementArea.itemScrollTop = 0
7979
}
8080
},
8181
setWorkbenchEAItemScrollTop: (state, { payload }: { payload: any }) => {
82-
state.workbench.enablementArea.ItemScrollTop = payload || 0
82+
state.workbench.enablementArea.itemScrollTop = payload || 0
8383
},
8484
resetWorkbenchEAItem: (state) => {
85-
state.workbench.enablementArea.ItemPath = ''
86-
state.workbench.enablementArea.ItemScrollTop = 0
85+
state.workbench.enablementArea.itemPath = ''
86+
state.workbench.enablementArea.itemScrollTop = 0
8787
},
8888
resetBrowserTree: (state) => {
8989
state.browser.tree.selectedLeaf = {}

redisinsight/ui/src/slices/interfaces/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export interface StateAppContext {
5959
workbench: {
6060
script: string;
6161
enablementArea: {
62-
ItemPath: string;
63-
ItemScrollTop: number;
62+
itemPath: string;
63+
itemScrollTop: number;
6464
},
6565
panelSizes: {
6666
vertical: {

redisinsight/ui/src/slices/tests/app/context.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,20 @@ describe('slices', () => {
224224
workbench: {
225225
...initialState.workbench,
226226
enablementArea: {
227-
ItemPath: 'static/enablement-area/guides/guide1.html',
228-
ItemScrollTop: 200,
227+
itemPath: 'static/enablement-area/guides/guide1.html',
228+
itemScrollTop: 200,
229229
}
230230
},
231231
}
232-
const ItemPath = 'static/enablement-area/guides/guide2.html'
232+
const itemPath = 'static/enablement-area/guides/guide2.html'
233233
const state = {
234234
...initialState.workbench.enablementArea,
235-
ItemPath,
236-
ItemScrollTop: 0,
235+
itemPath,
236+
itemScrollTop: 0,
237237
}
238238

239239
// Act
240-
const nextState = reducer(prevState, setWorkbenchEAItem(ItemPath))
240+
const nextState = reducer(prevState, setWorkbenchEAItem(itemPath))
241241

242242
// Assert
243243
const rootState = Object.assign(initialStateDefault, {
@@ -253,7 +253,7 @@ describe('slices', () => {
253253
// Arrange
254254
const state = {
255255
...initialState.workbench.enablementArea,
256-
ItemScrollTop: 200,
256+
itemScrollTop: 200,
257257
}
258258

259259
// Act
@@ -276,15 +276,15 @@ describe('slices', () => {
276276
workbench: {
277277
...initialState.workbench,
278278
enablementArea: {
279-
ItemPath: 'static/enablement-area/guides/guide1.html',
280-
ItemScrollTop: 200,
279+
itemPath: 'static/enablement-area/guides/guide1.html',
280+
itemScrollTop: 200,
281281
}
282282
},
283283
}
284284
const state = {
285285
...initialState.workbench.enablementArea,
286-
ItemPath: '',
287-
ItemScrollTop: 0,
286+
itemPath: '',
287+
itemScrollTop: 0,
288288
}
289289

290290
// Act

0 commit comments

Comments
 (0)