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

MC-9840 Display async jobs for a user #563

Merged
merged 1 commit into from
Jul 19, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 185 additions & 93 deletions src/app/admin/app-container/app-container.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,99 +16,191 @@

SPDX-License-Identifier: Apache-2.0
-->
<!-- Main container for the Admin section -->
<div class="container settings-container">
<div flex fxLayout="row" fxLayout.md="row" fxLayout.sm="column" fxLayout.xs="column" fxLayoutAlign="space-between" fxLayoutGap="16px">
<aside role="menu" class="menu" fxFlex="18" fxFlex.md="18" fxHide.sm fxHide.xs>
<ul class="menu-list">
<p class="marginless pl-2 text-muted">Account settings</p>
<li>
<a role="menuitem" uiSref="appContainer.userArea.profile" uiSrefActive="active">
<span class="fas fa-id-card"></span>
<span>My profile</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.userArea.settings" uiSrefActive="active">
<span class="fas fa-sliders-h"></span>
<span>Preferences</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.userArea.changePassword" uiSrefActive="active">
<span class="fas fa-unlock-alt"></span>
<span>Change password</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.userArea.apiKeys" uiSrefActive="active">
<span class="fas fa-key"></span>
<span>API keys</span>
</a>
</li>
</ul>
<!-- Main container for the Admin section -->
<div class="container settings-container">
<div
flex
fxLayout="row"
fxLayout.md="row"
fxLayout.sm="column"
fxLayout.xs="column"
fxLayoutAlign="space-between"
fxLayoutGap="16px"
>
<aside
role="menu"
class="menu"
fxFlex="18"
fxFlex.md="18"
fxHide.sm
fxHide.xs
>
<ul class="menu-list">
<p class="marginless pl-2 text-muted">Account settings</p>
<li>
<a
role="menuitem"
uiSref="appContainer.userArea.profile"
uiSrefActive="active"
>
<span class="fas fa-id-card"></span>
<span>My profile</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.userArea.settings"
uiSrefActive="active"
>
<span class="fas fa-sliders-h"></span>
<span>Preferences</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.userArea.changePassword"
uiSrefActive="active"
>
<span class="fas fa-unlock-alt"></span>
<span>Change password</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.userArea.apiKeys"
uiSrefActive="active"
>
<span class="fas fa-key"></span>
<span>API keys</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.userArea.asyncJobs"
uiSrefActive="active"
>
<span class="fas fa-tasks"></span>
<span>Jobs</span>
</a>
</li>
</ul>

<ul class="menu-list" *ngIf="isAdministrator">
<p class="marginless pl-2 text-muted">Admin settings</p>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.home" uiSrefActive="active">
<span class="fas fa-tachometer-alt"></span>
<span>Dashboard</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.modelManagement" uiSrefActive="active">
<span class="fas fa-list" aria-hidden="true"></span>
<span>Model management</span>
</a>
</li>
<li>
<a role="menuitem" *ngIf="features.useSubscribedCatalogues" uiSref="appContainer.adminArea.subscribedCatalogues" uiSrefActive="active">
<span class="fas fa-rss" aria-hidden="true"></span>
<span>Subscribed catalogues</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.emails" uiSrefActive="active">
<span class="fas fa-envelope" aria-hidden="true"></span>
<span>Emails</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.users" uiSrefActive="active">
<span class="fas fa-user" aria-hidden="true"></span>
<span>Manage users</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.pendingUsers" uiSrefActive="active">
<span class="fas fa-user-clock"></span>
<span>Pending users</span>
<span class="badge pill-card--red" aria-hidden="false" *ngIf="pendingUsersCount > 0" style="margin-left: 6px;"> {{pendingUsersCount}} </span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.groups" uiSrefActive="active">
<span class="fas fa-users" aria-hidden="true"></span>
<span>Manage groups</span>
</a>
</li>
<li>
<a role="menuitem" *ngIf="features.useOpenIdConnect" uiSref="appContainer.adminArea.openIdConnectProviders" uiSrefActive="active">
<span class="fab fa-openid" aria-hidden="true"></span>
<span>OpenID Connect</span>
</a>
</li>
<li>
<a role="menuitem" uiSref="appContainer.adminArea.configuration" uiSrefActive="active">
<span class="fas fa-cog" aria-hidden="true"></span>
<span>Configuration</span>
</a>
</li>
</ul>
</aside>
<div id="settings-content" fxFlex="82" fxFlex.md="100" fxFlex.sm="100" fxFlex.xs="100">
<div ui-view></div>
</div>
<ul class="menu-list" *ngIf="isAdministrator">
<p class="marginless pl-2 text-muted">Admin settings</p>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.home"
uiSrefActive="active"
>
<span class="fas fa-tachometer-alt"></span>
<span>Dashboard</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.modelManagement"
uiSrefActive="active"
>
<span class="fas fa-list" aria-hidden="true"></span>
<span>Model management</span>
</a>
</li>
<li>
<a
role="menuitem"
*ngIf="features.useSubscribedCatalogues"
uiSref="appContainer.adminArea.subscribedCatalogues"
uiSrefActive="active"
>
<span class="fas fa-rss" aria-hidden="true"></span>
<span>Subscribed catalogues</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.emails"
uiSrefActive="active"
>
<span class="fas fa-envelope" aria-hidden="true"></span>
<span>Emails</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.users"
uiSrefActive="active"
>
<span class="fas fa-user" aria-hidden="true"></span>
<span>Manage users</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.pendingUsers"
uiSrefActive="active"
>
<span class="fas fa-user-clock"></span>
<span>Pending users</span>
<span
class="badge pill-card--red"
aria-hidden="false"
*ngIf="pendingUsersCount > 0"
style="margin-left: 6px"
>
{{ pendingUsersCount }}
</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.groups"
uiSrefActive="active"
>
<span class="fas fa-users" aria-hidden="true"></span>
<span>Manage groups</span>
</a>
</li>
<li>
<a
role="menuitem"
*ngIf="features.useOpenIdConnect"
uiSref="appContainer.adminArea.openIdConnectProviders"
uiSrefActive="active"
>
<span class="fab fa-openid" aria-hidden="true"></span>
<span>OpenID Connect</span>
</a>
</li>
<li>
<a
role="menuitem"
uiSref="appContainer.adminArea.configuration"
uiSrefActive="active"
>
<span class="fas fa-cog" aria-hidden="true"></span>
<span>Configuration</span>
</a>
</li>
</ul>
</aside>
<div
id="settings-content"
fxFlex="82"
fxFlex.md="100"
fxFlex.sm="100"
fxFlex.xs="100"
>
<div ui-view></div>
</div>
</div>
</div>
4 changes: 3 additions & 1 deletion src/app/modules/resources/mdm-resources.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ import {
ModelDomain,
CatalogueItemDomainType,
SearchableItemResource,
ContainerDomain
ContainerDomain,
MdmAsyncJobsResource
} from '@maurodatamapper/mdm-resources';
import { MdmRestHandlerService } from './mdm-rest-handler.service';

