Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Dec 19, 2024
1 parent 265935a commit 57554cb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ export const ImportDetailViewDetails = (_: RouteComponentProps) => {
[t('Author')]: data.author,
};

console.log({pageTitle})

return (
<BodyLayout headerProps={headerProps}>
<Helmet>
Expand Down
3 changes: 1 addition & 2 deletions packages/pkg-config/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export const SLICE_NOT_REGISTERED =
'Looks like configuration slice is being used without having been yet registered to the store';
export const USER_PREFERENCE_KEY = 'Preference';


// magic strings
export const clientIdConfig = "clientId" as const
export const clientIdConfig = 'clientId' as const;
19 changes: 14 additions & 5 deletions packages/rbac/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ export enum Permit {
/** Resources that the web client understands */

/** Resources that relate with user self administration like deleting own account */
export const accountClientResources = ['account_user', 'account_application', 'account_group'] as const
export type AccountClientResources = typeof accountClientResources[number]
export const accountClientResources = [
'account_user',
'account_application',
'account_group',
] as const;
export type AccountClientResources = typeof accountClientResources[number];

/** Resources that relate to the realm administration like managing other users accounts */
export const realmClientResources = ['iam_user', 'iam_realm', 'iam_group', 'iam_role'] as const
export type RealmClientResources = typeof realmClientResources[number]
export const realmClientResources = ['iam_user', 'iam_realm', 'iam_group', 'iam_role'] as const;
export type RealmClientResources = typeof realmClientResources[number];

/**
* fhir hapi Server resources that this web client is familiar with, thus we can enforce rbac for permissions on views that
Expand Down Expand Up @@ -55,7 +59,12 @@ export type FhirResources = typeof fhirResources[number];
export const webClientRoles = ['DataImport'] as const;
export type WebClientRoles = typeof webClientRoles[number];

export const allSupportedRoles = [...fhirResources, ...accountClientResources, ...realmClientResources, ...webClientRoles];
export const allSupportedRoles = [
...fhirResources,
...accountClientResources,
...realmClientResources,
...webClientRoles,
];
export type AllSupportedRoles = typeof allSupportedRoles[number];

export type BinaryNumber = number;
Expand Down
7 changes: 0 additions & 7 deletions packages/rbac/src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ export function makeArray<T>(obj: T | T[]): T[] {

export const permitLiteralKeys = Object.keys(Permit).map((x) => x.toLowerCase());

/**
* @param resource
*/
function resourceStringIsValid(resource: string): resource is AllSupportedRoles {
return allSupportedRoles.includes(resource as AllSupportedRoles);
}

/**
* validates that a string is a valid representation of one of the recognized
* resource permit combinations.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-utils/src/helpers/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { store } from '@opensrp/store';
import { Provider } from 'react-redux';
import React from 'react';
import { RoleContext, UserRole, FhirResources, Permit, AllSupportedRoles, allSupportedRoles } from '@opensrp/rbac';
import { RoleContext, UserRole, Permit, allSupportedRoles } from '@opensrp/rbac';
import { history } from '@onaio/connected-reducer-registry';
import { Router } from 'react-router';
/* eslint-disable @typescript-eslint/no-non-null-assertion */
Expand Down

0 comments on commit 57554cb

Please sign in to comment.