[ARVADOS-WORKBENCH2] updated: 1.3.0-243-g10ed1360

Git user git at public.curoverse.com
Thu Dec 27 05:44:14 EST 2018


Summary of changes:
 src/models/api-client-authorization.ts                |  7 ++-----
 src/models/resource.ts                                |  2 --
 src/services/api/order-builder.ts                     |  4 ++--
 src/store/resources/resources-actions.ts              |  6 +++---
 src/store/resources/resources.ts                      | 10 +++++-----
 src/views-components/data-explorer/with-resources.tsx |  6 +++---
 6 files changed, 15 insertions(+), 20 deletions(-)

       via  10ed13601df5259b7723aaa2b613d43196039a50 (commit)
      from  46751b9305a7e991d484494facd1f40790254d40 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 10ed13601df5259b7723aaa2b613d43196039a50
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Thu Dec 27 11:43:24 2018 +0100

    remove ResourceTypes and Api client Authorization extends by Resource
    
    Feature #14652_api_tokens_pagination
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/models/api-client-authorization.ts b/src/models/api-client-authorization.ts
index e8f6fac7..38f56ccf 100644
--- a/src/models/api-client-authorization.ts
+++ b/src/models/api-client-authorization.ts
@@ -2,9 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ResourceKind } from '~/models/resource';
+import { ResourceKind, Resource } from '~/models/resource';
 
-export interface ApiClientAuthorization {
+export interface ApiClientAuthorization extends Resource {
     uuid: string;
     apiToken: string;
     apiClientId: number;
@@ -18,7 +18,4 @@ export interface ApiClientAuthorization {
     ownerUuid: string;
     defaultOwnerUuid: string;
     scopes: string[];
-    kind: ResourceKind.API_CLIENT_AUTHORIZATION;
-    etag: string;
-    href: string;
 }
\ No newline at end of file
diff --git a/src/models/resource.ts b/src/models/resource.ts
index 6f824028..c2c2771b 100644
--- a/src/models/resource.ts
+++ b/src/models/resource.ts
@@ -16,8 +16,6 @@ export interface Resource {
     etag: string;
 }
 
-export type ResourceTypes = Resource | ApiClientAuthorization;
-
 export interface TrashableResource extends Resource {
     trashAt: string;
     deleteAt: string;
diff --git a/src/services/api/order-builder.ts b/src/services/api/order-builder.ts
index a5483670..03f2696a 100644
--- a/src/services/api/order-builder.ts
+++ b/src/services/api/order-builder.ts
@@ -3,11 +3,11 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as _ from "lodash";
-import { ResourceTypes } from "src/models/resource";
+import { Resource } from "src/models/resource";
 
 export enum OrderDirection { ASC, DESC }
 
-export class OrderBuilder<T extends ResourceTypes = ResourceTypes> {
+export class OrderBuilder<T extends Resource = Resource> {
 
     constructor(private order: string[] = []) {}
 
diff --git a/src/store/resources/resources-actions.ts b/src/store/resources/resources-actions.ts
index e6566ab8..1de2feff 100644
--- a/src/store/resources/resources-actions.ts
+++ b/src/store/resources/resources-actions.ts
@@ -3,20 +3,20 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { unionize, ofType, UnionOf } from '~/common/unionize';
-import { extractUuidKind, ResourceTypes } from '~/models/resource';
+import { extractUuidKind, Resource } from '~/models/resource';
 import { Dispatch } from 'redux';
 import { RootState } from '~/store/store';
 import { ServiceRepository } from '~/services/services';
 import { getResourceService } from '~/services/services';
 
 export const resourcesActions = unionize({
-    SET_RESOURCES: ofType<ResourceTypes[]>(),
+    SET_RESOURCES: ofType<Resource[]>(),
     DELETE_RESOURCES: ofType<string[]>()
 });
 
 export type ResourcesAction = UnionOf<typeof resourcesActions>;
 
-export const updateResources = (resources: ResourceTypes[]) => resourcesActions.SET_RESOURCES(resources);
+export const updateResources = (resources: Resource[]) => resourcesActions.SET_RESOURCES(resources);
 
 export const loadResource = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
diff --git a/src/store/resources/resources.ts b/src/store/resources/resources.ts
index 4fec02a5..e7153dec 100644
--- a/src/store/resources/resources.ts
+++ b/src/store/resources/resources.ts
@@ -2,16 +2,16 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ResourceTypes } from "~/models/resource";
+import { Resource } from "~/models/resource";
 import { ResourceKind } from '~/models/resource';
 
-export type ResourcesState = { [key: string]: ResourceTypes };
+export type ResourcesState = { [key: string]: Resource };
 
-export const getResource = <T extends ResourceTypes = ResourceTypes>(id: string) =>
+export const getResource = <T extends Resource = Resource>(id: string) =>
     (state: ResourcesState): T | undefined =>
         state[id] as T;
 
-export const setResource = <T extends ResourceTypes>(id: string, data: T) =>
+export const setResource = <T extends Resource>(id: string, data: T) =>
     (state: ResourcesState) => ({
         ...state,
         [id]: data
@@ -24,7 +24,7 @@ export const deleteResource = (id: string) =>
         return newState;
     };
 
-export const filterResources = (filter: (resource: ResourceTypes) => boolean) =>
+export const filterResources = (filter: (resource: Resource) => boolean) =>
     (state: ResourcesState) =>
         Object
             .keys(state)
diff --git a/src/views-components/data-explorer/with-resources.tsx b/src/views-components/data-explorer/with-resources.tsx
index 399a2d05..54c9396c 100644
--- a/src/views-components/data-explorer/with-resources.tsx
+++ b/src/views-components/data-explorer/with-resources.tsx
@@ -6,10 +6,10 @@ import * as React from 'react';
 import { connect } from 'react-redux';
 import { RootState } from '~/store/store';
 import { getResource } from '~/store/resources/resources';
-import { Resource, ResourceTypes } from '~/models/resource';
+import { Resource } from '~/models/resource';
 
 interface WithResourceProps {
-    resource?: ResourceTypes;
+    resource?: Resource;
 }
 
 export const withResource = (component: React.ComponentType<WithResourceProps & { uuid: string }>) =>
@@ -19,7 +19,7 @@ export const withResource = (component: React.ComponentType<WithResourceProps &
         })
     )(component);
 
-export const getDataFromResource = (property: string, resource?: ResourceTypes) => {
+export const getDataFromResource = (property: string, resource?: Resource) => {
     return resource && resource[property] ? resource[property] : '(none)';
 };
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list