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

OH2-193 | Display dashboard components base on user role/permission #535

Merged
Merged
Changes from 1 commit
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
Next Next commit
Align API spec file
  • Loading branch information
SilverD3 committed Nov 30, 2023

Partially verified

This commit is signed with the committer’s verified signature.
cljoly’s contribution has been verified via SSH key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
commit 247b1d30cdfe5585ddac91ba1944036015fb1d31
5,601 changes: 2,856 additions & 2,745 deletions api/oh.yaml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ apis\SMSApi.ts
apis\StockMovementsApi.ts
apis\SuppliersApi.ts
apis\TherapiesApi.ts
apis\UserSettingsApi.ts
apis\UsersApi.ts
apis\VaccineTypeApi.ts
apis\VaccinesApi.ts
@@ -119,7 +118,6 @@ models\TherapyRow.ts
models\TherapyRowDTO.ts
models\UserDTO.ts
models\UserGroupDTO.ts
models\UserMenuItemDTO.ts
models\UserProfileDTO.ts
models\UserSettingDTO.ts
models\VaccineDTO.ts
180 changes: 122 additions & 58 deletions src/generated/apis/UsersApi.ts
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ import {
LitePermissionDTO,
UserDTO,
UserGroupDTO,
UserMenuItemDTO,
UserProfileDTO,
UserSettingDTO,
} from '../models';

