Skip to content

Commit

Permalink
Merge tag '3.18.7' into fix/merge-3187-319-run-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc committed Aug 31, 2022
2 parents 6d6afaf + 43da210 commit cb4a403
Show file tree
Hide file tree
Showing 144 changed files with 1,865 additions and 1,165 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ commands:
steps:
- restore_cache:
keys:
- gravitee-api-management-v7-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v7-<< parameters.jobName >>-{{ .Branch }}-
- gravitee-api-management-v7-<< parameters.jobName >>-
- gravitee-api-management-v8-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v8-<< parameters.jobName >>-{{ .Branch }}-
- gravitee-api-management-v8-<< parameters.jobName >>-
save-maven-job-cache:
description: Restore Maven cache for a dedicated job
parameters:
Expand All @@ -120,10 +120,14 @@ commands:
type: string
default: ""
steps:
- run:
name: "Exclude all APIM artefacts from cache."
command: |
rm -rf ~/.m2/repository/io/gravitee/apim
- save_cache:
paths:
- ~/.m2
key: gravitee-api-management-v7-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
key: gravitee-api-management-v8-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
when: always

notify-on-failure:
Expand Down Expand Up @@ -369,9 +373,9 @@ jobs:
at: .
- restore_cache:
keys:
- gravitee-api-management-v7-sonarcloud-analysis-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v7-sonarcloud-analysis-{{ .Branch }}-
- gravitee-api-management-v7-sonarcloud-analysis-
- gravitee-api-management-v8-sonarcloud-analysis-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v8-sonarcloud-analysis-{{ .Branch }}-
- gravitee-api-management-v8-sonarcloud-analysis-
- keeper/env-export:
secret-url: keeper://9x9YgyU6DWzux4DPoHAzDQ/field/password
var-name: SONAR_TOKEN
Expand All @@ -384,7 +388,7 @@ jobs:
- save_cache:
paths:
- /opt/sonar-scanner/.sonar/cache
key: gravitee-api-management-v7-sonarcloud-analysis-{{ .Branch }}-{{ checksum "pom.xml" }}
key: gravitee-api-management-v8-sonarcloud-analysis-{{ .Branch }}-{{ checksum "pom.xml" }}
when: always

