robbyson-frontend-library 0.0.1-rc1 → 0.0.1-rc10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/header-context-menu/header-context-menu.interface.js +1 -0
- package/dist/components/loading/loading.interface.js +1 -0
- package/dist/components/mobile-filter/mobile-filter.interface.js +1 -0
- package/dist/components/overlay/overlay.interface.js +1 -0
- package/dist/components/pages/base-app-page.component.js +20 -5
- package/dist/components/pages/base-app-page.styles.js +7 -4
- package/dist/components/pdf-viewer/pdf-viewer.interface.js +1 -0
- package/dist/components/sort/sort.interface.js +1 -0
- package/dist/constants/layout-dimensions.constants.js +3 -2
- package/dist/factories/index.js +1 -0
- package/dist/factories/query-params.factory.js +52 -0
- package/dist/factories/response.factory.js +1 -1
- package/dist/index.js +4 -0
- package/dist/models/guidance-category.model.js +24 -0
- package/dist/models/guidance-query.model.js +24 -0
- package/dist/models/guidance.model.js +40 -0
- package/dist/models/http-response.model.js +11 -0
- package/dist/repositories/base.repository.js +9 -0
- package/dist/repositories/guidance.repository.interface.js +1 -0
- package/dist/services/dtos/example.dto.js +1 -0
- package/dist/services/dtos/index.js +1 -0
- package/dist/services/guidance.service.interface.js +1 -0
- package/dist/services/validations.service.interface.js +1 -0
- package/dist/utils/build-error/buildError.util.js +1 -1
- package/dist/utils/robbyson-navigate.js +34 -1
- package/index.d.ts +12 -5
- package/package.json +3 -3
- package/src/components/accordion/accordion.interface.ts +2 -1
- package/src/components/badge/badge.interface.ts +3 -2
- package/src/components/base-component.prop.interface.ts +2 -0
- package/src/components/{base-page.prop.interface.tsx → base-page.prop.interface.ts} +1 -2
- package/src/components/filter/basic-button.types.d.ts +9 -0
- package/src/components/filter/filter.interface.tsx +59 -0
- package/src/components/filter/index.d.ts +1 -0
- package/src/components/header-context-menu/header-context-menu.interface.ts +13 -0
- package/src/components/header-context-menu/header-context-menu.types.d.ts +9 -0
- package/src/components/header-context-menu/index.d.ts +1 -0
- package/src/components/loading/index.d.ts +1 -0
- package/src/components/loading/loading.interface.ts +10 -0
- package/src/components/loading/loading.types.d.ts +9 -0
- package/src/components/{menu.interface.tsx → menu.interface.ts} +6 -0
- package/src/components/mobile-filter/index.d.ts +1 -0
- package/src/components/mobile-filter/mobile-filter.interface.ts +8 -0
- package/src/components/mobile-filter/mobile-filter.types.d.ts +9 -0
- package/src/components/modal/modal.interface.ts +3 -2
- package/src/components/overlay/index.d.ts +1 -0
- package/src/components/overlay/overlay.interface.ts +7 -0
- package/src/components/overlay/overlay.types.d.ts +9 -0
- package/src/components/pages/base-app-page.component.tsx +15 -13
- package/src/components/pages/base-app-page.styles.ts +39 -6
- package/src/components/pagination/pagination.interface.ts +2 -2
- package/src/components/pdf-viewer/index.d.ts +1 -0
- package/src/components/pdf-viewer/pdf-viewer.interface.ts +5 -0
- package/src/components/pdf-viewer/pdf-viewer.types.d.ts +10 -0
- package/src/components/scroll-box/scroll-box.interface.ts +2 -1
- package/src/components/sidebar/sidebar.interface.ts +12 -9
- package/src/components/sort/index.d.ts +1 -0
- package/src/components/sort/sort.interface.ts +21 -0
- package/src/components/sort/sort.types.d.ts +9 -0
- package/src/components/tags/tags.interface.ts +2 -1
- package/src/components/text-field/{text-field.interface.tsx → text-field.interface.ts} +1 -0
- package/src/components/toggle-icon-button/toggle-icon-button.interface.ts +1 -1
- package/src/constants/layout-dimensions.constants.ts +3 -2
- package/src/factories/index.ts +2 -1
- package/src/factories/query-params.factory.ts +82 -0
- package/src/factories/response.factory.ts +1 -1
- package/src/index.ts +4 -0
- package/src/models/guidance-category.model.ts +8 -0
- package/src/models/guidance-query.model.ts +11 -0
- package/src/models/guidance.model.ts +58 -0
- package/src/models/http-response.model.ts +14 -0
- package/src/models/index.d.ts +4 -0
- package/src/models/theme-base.ts +3 -1
- package/src/repositories/{base.repository.tsx → base.repository.ts} +11 -0
- package/src/repositories/guidance.repository.interface.ts +11 -0
- package/src/repositories/index.d.ts +2 -1
- package/src/services/authentication.service.interface.ts +2 -0
- package/src/services/dtos/example.dto.ts +1 -0
- package/src/services/dtos/index.ts +1 -0
- package/src/services/guidance.service.interface.ts +27 -0
- package/src/services/index.d.ts +3 -0
- package/src/services/validations.service.interface.ts +5 -0
- package/src/states/main-container/root-app.state.interface.ts +1 -1
- package/src/utils/build-error/buildError.util.ts +1 -1
- package/src/utils/robbyson-navigate.ts +45 -2
- package/src/components/base-component.prop.interface.tsx +0 -4
- package/src/components/snackbar/index.d.ts +0 -1
- package/src/components/snackbar/snackbar.interface.ts +0 -16
- package/src/components/snackbar/snackbar.types.d.ts +0 -9
- /package/dist/components/{snackbar/snackbar.interface.js → filter/filter.interface.js} +0 -0
- /package/src/components/assets/{assets.interfaces.tsx → assets.interfaces.ts} +0 -0
- /package/src/components/{base-test.prop.interface.tsx → base-test.prop.interface.ts} +0 -0
- /package/src/components/basic-button/{basic-button.interface.tsx → basic-button.interface.ts} +0 -0
- /package/src/components/colors/{colors.interfaces.tsx → colors.interfaces.ts} +0 -0
- /package/src/components/divider/{divider.interface.tsx → divider.interface.ts} +0 -0
- /package/src/components/{index.tsx → index.ts} +0 -0
- /package/src/components/progress-bar/{progress-bar.interface.tsx → progress-bar.interface.ts} +0 -0
- /package/src/components/progress-tracker/{progress-tracker.interface.tsx → progress-tracker.interface.ts} +0 -0
- /package/src/components/select/{select.interface.tsx → select.interface.ts} +0 -0
- /package/src/components/typography/{typography.interfaces.tsx → typography.interfaces.ts} +0 -0
- /package/src/components/upload/{upload.interface.tsx → upload.interface.ts} +0 -0
|
@@ -3,8 +3,14 @@ export type MenuItem = {
|
|
|
3
3
|
iconHandle: string,
|
|
4
4
|
linkTo: string,
|
|
5
5
|
disabled?: boolean
|
|
6
|
+
matchPath?: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export interface IMenuProps {
|
|
9
10
|
items: MenuItem[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IMenuState {
|
|
14
|
+
expanded: boolean,
|
|
15
|
+
location: string,
|
|
10
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mobile-filter.interface';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
///<reference types="react" />
|
|
2
|
+
///<reference types="robbyson-frontend-library" />
|
|
3
|
+
|
|
4
|
+
declare module "styleguide/MobileFilter" {
|
|
5
|
+
import { IMobileFilterProps } from "robbyson-frontend-library";
|
|
6
|
+
const MobileFilter: React.ComponentType<IMobileFilterProps>;
|
|
7
|
+
|
|
8
|
+
export default MobileFilter;
|
|
9
|
+
}
|
|
@@ -14,7 +14,8 @@ export interface IModalProps extends IBaseComponentProp {
|
|
|
14
14
|
children: any;
|
|
15
15
|
width?: number;
|
|
16
16
|
height?: number;
|
|
17
|
-
|
|
17
|
+
closeIcon?: boolean;
|
|
18
|
+
titleHandleLocale?: string;
|
|
18
19
|
actionButtons?: ActionButton[];
|
|
19
|
-
|
|
20
|
+
overlayZindex?: string;
|
|
20
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './overlay.interface';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
///<reference types="react" />
|
|
2
|
+
///<reference types="robbyson-frontend-library" />
|
|
3
|
+
|
|
4
|
+
declare module "styleguide/Overlay" {
|
|
5
|
+
import { IOverlayProps } from "robbyson-frontend-library";
|
|
6
|
+
const Overlay: React.ComponentType<IOverlayProps<any>>;
|
|
7
|
+
|
|
8
|
+
export default Overlay;
|
|
9
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IoC } from "../../ioc";
|
|
3
3
|
import {
|
|
4
|
-
IAuthenticationService,
|
|
5
4
|
ILocaleService,
|
|
6
|
-
IThemeService
|
|
5
|
+
IThemeService
|
|
7
6
|
} from "../../services";
|
|
8
|
-
import SVG from "react-inlinesvg";
|
|
9
7
|
|
|
10
8
|
import {
|
|
11
9
|
PageContainer,
|
|
@@ -13,45 +11,49 @@ import {
|
|
|
13
11
|
Title,
|
|
14
12
|
ContextMenu,
|
|
15
13
|
Content,
|
|
14
|
+
LeftArrowLarge,
|
|
15
|
+
Block,
|
|
16
16
|
} from "./base-app-page.styles";
|
|
17
17
|
import { RobbysonNavigate } from "../../utils";
|
|
18
|
+
import { QueryParamsFactory } from "../../factories/query-params.factory";
|
|
18
19
|
|
|
19
20
|
export abstract class BaseAppPage<T, T1> extends React.Component<T, T1> {
|
|
20
21
|
protected headerLocale: string = "Header Locale";
|
|
21
|
-
|
|
22
|
+
protected abstract paramsValidValues: {};
|
|
23
|
+
protected abstract paramsDefaultValues: {};
|
|
22
24
|
protected _localeService: ILocaleService;
|
|
23
|
-
protected _authenticationService: IAuthenticationService;
|
|
24
25
|
protected _themeService: IThemeService;
|
|
25
26
|
|
|
26
27
|
constructor(props: T) {
|
|
27
28
|
super(props);
|
|
28
29
|
this.translate = this.translate.bind(this);
|
|
29
30
|
this._localeService = IoC.GetInstance<ILocaleService>("LocaleService");
|
|
30
|
-
this._authenticationService = IoC.GetInstance<IAuthenticationService>(
|
|
31
|
-
"AuthenticationService"
|
|
32
|
-
);
|
|
33
31
|
this._themeService = IoC.GetInstance<IThemeService>("ThemeService");
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
public translate(text?: string): string {
|
|
37
|
-
return this._localeService.getLocaleByHandle(text || "");
|
|
34
|
+
public translate(text?: string, ...args: string[]): string {
|
|
35
|
+
return this._localeService.getLocaleByHandle(text || "", ...args);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
abstract contextMenu(): React.ReactNode;
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
abstract renderPage(): React.ReactNode;
|
|
43
41
|
|
|
44
42
|
public render() {
|
|
43
|
+
QueryParamsFactory.validate(this.paramsValidValues, this.paramsDefaultValues)
|
|
45
44
|
return (
|
|
46
45
|
<PageContainer>
|
|
47
46
|
<Header>
|
|
48
47
|
<div>
|
|
49
|
-
<
|
|
48
|
+
<LeftArrowLarge
|
|
50
49
|
src={this._themeService.getIconAssetUrl(
|
|
51
50
|
"left-arrow-large"
|
|
52
51
|
)}
|
|
53
52
|
onClick={() => RobbysonNavigate.back()}
|
|
54
53
|
/>
|
|
54
|
+
|
|
55
|
+
<Block />
|
|
56
|
+
|
|
55
57
|
<Title>{this.translate(this.headerLocale)}</Title>
|
|
56
58
|
</div>
|
|
57
59
|
<ContextMenu className="body-2-book">
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { LayoutDimensions } from "../../constants";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
+
import SVG from "react-inlinesvg";
|
|
3
4
|
|
|
4
5
|
const SIDEBAR_WIDTH = 72;
|
|
5
6
|
|
|
6
7
|
export const PageContainer = styled.div`
|
|
7
8
|
padding: 32px 55px 47px calc(${SIDEBAR_WIDTH}px + 55px);
|
|
8
9
|
|
|
9
|
-
background: var(--solid-background);
|
|
10
10
|
height: 100%;
|
|
11
11
|
|
|
12
|
-
@media (max-width: ${LayoutDimensions.
|
|
13
|
-
padding: 32px 24px
|
|
12
|
+
@media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
|
|
13
|
+
padding: 32px 24px;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@media (max-width: ${LayoutDimensions.
|
|
17
|
-
padding: 24px 16px
|
|
16
|
+
@media (max-width: ${LayoutDimensions.width.mobile}px) {
|
|
17
|
+
padding: 24px 16px;
|
|
18
18
|
}
|
|
19
19
|
`;
|
|
20
20
|
|
|
@@ -26,6 +26,11 @@ export const Header = styled.div`
|
|
|
26
26
|
padding-bottom: 8px;
|
|
27
27
|
gap: 16px !important;
|
|
28
28
|
|
|
29
|
+
@media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
|
|
30
|
+
flex-direction: column !important;
|
|
31
|
+
align-items: flex-start !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
& > div {
|
|
30
35
|
display: flex;
|
|
31
36
|
align-items: center;
|
|
@@ -36,10 +41,38 @@ export const Header = styled.div`
|
|
|
36
41
|
}
|
|
37
42
|
`;
|
|
38
43
|
|
|
39
|
-
export const ContextMenu = styled.div
|
|
44
|
+
export const ContextMenu = styled.div`
|
|
45
|
+
-ms-overflow-style: none;
|
|
46
|
+
scrollbar-width: none;
|
|
47
|
+
overflow-y: scroll;
|
|
48
|
+
&::-webkit-scrollbar {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
@media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
40
55
|
|
|
41
56
|
export const Title = styled.h4`
|
|
42
57
|
margin-left: 12px;
|
|
43
58
|
`;
|
|
44
59
|
|
|
45
60
|
export const Content = styled.div``;
|
|
61
|
+
|
|
62
|
+
export const LeftArrowLarge = styled(SVG)`
|
|
63
|
+
display: none;
|
|
64
|
+
|
|
65
|
+
@media (min-width: ${LayoutDimensions.width.horizontalIpadMini + 1}px) {
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export const Block = styled.div`
|
|
71
|
+
display: none;
|
|
72
|
+
|
|
73
|
+
@media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
|
|
74
|
+
display: block;
|
|
75
|
+
width: 24px;
|
|
76
|
+
height: 24px;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pdf-viewer.interface';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
///<reference types="react" />
|
|
2
|
+
///<reference types="robbyson-frontend-library" />
|
|
3
|
+
|
|
4
|
+
declare module "styleguide/PDFViewer" {
|
|
5
|
+
import { IPDFViewerProps } from "robbyson-frontend-library";
|
|
6
|
+
const PDFViewer: React.ComponentType<IPDFViewerProps>;
|
|
7
|
+
|
|
8
|
+
export default PDFViewer;
|
|
9
|
+
}
|
|
10
|
+
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
3
3
|
|
|
4
4
|
export interface IScrollBoxProps extends IBaseComponentProp {
|
|
5
|
-
height:
|
|
5
|
+
height: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
onScrollBottom?(): void;
|
|
8
8
|
className?: string;
|
|
9
|
+
hideScrollBar?: boolean;
|
|
9
10
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
2
2
|
|
|
3
3
|
export interface ISidebarProps extends IBaseComponentProp {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
show: boolean;
|
|
5
|
+
position: "left" | "right";
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
titleLocaleHandle: string;
|
|
9
|
+
height?: number;
|
|
10
|
+
width?: number;
|
|
11
|
+
top?: number;
|
|
12
|
+
overlayZindex?: string;
|
|
13
|
+
showOverlay?: boolean;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sort.interface';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconHandle } from "../../models";
|
|
2
|
+
import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
3
|
+
|
|
4
|
+
export interface ISortProps extends IBaseComponentProp {
|
|
5
|
+
titleLocaleHandle?: string;
|
|
6
|
+
options: Array<{ nameLocaleHandle: string; value: string | number }>;
|
|
7
|
+
defaultOption: string | number;
|
|
8
|
+
icon: IconHandle;
|
|
9
|
+
onChangeOption?(option: {
|
|
10
|
+
nameLocaleHandle: string;
|
|
11
|
+
value: string | number;
|
|
12
|
+
}): void;
|
|
13
|
+
hideOnMouseOver?: boolean;
|
|
14
|
+
hideOnChangeOption?: boolean;
|
|
15
|
+
width?: string | number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ISortState {
|
|
19
|
+
showSort: boolean;
|
|
20
|
+
sortValue: string | number;
|
|
21
|
+
}
|
|
@@ -4,8 +4,9 @@ import { IBaseComponentProp } from "../base-component.prop.interface";
|
|
|
4
4
|
export interface ITagsState {
|
|
5
5
|
show: boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface ITagsProps<T> extends IBaseComponentProp {
|
|
7
|
+
export interface ITagsProps<T> extends IBaseComponentProp, React.HTMLAttributes<T> {
|
|
8
8
|
closeable?: boolean;
|
|
9
|
+
fillIcon?: string;
|
|
9
10
|
iconHandle?: IconHandle;
|
|
10
11
|
children?: any;
|
|
11
12
|
variant?: "primary" | "secondary";
|
|
@@ -9,8 +9,8 @@ export interface IToggleIconButtonProps<T> extends React.ButtonHTMLAttributes<T>
|
|
|
9
9
|
active?: boolean,
|
|
10
10
|
disabled?: boolean,
|
|
11
11
|
disabledIconHandle?: IconHandle,
|
|
12
|
+
fatherControl?: boolean,
|
|
12
13
|
}
|
|
13
|
-
|
|
14
14
|
export interface IToggleIconButtonState {
|
|
15
15
|
active: boolean,
|
|
16
16
|
}
|
package/src/factories/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './response.factory';
|
|
1
|
+
export * from './response.factory';
|
|
2
|
+
export * from './query-params.factory';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { BaseFactory } from "./base.factory";
|
|
2
|
+
import { RobbysonNavigate } from "../utils";
|
|
3
|
+
|
|
4
|
+
export class QueryParamsFactory implements BaseFactory {
|
|
5
|
+
private static checkDefaultValues(
|
|
6
|
+
validValues: {},
|
|
7
|
+
defaultValues: {}
|
|
8
|
+
): void {
|
|
9
|
+
// Verifica se os parâmetros validados possuem um valor padrão
|
|
10
|
+
for (const [key, value] of Object.entries(validValues || [])) {
|
|
11
|
+
if (!defaultValues.hasOwnProperty(key))
|
|
12
|
+
throw `The "${key}" query parameter does not have a default value.`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static validate<T>(validValues: {}, defaultValues: {}): void {
|
|
17
|
+
const queryParams = RobbysonNavigate.getQueryParams<T>();
|
|
18
|
+
|
|
19
|
+
this.checkDefaultValues(validValues, defaultValues);
|
|
20
|
+
|
|
21
|
+
// Transforma a variável 'queryParams' em um objeto
|
|
22
|
+
if (Object.prototype.toString.call(queryParams) === "[object Object]") {
|
|
23
|
+
const queryParamsCopy = Object(queryParams);
|
|
24
|
+
|
|
25
|
+
for (const [queryParamsKey, queryParamsValue] of Object.entries(
|
|
26
|
+
queryParamsCopy
|
|
27
|
+
)!) {
|
|
28
|
+
for (const [key, value] of Object.entries(validValues)) {
|
|
29
|
+
// Verifica se o parâmetro da URL é o mesmo parâmetro da validação que está sendo iterado
|
|
30
|
+
if (queryParamsKey === key) {
|
|
31
|
+
|
|
32
|
+
// Caso os valores permitidos para esse parâmetro estejam em um objeto, será convertido para um array
|
|
33
|
+
if (value instanceof Object) {
|
|
34
|
+
let validValuesToArray = [];
|
|
35
|
+
for (const [
|
|
36
|
+
objectKey,
|
|
37
|
+
objectValue,
|
|
38
|
+
] of Object.entries(value)) {
|
|
39
|
+
validValuesToArray.push(String(objectValue));
|
|
40
|
+
}
|
|
41
|
+
// Caso o valor do parâmetro atual que está na url não seja um valor válido, o valor padrão será definido
|
|
42
|
+
if (
|
|
43
|
+
!validValuesToArray.includes(
|
|
44
|
+
String(queryParamsValue)
|
|
45
|
+
)
|
|
46
|
+
) {
|
|
47
|
+
RobbysonNavigate.setQueryParams(
|
|
48
|
+
queryParamsKey,
|
|
49
|
+
defaultValues[
|
|
50
|
+
String(
|
|
51
|
+
queryParamsKey
|
|
52
|
+
) as keyof typeof defaultValues
|
|
53
|
+
]
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
} else if (value instanceof Array) {
|
|
57
|
+
if (!value.includes(String(queryParamsValue)))
|
|
58
|
+
RobbysonNavigate.setQueryParams(
|
|
59
|
+
queryParamsKey,
|
|
60
|
+
defaultValues[
|
|
61
|
+
String(
|
|
62
|
+
queryParamsKey
|
|
63
|
+
) as keyof typeof defaultValues
|
|
64
|
+
]
|
|
65
|
+
);
|
|
66
|
+
} else if (value instanceof String || value instanceof Number) {
|
|
67
|
+
if (String(value) !== String(queryParamsValue))
|
|
68
|
+
RobbysonNavigate.setQueryParams(
|
|
69
|
+
queryParamsKey,
|
|
70
|
+
defaultValues[
|
|
71
|
+
String(
|
|
72
|
+
queryParamsKey
|
|
73
|
+
) as keyof typeof defaultValues
|
|
74
|
+
]
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,10 @@ export * from "./models/user-mirror.model";
|
|
|
9
9
|
export * from "./models/user-session.model";
|
|
10
10
|
export * from "./models/send-user-to-login.model";
|
|
11
11
|
export * from "./models/angel-friend-status.model";
|
|
12
|
+
export * from "./models/guidance-category.model";
|
|
13
|
+
export * from "./models/guidance.model";
|
|
14
|
+
export * from "./models/guidance-query.model";
|
|
15
|
+
export * from "./models/http-response.model";
|
|
12
16
|
|
|
13
17
|
// Repositories
|
|
14
18
|
export * from "./repositories/base.repository";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseRepositoryModel } from "./base.repository.model";
|
|
2
|
+
|
|
3
|
+
export class GuidanceQueryListModel extends BaseRepositoryModel {
|
|
4
|
+
name?: string;
|
|
5
|
+
categoryId?: string;
|
|
6
|
+
period?:number;
|
|
7
|
+
page?: number;
|
|
8
|
+
per?: number;
|
|
9
|
+
orderBy?: string;
|
|
10
|
+
orderDirection?: "asc" | "desc";
|
|
11
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseRepositoryModel } from "./base.repository.model";
|
|
2
|
+
import { GuidanceCategoryModel } from "./guidance-category.model";
|
|
3
|
+
|
|
4
|
+
export class GuidanceModel extends BaseRepositoryModel {
|
|
5
|
+
_id: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
tags: string[];
|
|
8
|
+
allowDownload: boolean;
|
|
9
|
+
visibilityType: string;
|
|
10
|
+
files: GuidanceFileObject[];
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
category: GuidanceCategoryModel;
|
|
14
|
+
status: string;
|
|
15
|
+
visibleFrom: string;
|
|
16
|
+
visibleUntil: string;
|
|
17
|
+
content: string;
|
|
18
|
+
contentType: string;
|
|
19
|
+
coverImageMetaData: FileMetaData;
|
|
20
|
+
fileMetaData: FileMetaData;
|
|
21
|
+
firstLetter: string;
|
|
22
|
+
createdBy: User;
|
|
23
|
+
updatedBy: User;
|
|
24
|
+
visibleToUsers: string[];
|
|
25
|
+
notVisibleToUsers: string[];
|
|
26
|
+
visibleToAttributeValues: string[];
|
|
27
|
+
notVisibleToAttributeValues: string[];
|
|
28
|
+
visibleToHierarchyLevels: string[];
|
|
29
|
+
notVisibleToHierarchyLevels: string[];
|
|
30
|
+
visibleToGroups: string[];
|
|
31
|
+
notVisibleToGroups: string[];
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
isFavorite: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class GuidanceFileObject {
|
|
38
|
+
fileMetaData: FileMetaData;
|
|
39
|
+
contentType: string;
|
|
40
|
+
allowDownload?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class FileMetaData {
|
|
44
|
+
_id: string;
|
|
45
|
+
token: string;
|
|
46
|
+
fileType: string;
|
|
47
|
+
fileName: string;
|
|
48
|
+
fileMD5: string;
|
|
49
|
+
publicUrl: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
class User {
|
|
53
|
+
_id: number;
|
|
54
|
+
name: string;
|
|
55
|
+
identification: string;
|
|
56
|
+
login: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class HttpListResponse<T> {
|
|
2
|
+
data: T;
|
|
3
|
+
meta: GenericHttpListResponseMeta | Record<string, never>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
class GenericHttpListResponseMeta {
|
|
7
|
+
orderBy: string;
|
|
8
|
+
orderDirection: "DESC" | "ASC";
|
|
9
|
+
page: number;
|
|
10
|
+
per: number;
|
|
11
|
+
total: number;
|
|
12
|
+
totalDocs: number;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
package/src/models/index.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ export * from "./result-level.model";
|
|
|
5
5
|
export * from "./angel-friend-status.model";
|
|
6
6
|
export * from "./send-user-to-login.model";
|
|
7
7
|
export * from "./term-of-use.model";
|
|
8
|
+
export * from "./guidance-category.model";
|
|
9
|
+
export * from "./guidance-query.model";
|
|
10
|
+
export * from "./guidance.model";
|
|
11
|
+
export * from "./http-response.model";
|
package/src/models/theme-base.ts
CHANGED
|
@@ -79,11 +79,13 @@ class ThemeBaseColors {
|
|
|
79
79
|
};
|
|
80
80
|
complementary: {
|
|
81
81
|
agendaReminder: string;
|
|
82
|
+
angelGodson: string;
|
|
83
|
+
angelGodfather: string;
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
export type IconHandle = 'active-bold' | 'active-thin' | 'add-challenge-bold' | 'avatar-login' | 'add-challenge-thin' | 'add-notification-bold' | 'add-notification-thin' | 'add-quiz-bold' | 'add-quiz-thin' | 'angel-friend-add-bold' | 'angel-friend-add-thin' | 'angel-friend-bold' | 'angel-friend-thin' | 'attachment-bold' | 'attachment-thin' | 'auction-bold' | 'auction-thin' | 'available-bold' | 'available-thin' | 'broadcast-bold' | 'broadcast-thin' | 'calendar-bold' | 'calendar-thin' | 'camera-bold' | 'camera-thin' | 'cancel-bold' | 'cancel-thin' | 'challenge-bold' | 'challenge-thin' | 'chat-bold' | 'chatbot-bold' | 'chatbot-thin' | 'chat-fil-bold' | 'chat-fill-thin' | 'chat-smile-bold' | 'chat-smile-thin' | 'chat-thin' | 'check-bold' | 'check-thin' | 'chocolate-menu' | 'chronometer-bold' | 'chronometer-thin' | 'clock-bold' | 'clock-thin' | 'close-bold' | 'close-thin' | 'cloud-bold' | 'cloud-thin' | 'coin-bold' | 'coin-thin' | 'column-view-active-bold' | 'column-view-active-thin' | 'column-view-bold' | 'column-view-thin' | 'contacts-bold' | 'contacts-thin' | 'delete-bold' | 'delete-thin' | 'documents-bold' | 'documents-thin' | 'down-arrow' | 'download-bold' | 'download-thin' | 'downward-arrow-bold' | 'downward-arrow-thin' | 'duplicate-bold' | 'duplicate-thin' | 'eagle-bold' | 'eagle-thin' | 'edit-bold' | 'edit-thin' | 'emoji-bold' | 'emoji-thin' | 'family-bold' | 'family-thin' | 'filter-active-bold' | 'filter-active-thin' | 'filter-inactive-bold' | 'filter-inactive-thin' | 'filter' | 'forward-bold' | 'forward-thin' | 'goal-bold' | 'goal-thin' | 'grid-view-active-bold' | 'grid-view-active-thin' | 'grid-view-bold' | 'grid-view-thin' | 'group-bold' | 'group-brackets-bold' | 'group-brackets-thin' | 'group-fill-bold' | 'group-fill-thin' | 'group-thin' | 'guide-bold' | 'guide-thin' | 'health-bold' | 'health-thin' | 'heart-bold' | 'heart-fill-bold' | 'heart-fill-thin' | 'heart-thin' | 'humor-bold' | 'humor-thin' | 'inactive-bold' | 'inactive-thin' | 'indicator-bold' | 'indicator-thin' | 'info-bold' | 'info-thin' | 'integration-bold' | 'integration-thin' | 'learning-bold' | 'learning-thin' | 'leave-bold' | 'leave-thin' | 'left-arrow-large' | 'left-arrow-small' | 'like-bold' | 'like-fill-bold' | 'like-fill-thin' | 'like-thin' | 'magnifying-glass-bold' | 'magnifying-glass-thin' | 'minus' | 'more-vert' | 'mountain-bold' | 'mountain-thin' | 'new-document-bold' | 'new-document-thin' | 'new-tip-thin-1' | 'new-tip-thin' | 'notification-bold' | 'notification-thin' | 'objetive-bold' | 'objetive-thin' | 'order-bold-1' | 'order-bold' | 'order-thin-1' | 'order-thin' | 'performance-bold' | 'performance-thin' | 'phone-bold' | 'phone-thin' | 'plus' | 'quiz-bold' | 'quiz-thin' | 'raffle-bold' | 'raffle-draw-bold' | 'raffle-draw-thin' | 'raffle-thin' | 'relationship-bold' | 'relationship-thin' | 'reports-bold' | 'reports-thin' | 'right-arrow-large' | 'right-arrow-small' | 'send-bold' | 'send-thin' | 'settings-bold' | 'settings-thin' | 'star-bold' | 'star-thin' | 'store-bold' | 'store-item-bold' | 'store-item-thin' | 'store-thin' | 'tag-bold' | 'tag-thin' | 'test-bold' | 'test-thin' | 'tips-bold' | 'tips-thin' | 'tree-bold' | 'tree-thin' | 'trophy-bold' | 'trophy-thin' | 'up-arrow' | 'upload-bold' | 'upload-thin' | 'upward-arrow-bold' | 'upward-arrow-thin' | 'user-bold' | 'user-thin' | 'variable-pay-bold' | 'variable-pay-thin' | 'view-bold' | 'view-thin' | 'not-view-thin' | 'not-view-bold' | 'work-bold' | 'working' | 'work-thin';
|
|
88
|
+
export type IconHandle = 'active-bold' | 'active-thin' | 'add-challenge-bold' | 'avatar-login' | 'add-challenge-thin' | 'add-notification-bold' | 'add-notification-thin' | 'add-quiz-bold' | 'add-quiz-thin' | 'angel-friend-add-bold' | 'angel-friend-add-thin' | 'angel-friend-bold' | 'angel-friend-thin' | 'attachment-bold' | 'attachment-thin' | 'auction-bold' | 'auction-thin' | 'available-bold' | 'available-thin' | 'broadcast-bold' | 'broadcast-thin' | 'calendar-bold' | 'calendar-thin' | 'camera-bold' | 'camera-thin' | 'cancel-bold' | 'cancel-thin' | 'challenge-bold' | 'challenge-thin' | 'chat-bold' | 'chatbot-bold' | 'chatbot-thin' | 'chat-fil-bold' | 'chat-fill-thin' | 'chat-smile-bold' | 'chat-smile-thin' | 'chat-thin' | 'check-bold' | 'check-thin' | 'chocolate-menu' | 'chronometer-bold' | 'chronometer-thin' | 'clock-bold' | 'clock-thin' | 'close-bold' | 'close-thin' | 'cloud-bold' | 'cloud-thin' | 'coin-bold' | 'coin-thin' | 'column-view-active-bold' | 'column-view-active-thin' | 'column-view-bold' | 'column-view-thin' | 'contacts-bold' | 'contacts-thin' | 'delete-bold' | 'delete-thin' | 'documents-bold' | 'documents-thin' | 'down-arrow' | 'download-bold' | 'download-thin' | 'downward-arrow-bold' | 'downward-arrow-thin' | 'duplicate-bold' | 'duplicate-thin' | 'eagle-bold' | 'eagle-thin' | 'edit-bold' | 'edit-thin' | 'emoji-bold' | 'emoji-thin' | 'family-bold' | 'family-thin' | 'filter-active-bold' | 'filter-active-thin' | 'filter-inactive-bold' | 'filter-inactive-thin' | 'filter' | 'forward-bold' | 'forward-thin' | 'goal-bold' | 'goal-thin' | 'grid-view-active-bold' | 'grid-view-active-thin' | 'grid-view-bold' | 'grid-view-thin' | 'group-bold' | 'group-brackets-bold' | 'group-brackets-thin' | 'group-fill-bold' | 'group-fill-thin' | 'group-thin' | 'guide-bold' | 'guide-thin' | 'health-bold' | 'health-thin' | 'heart-bold' | 'heart-fill-bold' | 'heart-fill-thin' | 'heart-thin' | 'humor-bold' | 'humor-thin' | 'inactive-bold' | 'inactive-thin' | 'indicator-bold' | 'indicator-thin' | 'info-bold' | 'info-thin' | 'integration-bold' | 'integration-thin' | 'learning-bold' | 'learning-thin' | 'leave-bold' | 'leave-thin' | 'left-arrow-large' | 'left-arrow-small' | 'like-bold' | 'like-fill-bold' | 'like-fill-thin' | 'like-thin' | 'magnifying-glass-bold' | 'magnifying-glass-thin' | 'minus' | 'more-vert' | 'mountain-bold' | 'mountain-thin' | 'new-document-bold' | 'new-document-thin' | 'new-tip-thin-1' | 'new-tip-thin' | 'notification-bold' | 'notification-thin' | 'objetive-bold' | 'objetive-thin' | 'order-bold-1' | 'order-bold' | 'order-thin-1' | 'order-thin' | 'performance-bold' | 'performance-thin' | 'phone-bold' | 'phone-thin' | 'plus' | 'quiz-bold' | 'quiz-thin' | 'raffle-bold' | 'raffle-draw-bold' | 'raffle-draw-thin' | 'raffle-thin' | 'relationship-bold' | 'relationship-thin' | 'reports-bold' | 'reports-thin' | 'right-arrow-large' | 'right-arrow-small' | 'send-bold' | 'send-thin' | 'settings-bold' | 'settings-thin' | 'star-bold' | 'star-thin' | 'store-bold' | 'store-item-bold' | 'store-item-thin' | 'store-thin' | 'tag-bold' | 'tag-thin' | 'test-bold' | 'test-thin' | 'tips-bold' | 'tips-thin' | 'tree-bold' | 'tree-thin' | 'trophy-bold' | 'trophy-thin' | 'up-arrow' | 'upload-bold' | 'upload-thin' | 'upward-arrow-bold' | 'upward-arrow-thin' | 'user-bold' | 'user-thin' | 'variable-pay-bold' | 'variable-pay-thin' | 'view-bold' | 'view-thin' | 'not-view-thin' | 'not-view-bold' | 'work-bold' | 'working' | 'work-thin' | 'no-results-found' | 'not-found-bold' | 'hamburger-menu';
|
|
87
89
|
|
|
88
90
|
class ThemeBaseRect {
|
|
89
91
|
top: string;
|
|
@@ -125,4 +125,15 @@ export class BaseRepository {
|
|
|
125
125
|
|
|
126
126
|
return config;
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
protected createAxiosCancelationContext(): void {
|
|
130
|
+
BaseRepository._source = axios.CancelToken.source();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
protected cancelAxiosRequest(): void {
|
|
134
|
+
if (BaseRepository._source) {
|
|
135
|
+
BaseRepository._source.cancel();
|
|
136
|
+
BaseRepository._source = null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
128
139
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GuidanceCategoryModel, GuidanceModel, GuidanceQueryListModel, HttpListResponse } from "../models";
|
|
2
|
+
|
|
3
|
+
export interface IGuidanceRepository {
|
|
4
|
+
getCategories(): Promise<GuidanceCategoryModel[]>;
|
|
5
|
+
getUserFiles(params: GuidanceQueryListModel): Promise<HttpListResponse<GuidanceModel[]>>;
|
|
6
|
+
toggleFavorite(id: string): Promise<void>;
|
|
7
|
+
getFavoriteUserFiles(params: GuidanceQueryListModel): Promise<HttpListResponse<GuidanceModel[]>>;
|
|
8
|
+
getUserFile(id: string): Promise<GuidanceModel>;
|
|
9
|
+
registerFileAccessToUser(guidanceId: string, fileId: string, imageToken: string): Promise<void>;
|
|
10
|
+
registerFileDownloadToUser(guidanceId: string, fileId: string, imageToken: string): Promise<void>;
|
|
11
|
+
}
|