export interface DeleteGroupRequest {
@@ -29,12 +29,8 @@ export interface DeleteUserRequest {
username: string;
}

export interface GetGroupMenuRequest {
groupCode: string;
}

export interface GetMenuRequest {
username: string;
export interface DeleteUserSettingRequest {
id: number;
}

export interface GetUserRequest {
@@ -45,6 +41,15 @@ export interface GetUserByNameRequest {
username: string;
}

export interface GetUserSettingByIdRequest {
id: number;
}

export interface GetUserSettingByUserRequest {
userName: string;
configName: string;
}

export interface NewUserRequest {
userDTO: UserDTO;
}
@@ -53,13 +58,12 @@ export interface NewUserGroupRequest {
userGroupDTO: UserGroupDTO;
}

export interface RetrievePermissionsByUsernameRequest {
username: string;
export interface NewUserSettingsRequest {
userSettingDTO: UserSettingDTO;
}

export interface SetGroupMenuRequest {
groupCode: string;
userMenuItemDTO: Array<UserMenuItemDTO>;
export interface RetrievePermissionsByUsernameRequest {
username: string;
}

export interface UpdateUserRequest {
@@ -71,6 +75,11 @@ export interface UpdateUserGroupRequest {
userGroupDTO: UserGroupDTO;
}

export interface UpdateUserSettingsRequest {
id: number;
userSettingDTO: UserSettingDTO;
}

/**
* no description
*/
@@ -114,36 +123,18 @@ export class UsersApi extends BaseAPI {

/**
*/
getGroupMenu({ groupCode }: GetGroupMenuRequest): Observable<Array<UserMenuItemDTO>>
getGroupMenu({ groupCode }: GetGroupMenuRequest, opts?: OperationOpts): Observable<RawAjaxResponse<Array<UserMenuItemDTO>>>
getGroupMenu({ groupCode }: GetGroupMenuRequest, opts?: OperationOpts): Observable<Array<UserMenuItemDTO> | RawAjaxResponse<Array<UserMenuItemDTO>>> {
throwIfNullOrUndefined(groupCode, 'groupCode', 'getGroupMenu');

const headers: HttpHeaders = {
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<Array<UserMenuItemDTO>>({
url: '/users/group-menus/{group_code}'.replace('{group_code}', encodeURI(groupCode)),
method: 'GET',
headers,
}, opts?.responseOpts);
};

/**
*/
getMenu({ username }: GetMenuRequest): Observable<Array<UserMenuItemDTO>>
getMenu({ username }: GetMenuRequest, opts?: OperationOpts): Observable<RawAjaxResponse<Array<UserMenuItemDTO>>>
getMenu({ username }: GetMenuRequest, opts?: OperationOpts): Observable<Array<UserMenuItemDTO> | RawAjaxResponse<Array<UserMenuItemDTO>>> {
throwIfNullOrUndefined(username, 'username', 'getMenu');
deleteUserSetting({ id }: DeleteUserSettingRequest): Observable<boolean>
deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable<RawAjaxResponse<boolean>>
deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable<boolean | RawAjaxResponse<boolean>> {
throwIfNullOrUndefined(id, 'id', 'deleteUserSetting');

const headers: HttpHeaders = {
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<Array<UserMenuItemDTO>>({
url: '/users/menus/{username}'.replace('{username}', encodeURI(username)),
method: 'GET',
return this.request<boolean>({
url: '/users/settings/{id}'.replace('{id}', encodeURI(id)),
method: 'DELETE',
headers,
}, opts?.responseOpts);
};
@@ -204,6 +195,59 @@ export class UsersApi extends BaseAPI {
}, opts?.responseOpts);
};

/**
*/
getUserSettingById({ id }: GetUserSettingByIdRequest): Observable<UserSettingDTO>
getUserSettingById({ id }: GetUserSettingByIdRequest, opts?: OperationOpts): Observable<RawAjaxResponse<UserSettingDTO>>
getUserSettingById({ id }: GetUserSettingByIdRequest, opts?: OperationOpts): Observable<UserSettingDTO | RawAjaxResponse<UserSettingDTO>> {
throwIfNullOrUndefined(id, 'id', 'getUserSettingById');

const headers: HttpHeaders = {
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<UserSettingDTO>({
url: '/users/settings/{id}'.replace('{id}', encodeURI(id)),
method: 'GET',
headers,
}, opts?.responseOpts);
};

/**
*/
getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest): Observable<UserSettingDTO>
getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable<RawAjaxResponse<UserSettingDTO>>
getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable<UserSettingDTO | RawAjaxResponse<UserSettingDTO>> {
throwIfNullOrUndefined(userName, 'userName', 'getUserSettingByUser');
throwIfNullOrUndefined(configName, 'configName', 'getUserSettingByUser');

const headers: HttpHeaders = {
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<UserSettingDTO>({
url: '/users/{userName}/settings/{configName}'.replace('{userName}', encodeURI(userName)).replace('{configName}', encodeURI(configName)),
method: 'GET',
headers,
}, opts?.responseOpts);
};

/**
*/
getUserSettings(): Observable<Array<UserSettingDTO>>
getUserSettings(opts?: OperationOpts): Observable<RawAjaxResponse<Array<UserSettingDTO>>>
getUserSettings(opts?: OperationOpts): Observable<Array<UserSettingDTO> | RawAjaxResponse<Array<UserSettingDTO>>> {
const headers: HttpHeaders = {
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<Array<UserSettingDTO>>({
url: '/users/settings',
method: 'GET',
headers,
}, opts?.responseOpts);
};

/**
*/
newUser({ userDTO }: NewUserRequest): Observable<boolean>
@@ -244,6 +288,26 @@ export class UsersApi extends BaseAPI {
}, opts?.responseOpts);
};

/**
*/
newUserSettings({ userSettingDTO }: NewUserSettingsRequest): Observable<UserSettingDTO>
newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable<RawAjaxResponse<UserSettingDTO>>
newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable<UserSettingDTO | RawAjaxResponse<UserSettingDTO>> {
throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'newUserSettings');

const headers: HttpHeaders = {
'Content-Type': 'application/json',
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<UserSettingDTO>({
url: '/users/settings',
method: 'POST',
headers,
body: userSettingDTO,
}, opts?.responseOpts);
};

/**
*/
retrievePermissionsByCurrentLoggedInUser(): Observable<Array<LitePermissionDTO>>
@@ -294,27 +358,6 @@ export class UsersApi extends BaseAPI {
}, opts?.responseOpts);
};

/**
*/
setGroupMenu({ groupCode, userMenuItemDTO }: SetGroupMenuRequest): Observable<boolean>
setGroupMenu({ groupCode, userMenuItemDTO }: SetGroupMenuRequest, opts?: OperationOpts): Observable<RawAjaxResponse<boolean>>
setGroupMenu({ groupCode, userMenuItemDTO }: SetGroupMenuRequest, opts?: OperationOpts): Observable<boolean | RawAjaxResponse<boolean>> {
throwIfNullOrUndefined(groupCode, 'groupCode', 'setGroupMenu');
throwIfNullOrUndefined(userMenuItemDTO, 'userMenuItemDTO', 'setGroupMenu');

const headers: HttpHeaders = {
'Content-Type': 'application/json',
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<boolean>({
url: '/users/groups/{group_code}'.replace('{group_code}', encodeURI(groupCode)),
method: 'POST',
headers,
body: userMenuItemDTO,
}, opts?.responseOpts);
};

/**
*/
updateUser({ userDTO, password }: UpdateUserRequest): Observable<boolean>
@@ -360,4 +403,25 @@ export class UsersApi extends BaseAPI {
}, opts?.responseOpts);
};

/**
*/
updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest): Observable<UserSettingDTO>
updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable<RawAjaxResponse<UserSettingDTO>>
updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable<UserSettingDTO | RawAjaxResponse<UserSettingDTO>> {
throwIfNullOrUndefined(id, 'id', 'updateUserSettings');
throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'updateUserSettings');

const headers: HttpHeaders = {
'Content-Type': 'application/json',
...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined),
};

return this.request<UserSettingDTO>({
url: '/users/settings/{id}'.replace('{id}', encodeURI(id)),
method: 'PUT',
headers,
body: userSettingDTO,
}, opts?.responseOpts);
};

}
1 change: 0 additions & 1 deletion src/generated/apis/index.ts
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ export * from './SMSApi';
export * from './StockMovementsApi';
export * from './SuppliersApi';
export * from './TherapiesApi';
export * from './UserSettingsApi';
export * from './UsersApi';
export * from './VaccineTypeApi';
export * from './VaccinesApi';
Loading