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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/disable API keys UI given API keys config setting #4559

Merged
merged 12 commits into from
Sep 7, 2020
Merged
Prev Previous commit
Fix unit tests
  • Loading branch information
richard-cox committed Sep 7, 2020
commit d49458388152db67dbc60dcd02ff2c3fca2bdae4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createEmptyStoreModule } from '@stratosui/store/testing';
import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service';
import { ApplicationServiceMock } from '../../../../cloud-foundry/test-framework/application-service-helper';
import { CoreModule } from '../../../../core/src/core/core.module';
import { CurrentUserPermissionsService } from '../../../../core/src/core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../../core/src/shared/shared.module';
import { TabNavService } from '../../../../core/src/tab-nav.service';
import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module';
Expand All @@ -30,7 +31,8 @@ describe('AutoscalerMetricPageComponent', () => {
providers: [
DatePipe,
{ provide: ApplicationService, useClass: ApplicationServiceMock },
TabNavService
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createEmptyStoreModule } from '@stratosui/store/testing';
import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service';
import { ApplicationServiceMock } from '../../../../cloud-foundry/test-framework/application-service-helper';
import { CoreModule } from '../../../../core/src/core/core.module';
import { CurrentUserPermissionsService } from '../../../../core/src/core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../../core/src/shared/shared.module';
import { TabNavService } from '../../../../core/src/tab-nav.service';
import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module';
Expand All @@ -30,7 +31,8 @@ describe('AutoscalerScaleHistoryPageComponent', () => {
providers: [
DatePipe,
{ provide: ApplicationService, useClass: ApplicationServiceMock },
TabNavService
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service';
import { ApplicationServiceMock } from '../../../../cloud-foundry/test-framework/application-service-helper';
import { CoreModule } from '../../../../core/src/core/core.module';
import { CurrentUserPermissionsService } from '../../../../core/src/core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../../core/src/shared/shared.module';
import { TabNavService } from '../../../../core/src/tab-nav.service';
import { createBasicStoreModule } from '../../../../store/testing/public-api';
Expand Down Expand Up @@ -33,6 +34,7 @@ describe('EditAutoscalerCredentialComponent', () => {
DatePipe,
{ provide: ApplicationService, useClass: ApplicationServiceMock },
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createEmptyStoreModule } from '@stratosui/store/testing';
import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service';
import { ApplicationServiceMock } from '../../../../cloud-foundry/test-framework/application-service-helper';
import { CoreModule } from '../../../../core/src/core/core.module';
import { CurrentUserPermissionsService } from '../../../../core/src/core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../../core/src/shared/shared.module';
import { TabNavService } from '../../../../core/src/tab-nav.service';
import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module';
Expand Down Expand Up @@ -43,6 +44,7 @@ describe('EditAutoscalerPolicyComponent', () => {
{ provide: ApplicationService, useClass: ApplicationServiceMock },
TabNavService,
EditAutoscalerPolicyService,
CurrentUserPermissionsService
]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { AboutPageComponent } from './about-page.component';
Expand All @@ -22,7 +23,10 @@ describe('AboutPageComponent', () => {
CoreTestingModule,
createBasicStoreModule(),
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { DiagnosticsPageComponent } from './diagnostics-page.component';
Expand All @@ -22,7 +23,10 @@ describe('DiagnosticsPageComponent', () => {
CoreTestingModule,
createBasicStoreModule(),
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { EulaPageComponent } from './eula-page.component';
Expand All @@ -24,7 +25,10 @@ describe('EulaPageComponent', () => {
HttpClientTestingModule,
createBasicStoreModule(),
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../../shared/shared.module';
import { TabNavService } from '../../../../tab-nav.service';
import { CreateEndpointBaseStepComponent } from './create-endpoint-base-step.component';
Expand All @@ -27,15 +28,19 @@ describe('CreateEndpointBaseStepComponent', () => {
createBasicStoreModule(),
NoopAnimationsModule
],
providers: [{
provide: ActivatedRoute,
useValue: {
snapshot: {
queryParams: {},
params: { type: 'metrics' }
providers: [
{
provide: ActivatedRoute,
useValue: {
snapshot: {
queryParams: {},
params: { type: 'metrics' }
}
}
}
}, TabNavService],
},
TabNavService,
CurrentUserPermissionsService
],
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SidePanelService } from '../../../shared/services/side-panel.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
Expand Down Expand Up @@ -49,7 +50,9 @@ describe('CreateEndpointComponent', () => {
}
},
TabNavService,
SidePanelService],
SidePanelService,
CurrentUserPermissionsService
],
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { createBasicStoreModule } from '../../../../../store/testing/public-api';
import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { EditEndpointStepComponent } from './edit-endpoint-step/edit-endpoint-step.component';
Expand Down Expand Up @@ -36,7 +37,8 @@ describe('EditEndpointComponent', () => {
}
}
},
TabNavService
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { EventsPageComponent } from './events-page.component';
Expand All @@ -22,7 +23,10 @@ describe('EventsPageComponent', () => {
createBasicStoreModule(),
RouterTestingModule
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { HomePageComponent } from './home-page.component';
Expand All @@ -26,7 +27,10 @@ describe('HomePageComponent', () => {
CoreTestingModule,
createBasicStoreModule()
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
import { MetricsService } from '../services/metrics-service';
Expand All @@ -27,7 +28,11 @@ describe('MetricsComponent', () => {
createBasicStoreModule(),
],
declarations: [MetricsComponent],
providers: [MetricsService, TabNavService]
providers: [
MetricsService,
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../test-framework/core-test.modules';
import { CoreModule } from '../../core/core.module';
import { CurrentUserPermissionsService } from '../../core/permissions/current-user-permissions.service';
import { SharedModule } from '../../shared/shared.module';
import { TabNavService } from '../../tab-nav.service';
import { NoEndpointsNonAdminComponent } from './no-endpoints-non-admin.component';
Expand All @@ -22,7 +23,10 @@ describe('NoEndpointsNonAdminComponent', () => {
CoreTestingModule,
createBasicStoreModule(),
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createEmptyStoreModule } from '@stratosui/store/testing';

import { CoreModule } from '../../../core/core.module';
import { MDAppModule } from '../../../core/md.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { PageHeaderModule } from '../../../shared/components/page-header/page-header.module';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
Expand All @@ -30,7 +31,10 @@ describe('LocalAccountWizardComponent', () => {
createEmptyStoreModule(),
NoopAnimationsModule,
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { StoreModule } from '@ngrx/store';
import { appReducers } from '../../../../../store/src/reducers.module';
import { CoreModule } from '../../../core/core.module';
import { MDAppModule } from '../../../core/md.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { PageHeaderModule } from '../../../shared/components/page-header/page-header.module';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
Expand All @@ -31,7 +32,10 @@ describe('ConsoleUaaWizardComponent', () => {
StoreModule.forRoot(appReducers),
NoopAnimationsModule,
],
providers: [TabNavService]
providers: [
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreTestingModule } from '../../../../test-framework/core-test.modules';
import { CoreModule } from '../../../core/core.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { UserProfileService } from '../../../core/user-profile.service';
import { SharedModule } from '../../../shared/shared.module';
import { TabNavService } from '../../../tab-nav.service';
Expand All @@ -27,7 +28,11 @@ describe('ProfileInfoComponent', () => {
CoreTestingModule,
createBasicStoreModule()
],
providers: [UserProfileService, TabNavService]
providers: [
UserProfileService,
TabNavService,
CurrentUserPermissionsService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { InternalEventMonitorFactory } from '../../../../../store/src/monitors/i
import { appReducers } from '../../../../../store/src/reducers.module';
import { CoreModule } from '../../../core/core.module';
import { MDAppModule } from '../../../core/md.module';
import { CurrentUserPermissionsService } from '../../../core/permissions/current-user-permissions.service';
import { TabNavService } from '../../../tab-nav.service';
import { SharedModule } from '../../shared.module';
import { PageHeaderComponent } from './page-header.component';
Expand All @@ -28,7 +29,8 @@ describe('PageHeaderComponent', () => {
}
}
},
TabNavService
TabNavService,
CurrentUserPermissionsService
],
imports: [
MDAppModule,
Expand Down