validate:
Expand Down Expand Up @@ -465,12 +469,8 @@ jobs:
- save_cache:
paths:
- ~/.m2/repository/io/gravitee/apim
key: gravitee-api-management-v7-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
key: gravitee-api-management-v8-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
when: on_success
- run:
name: "Exclude APIM artefacts from build cache"
command: |
rm -rf ~/.m2/repository/io/gravitee/apim
- save-maven-job-cache:
jobName: build
- persist_to_workspace:
Expand Down Expand Up @@ -529,7 +529,7 @@ jobs:
jobName: test
- restore_cache:
keys:
- gravitee-api-management-v7-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- gravitee-api-management-v8-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run tests
command: |
Expand Down Expand Up @@ -599,7 +599,7 @@ jobs:
jobName: test-repository
- restore_cache:
keys:
- gravitee-api-management-v7-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- gravitee-api-management-v8-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run tests
command: |
Expand Down
2 changes: 1 addition & 1 deletion gravitee-apim-console-webui/build.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "3.18.5"
"version": "3.18.7"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class ContextualDocController implements IOnInit, IOnDestroy {

constructor(private $transitions, private $http, public $state, private $window, private $rootScope) {
'ngInject';
if (window.pendo && window.pendo.isReady()) {
// Do nothing, Pendo provide documentation
this.isOpen = false;
return;
}

// init contextual page visibility
if ($window.localStorage.getItem(this.contextualDocVisibilityKey) !== null) {
Expand All @@ -44,6 +49,12 @@ class ContextualDocController implements IOnInit, IOnDestroy {
}

$onInit(): void {
if (window.pendo && window.pendo.isReady()) {
// Do nothing, Pendo provide documentation
this.isOpen = false;
return;
}

// watch for open documentation events
this.openContextualDocumentationListener = this.$rootScope.$on('openContextualDocumentation', () => {
this.openDocumentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import OrganizationService from '../../services/organization.service';
import TaskService from '../../services/task.service';
import UserService from '../../services/user.service';
import UserNotificationService from '../../services/userNotification.service';
import { Constants } from '../../entities/Constants';

export const NavbarComponent: ng.IComponentOptions = {
template: require('./navbar.html'),
Expand All @@ -31,7 +32,7 @@ export const NavbarComponent: ng.IComponentOptions = {
UserNotificationService: UserNotificationService,
OrganizationService: OrganizationService,
$scope: IScope,
Constants,
Constants: Constants,
$rootScope: IScope,
$state: StateService,
$transitions,
Expand Down Expand Up @@ -176,5 +177,9 @@ export const NavbarComponent: ng.IComponentOptions = {
}
});
};

this.goToMyAccount = () => {
this.$state.go('user', { ...this.$state.params, environmentId: this.$state.params.environmentId ?? Constants.org.currentEnv.id });
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h5>{{$ctrl.userShortName()}}</h5>
</div>
<md-divider></md-divider>
<div layout="column" layout-align="end start" class="gv-menu-content-links">
<a ui-sref="user">My account</a>
<a ng-click="$ctrl.goToMyAccount()">My account</a>
<a ui-sref="management.tasks"
>Tasks<span ng-if="$ctrl.getUserTaskCount() > 0" flex class="badge gv-menu-badge">{{$ctrl.getUserTaskCount()}}</span></a
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
<md-list class="sidenav-list">
<md-list-item ng-repeat="menuItem in $ctrl.menuItems|orderBy:'data.menu.order' track by menuItem.name">
<a
ui-sref="{{ :: menuItem.name}}"
ui-sref-opts="{inherit: false}"
title="{{ :: menuItem.data.menu.label}}"
ui-sref="{{ menuItem.name }}({inherit: false})"
title="{{ menuItem.data.menu.label }}"
ng-class="{'sidenav-active': $ctrl.isActive(menuItem)}"
>
<ng-md-icon icon="{{ :: menuItem.data.menu.icon }}"></ng-md-icon>
<span>{{ :: menuItem.data.menu.label }}</span>
<ng-md-icon icon="{{ menuItem.data.menu.icon }}"></ng-md-icon>
<span>{{ menuItem.data.menu.label }}</span>
</a>
</md-list-item>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ <h4>{{$ctrl.sidenavService.getCurrentResource()}}</h4>

<md-list-item ng-repeat="menuItem in $ctrl.submenuItems track by menuItem.name">
<md-tooltip md-delay="400">{{menuItem.data.menu.label}}</md-tooltip>
<a ui-sref="{{ :: menuItem.name }}" title="{{ :: menuItem.data.menu.label }}" ng-class="{'sidenav-active': $ctrl.isActive(menuItem)}">
<ng-md-icon icon="{{ :: menuItem.data.menu.icon }}"></ng-md-icon>
<span>{{ :: menuItem.data.menu.label}}</span>
<a ui-sref="{{ menuItem.name }}" title="{{ menuItem.data.menu.label }}" ng-class="{'sidenav-active': $ctrl.isActive(menuItem)}">
<ng-md-icon icon="{{ menuItem.data.menu.icon }}"></ng-md-icon>
<span>{{ menuItem.data.menu.label}}</span>
</a>
</md-list-item>
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ const WidgetChartLineComponent: ng.IComponentOptions = {
visible: true,
});
} else {
let field = this.parent.widget.chart.request.field;
if (this.parent.widget.chart.request.aggs && this.parent.widget.chart.request.aggs.includes('field:')) {
field = this.parent.widget.chart.request.aggs.replace('field:', '');
}
const queryFilters = this.AnalyticsService.getQueryFilters();
value.buckets.forEach((bucket) => {
if (bucket) {
let isFieldRequest = this.parent.widget.chart.request.aggs.split('%3B')[idx].includes('field:');
const query = this.parent.widget.chart.request.query;
if (
bucket.name === '1' ||
bucket.name.match('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')
Expand All @@ -98,7 +102,7 @@ const WidgetChartLineComponent: ng.IComponentOptions = {
data: bucket.data,
labelPrefix: isFieldRequest ? label : '',
id: bucket.name,
visible: this.parent.widget.chart.selectable && query ? query.includes(bucket.name) : true,
visible: queryFilters && queryFilters[field] ? queryFilters[field].includes(bucket.name) : true,
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const WidgetChartPieComponent: ng.IComponentOptions = {
name: this.parent.widget.title,
data: Object.keys(changes.data.currentValue.values || {}).map((label, idx) => {
return {
name: this.parent.widget.chart.label ? this.parent.widget.chart.label[idx] : label,
name: this.parent.widget.chart.labels ? this.parent.widget.chart.labels[idx] : label,
color: this.parent.widget.chart.colors[idx],
};
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ const WidgetDataTableComponent: ng.IComponentOptions = {

this.isClickable = function (result) {
return (
($state.current.name === 'management.platform' || $state.current.name === 'management.home') &&
($state.current.name === 'management.dashboard.analytics' || $state.current.name === 'management.dashboard.home') &&
!result.metadata.unknown &&
(this.widget.chart.request.field === 'api' || this.widget.chart.request.field === 'application')
);
};

this.goto = function (key) {
// only on platform analytics
if ($state.current.name === 'management.platform' || $state.current.name === 'management.home') {
if ($state.current.name === 'management.dashboard.analytics' || $state.current.name === 'management.dashboard.home') {
if (this.widget.chart.request.field === 'api') {
this.$state.go('management.apis.detail.analytics.overview', {
apiId: key,
Expand Down
1 change: 1 addition & 0 deletions gravitee-apim-console-webui/src/entities/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ interface EnvSettings {
};
};
portal: {
url: string;
entrypoint: string;
apikeyHeader: string;
support: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ function DialogSubscriptionCreateController(
};

this.searchApplication = function (searchedAppName) {
return ApplicationService.search(searchedAppName).then((response) => {
return response.data;
return ApplicationService.searchPage(searchedAppName).then((response) => {
return response.data.data;
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h5>Choose an application</h5>
md-min-length="1"
placeholder="Search application ..."
md-autofocus="true"
md-delay="300"
md-menu-class="autocomplete-create-subscription"
required
style="width: 400px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,7 @@ <h2>Provider</h2>
<br />

<div ng-if="$ctrl.dictionary.provider">
<h6>
Configuration

<md-button
ng-if="$ctrl.dictionary.provider.type == 'HTTP'"
class="md-icon-button"
aria-label="Expected HTTP provider output"
ng-click="$ctrl.showExpectedProviderOutput()"
>
<ng-md-icon class="no-top" icon="info" style="fill: #b1bdc5"></ng-md-icon>
</md-button>
</h6>
<h6>Configuration</h6>

<div ng-if="$ctrl.dictionary.provider.type == 'HTTP'" layout="column" layout-sm="column">
<md-input-container class="md-block" flex-gt-sm>
Expand Down
23 changes: 16 additions & 7 deletions gravitee-apim-console-webui/src/management/management.run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
// eslint-disable-next-line
/* global setInterval:false, clearInterval:false, screen:false */
import angular from 'angular';
import { StateDeclaration, TransitionService } from '@uirouter/angularjs';
import { StateDeclaration, TransitionService, Transition } from '@uirouter/angularjs';
import { GioPendoService } from '@gravitee/ui-analytics';

import EnvironmentService from '../services/environment.service';
import PortalConfigService from '../services/portalConfig.service';
import UserService from '../services/user.service';
import ConsoleSettingsService from '../services/consoleSettings.service';
import NotificationService from '../services/notification.service';

function runBlock(
$rootScope,
Expand All @@ -40,6 +41,7 @@ function runBlock(
EnvironmentService: EnvironmentService,
PortalConfigService: PortalConfigService,
ConsoleSettingsService: ConsoleSettingsService,
NotificationService: NotificationService,
ngGioPendoService: GioPendoService,
) {
'ngInject';
Expand Down Expand Up @@ -109,10 +111,10 @@ function runBlock(
);
},
},
async (trans) => {
const params = Object.assign({}, trans.params());
const stateService = trans.router.stateService;
const toState = trans.to();
async (transition: Transition) => {
const params = Object.assign({}, transition.params());
const stateService = transition.router.stateService;
const toState = transition.to();

let shouldReload = true;
if (!params.environmentId) {
Expand All @@ -126,8 +128,15 @@ function runBlock(
return stateService.target(toState, params, { reload: shouldReload });
});
} else {
params.environmentId = EnvironmentService.getFirstHridOrElseId(Constants.org.currentEnv);
return stateService.target(toState, params, { reload: shouldReload });
const environmentId = EnvironmentService.getFirstHridOrElseId(Constants.org.currentEnv);

if (environmentId) {
params.environmentId = environmentId;
return stateService.target(toState, params, { reload: shouldReload });
} else {
NotificationService.showError('You are not allowed to access APIM because you do not have any role on any environment');
transition.abort();
}
}
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
background-clip: padding-box;
border-radius: 25%;
font-size: 12px;
line-height: 12px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ export class OrgSettingsIdentityProvidersComponent implements OnInit, OnDestroy
const activatedIdps = this.tableData.filter((idp) => idp.activated === true).map((idp) => ({ identityProvider: idp.id }));
return this.organizationService.updateActivatedIdentityProviders(activatedIdps);
}),
tap(() => this.snackBarService.success(`Identity Provider ${identityProvider.name} successfully deleted!`)),
tap(() =>
this.snackBarService.success(
`Identity Provider ${identityProvider.name} successfully ${identityProvider.activated ? 'activated' : 'deactivated'}!`,
),
),
)
.subscribe(() => this.ngOnInit());
}
Expand Down
38 changes: 38 additions & 0 deletions gravitee-apim-console-webui/src/services/application.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,44 @@ class ApplicationService {
return this.$http.get(url);
}

searchPage(query, page = 1, size = 100) {
return this.listPage(['picture'], query, page, size);
}

listPage(
exclude: ApplicationExcludeFilter[] = [],
query = '',
page?: number,
size?: number,
order?: string,
status = 'active',
): ng.IHttpPromise<any> {
let url = `${this.Constants.env.baseURL}/applications/_paged?status=${status}`;

if (query.trim() !== '') {
url += `&query=${query}`;
}

if (page != null) {
url += `&page=${page}`;
}

if (size != null) {
url += `&size=${size}`;
}

if (order != null) {
url += `&order=${order}`;
}

if (exclude.length > 0) {
const excludeFilters = exclude.map((filter) => `exclude=${filter}`).join('&');
url += `&${excludeFilters}`;
}

return this.$http.get(url);
}

create(application): ng.IHttpPromise<any> {
return this.$http.post(`${this.Constants.env.baseURL}/applications/`, application);
}
Expand Down
Loading

0 comments on commit cb4a403

Please sign in to comment.