-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iam): add applications tab (#13396)
Signed-off-by: Daniel Fiala <[email protected]>
- Loading branch information
1 parent
ff0d5e0
commit 94ea38b
Showing
18 changed files
with
315 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/manager/modules/iam/src/dashboard/applications/applications.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import controller from './applications.controller'; | ||
import template from './applications.template.html'; | ||
|
||
export default { | ||
bindings: { | ||
applications: '<', | ||
alert: '<', | ||
goTo: '<', | ||
trackClick: '<', | ||
}, | ||
controller, | ||
template, | ||
}; |
23 changes: 23 additions & 0 deletions
23
packages/manager/modules/iam/src/dashboard/applications/applications.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { AbstractCursorDatagridController } from '@ovh-ux/manager-ng-apiv2-helper'; | ||
import { TAG } from '../../iam.constants'; | ||
|
||
export default class ApplicationsController extends AbstractCursorDatagridController { | ||
/* @ngInject */ | ||
constructor(IAMService) { | ||
super(); | ||
this.IAMService = IAMService; | ||
} | ||
|
||
/** | ||
* Go to resourceGroup deletion | ||
* @param {string} id The application id | ||
* @returns {Promise} | ||
*/ | ||
deleteApplication(id) { | ||
this.trackClick(TAG.APPLICATIONS__DELETE); | ||
this.goTo({ | ||
name: 'iam.dashboard.applications.delete', | ||
params: { application: id }, | ||
}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/manager/modules/iam/src/dashboard/applications/applications.module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import angular from 'angular'; | ||
|
||
import component from './applications.component'; | ||
import routing from './applications.routing'; | ||
import deleteModule from './delete'; | ||
|
||
const moduleName = 'ovhManagerIAMDashboardApplications'; | ||
|
||
angular | ||
.module(moduleName, [deleteModule]) | ||
.component('iamApplications', component) | ||
.config(routing) | ||
.run(/* @ngTranslationsInject:json ./translations */); | ||
|
||
export default moduleName; |
16 changes: 16 additions & 0 deletions
16
packages/manager/modules/iam/src/dashboard/applications/applications.routing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TAG } from '../../iam.constants'; | ||
|
||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('iam.dashboard.applications', { | ||
url: '/applications?cursors', | ||
component: 'iamApplications', | ||
resolve: { | ||
breadcrumb: () => null, | ||
applications: /* @ngInject */ (IAMService) => | ||
IAMService.getApplications(), | ||
}, | ||
atInternet: { | ||
rename: TAG.APPLICATIONS, | ||
}, | ||
}); | ||
}; |
58 changes: 58 additions & 0 deletions
58
packages/manager/modules/iam/src/dashboard/applications/applications.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<div> | ||
<p data-translate="iam_applications_description"></p> | ||
<oui-datagrid | ||
data-rows="$ctrl.applications" | ||
data-page="{{ 1 }}" | ||
data-page-size="{{ $ctrl.applications.length }}" | ||
> | ||
<!-- <Columns> --> | ||
<oui-datagrid-column | ||
data-title="'iam_applications_datagrid_column_application_id' | translate" | ||
> | ||
<span data-ng-bind="$row.applicationId"></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'iam_applications_datagrid_column_application_name' | translate" | ||
> | ||
<span data-ng-bind="$row.name"></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'iam_applications_datagrid_column_application_description' | translate" | ||
> | ||
<span data-ng-bind="$row.description"></span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'iam_applications_datagrid_column_application_status' | translate" | ||
> | ||
<span | ||
class="oui-badge" | ||
data-ng-class="{ | ||
'oui-badge_success': $row.status === 'active', | ||
'oui-badge_error': $row.status !== 'active' | ||
}" | ||
data-translate="{{ 'iam_applications_datagrid_column_application_status_' + $row.status | translate }}" | ||
> | ||
</span> | ||
</oui-datagrid-column> | ||
<oui-datagrid-column | ||
data-title="'iam_applications_datagrid_column_application_key' | translate" | ||
> | ||
<span data-ng-bind="$row.applicationKey"></span> | ||
</oui-datagrid-column> | ||
<!-- </Columns> --> | ||
|
||
<!-- <Actions> --> | ||
<oui-action-menu data-compact data-placement="end"> | ||
<oui-action-menu-item | ||
data-on-click="$ctrl.deleteApplication($row.applicationId)" | ||
> | ||
<span | ||
data-translate="iam_applications_datagrid_action_delete_application" | ||
class="text-danger" | ||
></span> | ||
</oui-action-menu-item> | ||
</oui-action-menu> | ||
<!-- </Actions> --> | ||
</oui-datagrid> | ||
<div data-ui-view></div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
packages/manager/modules/iam/src/dashboard/applications/delete/delete.module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import angular from 'angular'; | ||
|
||
import deleteEntity from '../../../components/deleteEntity'; | ||
import routing from './delete.routing'; | ||
|
||
const moduleName = 'ovhManagerIAMDashboardApplicationsDelete'; | ||
|
||
angular.module(moduleName, [deleteEntity]).config(routing); | ||
|
||
export default moduleName; |
43 changes: 43 additions & 0 deletions
43
packages/manager/modules/iam/src/dashboard/applications/delete/delete.routing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ENTITY, TAG } from '../../../iam.constants'; | ||
|
||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('iam.dashboard.applications.delete', { | ||
url: '/delete/{application:string}', | ||
component: 'iamDeleteEntity', | ||
resolve: { | ||
breadcrumb: () => null, | ||
|
||
/** | ||
* A polymorphic DTO required by the deleteEntity component | ||
* @returns {{ | ||
* data: Object, | ||
* type: string | ||
* }|null} | ||
*/ | ||
entity: /* @ngInject */ (application) => { | ||
if (application) { | ||
return { data: application, type: ENTITY.APPLICATION }; | ||
} | ||
return null; | ||
}, | ||
|
||
/** | ||
* The application to delete if an id is provided | ||
* @returns {Object|null} | ||
*/ | ||
application: /* @ngInject */ ($transition$, IAMService) => { | ||
const { application: id } = $transition$.params(); | ||
return id ? IAMService.getApplication(id) : null; | ||
}, | ||
|
||
/** | ||
* Whether the entity requires a statement | ||
* @returns {boolean} | ||
*/ | ||
statement: /* @ngInject */ (entity) => entity.type === ENTITY.APPLICATION, | ||
}, | ||
atInternet: { | ||
rename: TAG.DELETE_APPLICATION, | ||
}, | ||
}); | ||
}; |
22 changes: 22 additions & 0 deletions
22
packages/manager/modules/iam/src/dashboard/applications/delete/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import angular from 'angular'; | ||
import uiRouter from '@uirouter/angularjs'; | ||
import ocLazyLoad from 'oclazyload'; | ||
|
||
const moduleName = 'ovhManagerIAMDashboardApplicationsDeleteLazyLoading'; | ||
|
||
angular.module(moduleName, [uiRouter, ocLazyLoad]).config( | ||
/* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('iam.dashboard.applications.delete.**', { | ||
url: '/delete/{application:string}', | ||
lazyLoad: (transition) => | ||
import('./delete.module').then((module) => | ||
transition | ||
.injector() | ||
.get('$ocLazyLoad') | ||
.inject(module.default), | ||
), | ||
}); | ||
}, | ||
); | ||
|
||
export default moduleName; |
22 changes: 22 additions & 0 deletions
22
packages/manager/modules/iam/src/dashboard/applications/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import angular from 'angular'; | ||
import uiRouter from '@uirouter/angularjs'; | ||
import ocLazyLoad from 'oclazyload'; | ||
|
||
const moduleName = 'ovhManagerIAMDashboardApplicationsLazyLoading'; | ||
|
||
angular.module(moduleName, [uiRouter, ocLazyLoad]).config( | ||
/* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('iam.dashboard.applications.**', { | ||
url: '/applications', | ||
lazyLoad: (transition) => | ||
import('./applications.module').then((module) => | ||
transition | ||
.injector() | ||
.get('$ocLazyLoad') | ||
.inject(module.default), | ||
), | ||
}); | ||
}, | ||
); | ||
|
||
export default moduleName; |
11 changes: 11 additions & 0 deletions
11
packages/manager/modules/iam/src/dashboard/applications/translations/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"iam_applications_datagrid_column_application_id": "Application id", | ||
"iam_applications_datagrid_column_application_name": "Application name", | ||
"iam_applications_datagrid_column_application_description": "Description", | ||
"iam_applications_datagrid_column_application_status": "Status", | ||
"iam_applications_datagrid_column_application_status_active": "Active", | ||
"iam_applications_datagrid_column_application_status_inactive": "Inactive", | ||
"iam_applications_datagrid_column_application_key": "Application key", | ||
"iam_applications_datagrid_action_delete_application": "Delete application", | ||
"iam_applications_description": "View and manage your applications. For more information about applications, see the documentation." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.