KEYCLOAK-14709 removed circular dependency
This commit is contained in:
parent
34dcbe8533
commit
0ba9055d28
9 changed files with 48 additions and 48 deletions
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import { Permission, PaginatedResources, Client } from './MyResourcesPage';
|
||||
import { Permission, PaginatedResources, Client } from './resource-model';
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
|
||||
export interface ResourcesTableProps {
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
} from '@patternfly/react-core';
|
||||
import { OkIcon } from '@patternfly/react-icons';
|
||||
|
||||
import { Resource, Permission, Scope } from './MyResourcesPage';
|
||||
import { Resource, Permission, Scope } from './resource-model';
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
import { AccountServiceContext } from '../../account-service/AccountServiceContext';
|
||||
import { ContentAlert } from '../ContentAlert';
|
||||
|
|
|
@ -23,6 +23,7 @@ import { Button, Level, LevelItem, Stack, StackItem, Tab, Tabs, TextInput } from
|
|||
import {HttpResponse} from '../../account-service/account.service';
|
||||
import {AccountServiceContext} from '../../account-service/AccountServiceContext';
|
||||
|
||||
import { PaginatedResources, Resource, Scope, Permission } from './resource-model';
|
||||
import {ResourcesTable} from './ResourcesTable';
|
||||
import {ContentPage} from '../ContentPage';
|
||||
import {Msg} from '../../widgets/Msg';
|
||||
|
@ -39,47 +40,6 @@ export interface MyResourcesPageState {
|
|||
sharedWithMe: PaginatedResources;
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
_id: string;
|
||||
name: string;
|
||||
client: Client;
|
||||
scopes: Scope[];
|
||||
uris: string[];
|
||||
shareRequests: Permission[];
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
baseUrl: string;
|
||||
clientId: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class Scope {
|
||||
public constructor(public name: string, public displayName?: string) {}
|
||||
|
||||
public toString(): string {
|
||||
if (this.hasOwnProperty('displayName') && (this.displayName)) {
|
||||
return this.displayName;
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface PaginatedResources {
|
||||
nextUrl: string;
|
||||
prevUrl: string;
|
||||
data: Resource[];
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
email?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
scopes: Scope[] | string[]; // this should be Scope[] - fix API
|
||||
username: string;
|
||||
}
|
||||
|
||||
const MY_RESOURCES_TAB = 0;
|
||||
const SHARED_WITH_ME_TAB = 1;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import { HttpResponse } from '../../account-service/account.service';
|
|||
import { AccountServiceContext } from '../../account-service/AccountServiceContext';
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
import { ContentAlert } from '../ContentAlert';
|
||||
import { Resource, Scope, Permission } from './MyResourcesPage';
|
||||
import { Resource, Scope, Permission } from './resource-model';
|
||||
|
||||
|
||||
interface PermissionRequestProps {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react';
|
||||
|
||||
import { Select, SelectOption, SelectVariant, SelectOptionObject } from '@patternfly/react-core';
|
||||
import { Scope } from './MyResourcesPage';
|
||||
import { Scope } from './resource-model';
|
||||
|
||||
interface PermissionSelectState {
|
||||
selected: ScopeValue[];
|
||||
|
|
|
@ -42,7 +42,7 @@ import { HttpResponse } from '../../account-service/account.service';
|
|||
import { AccountServiceContext } from '../../account-service/AccountServiceContext';
|
||||
import { PermissionRequest } from "./PermissionRequest";
|
||||
import { ShareTheResource } from "./ShareTheResource";
|
||||
import { Permission, Resource } from "./MyResourcesPage";
|
||||
import { Permission, Resource } from "./resource-model";
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
import { ResourcesTableState, ResourcesTableProps, AbstractResourcesTable } from './AbstractResourceTable';
|
||||
import { EditTheResource } from './EditTheResource';
|
||||
|
|
|
@ -32,7 +32,7 @@ import {
|
|||
} from '@patternfly/react-core';
|
||||
|
||||
import { AccountServiceContext } from '../../account-service/AccountServiceContext';
|
||||
import { Resource, Permission, Scope } from './MyResourcesPage';
|
||||
import { Resource, Permission, Scope } from './resource-model';
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
import {ContentAlert} from '../ContentAlert';
|
||||
import { PermissionSelect } from './PermissionSelect';
|
||||
|
|
|
@ -29,7 +29,7 @@ import {
|
|||
import { RepositoryIcon } from '@patternfly/react-icons';
|
||||
|
||||
|
||||
import {PaginatedResources, Resource, Scope} from "./MyResourcesPage";
|
||||
import { PaginatedResources, Resource, Scope } from "./resource-model";
|
||||
import { Msg } from '../../widgets/Msg';
|
||||
import { AbstractResourcesTable, ResourcesTableState } from './AbstractResourceTable';
|
||||
import EmptyMessageState from '../../widgets/EmptyMessageState';
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
export interface Resource {
|
||||
_id: string;
|
||||
name: string;
|
||||
client: Client;
|
||||
scopes: Scope[];
|
||||
uris: string[];
|
||||
shareRequests: Permission[];
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
baseUrl: string;
|
||||
clientId: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class Scope {
|
||||
public constructor(public name: string, public displayName?: string) {}
|
||||
|
||||
public toString(): string {
|
||||
if (this.hasOwnProperty('displayName') && (this.displayName)) {
|
||||
return this.displayName;
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface PaginatedResources {
|
||||
nextUrl: string;
|
||||
prevUrl: string;
|
||||
data: Resource[];
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
email?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
scopes: Scope[] | string[]; // this should be Scope[] - fix API
|
||||
username: string;
|
||||
}
|
Loading…
Reference in a new issue