Expand Down Expand Up @@ -180,6 +181,7 @@ export class MdmResourcesService {
);
pluginDoi = new MdmPluginDoiResource(this.resourcesConfig, this.restHandler);
merge = new MdmMergeResource(this.resourcesConfig, this.restHandler);
asyncJobs = new MdmAsyncJobsResource(this.resourcesConfig, this.restHandler);

constructor(
private resourcesConfig: MdmResourcesConfiguration,
Expand Down
13 changes: 13 additions & 0 deletions src/app/modules/users-routes/users-routes.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { UsersAppContainerComponent } from '@mdm/users/users-app-container/users
import { UIRouterModule } from '@uirouter/angular';
import { ChangePasswordComponent } from '@mdm/userArea/change-password/change-password.component';
import { ApiKeysComponent } from '@mdm/userArea/api-keys/api-keys.component';
import { AsyncJobListComponent } from '@mdm/userArea/async-job-list/async-job-list.component';
import { AsyncJobDetailComponent } from '@mdm/userArea/async-job-detail/async-job-detail.component';

export const pageRoutes = {
states: [
Expand Down Expand Up @@ -51,6 +53,17 @@ export const pageRoutes = {
name: 'appContainer.userArea.apiKeys',
url: '/profile/api',
component: ApiKeysComponent
},
{
name: 'appContainer.userArea.asyncJobs',
url: '/profile/jobs',
component: AsyncJobListComponent
},
{
name: 'appContainer.userArea.asyncJobDetail',
url: '/profile/jobs/{id}',
component: AsyncJobDetailComponent,
params: { id: { value: null, squash: true } }
}
]
};
Expand Down
6 changes: 5 additions & 1 deletion src/app/modules/users/users.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { SharedModule } from '../shared/shared.module';
import { UsersRoutesModule } from '../users-routes/users-routes.module';
import { ChangePasswordComponent } from '@mdm/userArea/change-password/change-password.component';
import { ApiKeysComponent } from '@mdm/userArea/api-keys/api-keys.component';
import { AsyncJobListComponent } from '@mdm/userArea/async-job-list/async-job-list.component';
import { AsyncJobDetailComponent } from '@mdm/userArea/async-job-detail/async-job-detail.component';

@NgModule({
declarations: [
Expand All @@ -35,7 +37,9 @@ import { ApiKeysComponent } from '@mdm/userArea/api-keys/api-keys.component';
ImgCroppieComponent,
UserDetailsComponent,
ChangePasswordComponent,
ApiKeysComponent
ApiKeysComponent,
AsyncJobListComponent,
AsyncJobDetailComponent
],
imports: [CommonModule, ImageCropperModule, SharedModule, UsersRoutesModule],
exports: [
Expand Down
13 changes: 13 additions & 0 deletions src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ <h5 class="marginless text-muted menu-label">
<span class="fas fa-key"></span>
<span>API keys</span>
</a>
<a mat-menu-item uiSref="appContainer.userArea.asyncJobs">
<span class="fas fa-tasks"></span>
<span>Jobs</span>
</a>
</div>
<div *ngIf="isAdministrator">
<h5 class="marginless text-muted menu-label">Admin settings</h5>
Expand Down Expand Up @@ -331,6 +335,15 @@ <h5 class="menu-label text-muted pt-0 marginless">Account settings</h5>
<span class="fas fa-key"></span>
<span>API keys</span>
</a>
<a
mat-menu-item
uiSref="appContainer.userArea.asyncJobs"
(click)="sidenav.toggle()"
uiSrefActive="active"
>
<span class="fas fa-tasks"></span>
<span>Jobs</span>
</a>
</div>
<div *ngIf="isLoggedIn && isAdministrator">
<h5 class="menu-label text-muted pt-0 marginless">Admin settings</h5>
Expand Down
Loading