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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): rename envId to envHrid to avoid any confusion #6993

Merged
merged 1 commit into from Mar 21, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion gravitee-apim-console-webui/src/app-routing.module.ts
Expand Up @@ -56,7 +56,7 @@ const appRoutes: Routes = [
import('./organization/configuration/organization-settings-routing.module').then((m) => m.OrganizationSettingsRoutingModule),
},
{
path: ':envId',
path: ':envHrid',
component: AppComponent,
loadChildren: () => import('./management/management.module').then((m) => m.ManagementModule),
},
Expand Down
Expand Up @@ -370,7 +370,7 @@ export class ApiNavigationComponent implements OnInit, OnDestroy {
}

private getApiNavigationSearchItems() {
const environmentId = this.activatedRoute.snapshot.params.envId;
const environmentId = this.activatedRoute.snapshot.params.envHrid;
const apiId = this.currentApi.id;
const parentRouterLink = getPathFromRoot(this.activatedRoute);

Expand Down
Expand Up @@ -177,7 +177,7 @@ export class ApplicationNavigationComponent implements OnInit, OnDestroy {
}

private getApplicationNavigationSearchItems(): MenuSearchItem[] {
const environmentId = this.activatedRoute.snapshot.params.envId;
const environmentId = this.activatedRoute.snapshot.params.envHrid;
const applicationId = this.activatedRoute.snapshot.params.applicationId;
const parentRouterLink = getPathFromRoot(this.activatedRoute);

Expand Down
Expand Up @@ -39,7 +39,7 @@ export const EnvironmentGuard: {
const gioMenuSearchService = inject(GioMenuSearchService);
const settingsNavigationService = inject(SettingsNavigationService);

const paramEnv = route.params.envId;
const paramEnv = route.params.envHrid;

return environmentService.list().pipe(
map((environments) => {
Expand All @@ -62,7 +62,7 @@ export const EnvironmentGuard: {
switchMap(() => environmentSettingsService.load()),
// Load search items in menu
map(() => {
gioMenuSearchService.addMenuSearchItems(settingsNavigationService.getSettingsNavigationSearchItems(route.params.envId));
gioMenuSearchService.addMenuSearchItems(settingsNavigationService.getSettingsNavigationSearchItems(route.params.envHrid));
return true;
}),
);
Expand All @@ -73,7 +73,7 @@ export const EnvironmentGuard: {
const gioMenuSearchService = inject(GioMenuSearchService);

gioPermissionService.clearEnvironmentPermissions();
gioMenuSearchService.removeMenuSearchItems([currentRoute.params.envId]);
gioMenuSearchService.removeMenuSearchItems([currentRoute.params.envHrid]);
return true;
},
};
Expand Up @@ -58,7 +58,7 @@ const IdentityProvidersComponentAjs: ng.IComponentOptions = {
this.providedConfigurationMessage = 'Configuration provided by the system';

this.$onInit = () => {
this.envId = this.activatedRoute.snapshot.params.envId;
this.envId = Constants.org.currentEnv.id;
this.canUpdatePortalSettings = UserService.isUserHasPermissions([
'environment-settings-c',
'environment-settings-u',
Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { filter, map, switchMap, takeUntil, tap } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { MatDialog } from '@angular/material/dialog';
Expand All @@ -32,6 +32,7 @@ import { PromotionApprovalTaskData, Task } from '../../entities/task/task';
import { PromotionService } from '../../services-ngx/promotion.service';
import { SnackBarService } from '../../services-ngx/snack-bar.service';
import { Workflow } from '../../entities/workflow/workflow';
import { Constants } from '../../entities/Constants';

class TaskData {
icon: string;
Expand Down Expand Up @@ -61,6 +62,7 @@ export class TasksComponent implements OnInit, OnDestroy {
private readonly promotionService: PromotionService,
private readonly matDialog: MatDialog,
private readonly snackBarService: SnackBarService,
@Inject(Constants) private readonly constants: Constants,
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -97,7 +99,7 @@ export class TasksComponent implements OnInit, OnDestroy {
}

go(task: TaskData): void {
const currentEnvironmentId = this.activatedRoute.snapshot.params.environmentId;
const currentEnvironmentId = this.constants.org.currentEnv.id;

switch (task.type) {
case 'SUBSCRIPTION_APPROVAL': {
Expand Down