Skip to content

Commit 3ad6fa5

Browse files
authored
revert changes from #1417 (#1424)
Signed-off-by: Valerii Svydenko <[email protected]>
1 parent 49fd79e commit 3ad6fa5

File tree

21 files changed

+161
-1922
lines changed

21 files changed

+161
-1922
lines changed

packages/dashboard-backend/src/devworkspaceClient/services/__tests__/serverConfigApi.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ describe('Server Config API Service', () => {
211211

212212
describe('Hide editors by name array', () => {
213213
test('getting showDeprecated value', () => {
214-
const res = serverConfigService.getHideEditorsById(buildCustomResource());
214+
const res = serverConfigService.gеtHideEditorsById(buildCustomResource());
215215
expect(res).toEqual([]);
216216
});
217217
test('getting hideByName value', () => {
218218
process.env['CHE_HIDE_EDITORS_BY_ID'] =
219219
'che-incubator/che-idea-server/latest, che-incubator/che-idea-server/next';
220-
const res = serverConfigService.getHideEditorsById(buildCustomResource());
220+
const res = serverConfigService.gеtHideEditorsById(buildCustomResource());
221221
expect(res).toEqual([
222222
'che-incubator/che-idea-server/latest',
223223
'che-incubator/che-idea-server/next',

packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class ServerConfigApiService implements IServerConfigApi {
290290
return value === 'true';
291291
}
292292

293-
getHideEditorsById(cheCustomResource: CheClusterCustomResource): string[] {
293+
gеtHideEditorsById(cheCustomResource: CheClusterCustomResource): string[] {
294294
const value = getEnvVarValue('CHE_HIDE_EDITORS_BY_ID', cheCustomResource);
295295
if (!value) {
296296
return [];

packages/dashboard-backend/src/devworkspaceClient/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export interface IServerConfigApi {
410410
/**
411411
* Returns the hideEditorsById value
412412
*/
413-
getHideEditorsById(cheCustomResource: CheClusterCustomResource): string[];
413+
gеtHideEditorsById(cheCustomResource: CheClusterCustomResource): string[];
414414

415415
/**
416416
* Returns the Machine (hardware) type.

packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const getDevWorkspaceClient = jest.fn(
201201
getAdvancedAuthorization: _cheCustomResource => stubAdvancedAuthorization,
202202
getAllowedSourceUrls: _cheCustomResource => stubAllowedSourceUrls,
203203
getShowDeprecatedEditors: _cheCustomResource => stubShowDeprecatedEditors,
204-
getHideEditorsById: _cheCustomResource => stubHideEditorsById,
204+
gеtHideEditorsById: _cheCustomResource => stubHideEditorsById,
205205
} as IServerConfigApi,
206206
devworkspaceApi: {
207207
create: (_devworkspace, _namespace) =>

packages/dashboard-backend/src/routes/api/serverConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function registerServerConfigRoute(instance: FastifyInstance) {
5151
const allowedSourceUrls = serverConfigApi.getAllowedSourceUrls(cheCustomResource);
5252
const axiosRequestTimeout = serverConfigApi.getAxiosRequestTimeout();
5353
const showDeprecated = serverConfigApi.getShowDeprecatedEditors(cheCustomResource);
54-
const hideById = serverConfigApi.getHideEditorsById(cheCustomResource);
54+
const hideById = serverConfigApi.gеtHideEditorsById(cheCustomResource);
5555

5656
const serverConfig: api.IServerConfig = {
5757
containerBuild,

packages/dashboard-frontend/src/components/ImportFromGit/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes';
2222
import { buildFactoryLoaderPath } from '@/preload/main';
2323
import { FactoryLocationAdapter } from '@/services/factory-location-adapter';
24-
import { REVISION_ATTR } from '@/services/helpers/factoryFlow/buildFactoryParams';
24+
import { REVISION } from '@/services/helpers/factoryFlow/buildFactoryParams';
2525

2626
const BR_NAME_REGEX = /^[0-9A-Za-z-./_]{1,256}$/;
2727

@@ -144,7 +144,7 @@ function setBranchToAzureDevOpsLocation(location: string, branch: string | undef
144144

145145
export function setBranchToLocation(location: string, branch: string | undefined): string {
146146
if (!FactoryLocationAdapter.isHttpLocation(location)) {
147-
return branch ? `${location}?${REVISION_ATTR}=${branch}` : location;
147+
return branch ? `${location}?revision=${branch}` : location;
148148
}
149149
const url = new URL(location);
150150
const pathname = url.pathname.replace(/^\//, '').replace(/\/$/, '');
@@ -281,7 +281,7 @@ export function getGitRepoOptionsFromLocation(location: string): {
281281
console.log(`Unable to get branch from '${location}'.${common.helpers.errors.getMessage(e)}`);
282282
}
283283
} else if (!FactoryLocationAdapter.isHttpLocation(location)) {
284-
gitBranch = searchParams.get(REVISION_ATTR) || undefined;
284+
gitBranch = searchParams.get(REVISION) || undefined;
285285
}
286286
return { location, gitBranch, remotes, devfilePath, hasSupportedGitService };
287287
}
@@ -404,7 +404,7 @@ export function setGitRepoOptionsToLocation(
404404
state.gitBranch = newOptions.gitBranch;
405405
}
406406
if (!FactoryLocationAdapter.isHttpLocation(location) && newOptions.gitBranch) {
407-
searchParams.set(REVISION_ATTR, newOptions.gitBranch);
407+
searchParams.set(REVISION, newOptions.gitBranch);
408408
}
409409
// update the location with the new gitBranch value
410410
let searchParamsStr = decodeURIComponent(searchParamsToString(searchParams));

packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getProjectFromLocation.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ describe('FactoryLoaderContainer/getProjectFromLocation', () => {
9393
origin: 'https://github.com/test/rest-repo.git',
9494
},
9595
},
96-
// Project name now correctly extracts repo name instead of commit hash
97-
name: 'rest-repo',
96+
name: 'a4f1949c33ddab5f66c19c27a844af1c46aa0820',
9897
});
9998
});
10099
});

0 commit comments

Comments
 (0)