Skip to content

Commit 5ff4ff6

Browse files
authored
Merge pull request #49 from SwapnilTechVariable/wip/banner-component
Demo Mode UI
2 parents a112d6f + 42c8e46 commit 5ff4ff6

30 files changed

Lines changed: 484 additions & 109 deletions

File tree

copy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cd /home/durga/Projects/TechV/Frontend/Project-Neptune
33
npm run distBuild
44

55
echo 'Deleting old files'
6-
rm -r /home/durga/Projects/TechV/Backend/NeptuneConnect/view/components/build*
6+
rm -r /home/durga/Projects/TechV/Backend/neptune_connect/view/components/build*
77

88
echo 'Moving files'
9-
cp -r /home/durga/Projects/TechV/Frontend/Project-Neptune/www/build* /home/durga/Projects/TechV/Backend/NeptuneConnect/view/components/build
9+
cp -r /home/durga/Projects/TechV/Frontend/Project-Neptune/www/build* /home/durga/Projects/TechV/Backend/neptune_connect/view/components/build

src/components.d.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ export namespace Components {
1919
"url": string;
2020
"users": string;
2121
}
22+
interface AsideContainer {
23+
}
2224
interface BackdropFilter {
2325
"backDropHandler": any;
2426
"showBackDrop": boolean;
2527
}
28+
interface BannerComponent {
29+
}
2630
interface BasicDropdown {
2731
"label": string;
2832
"optionHandler": any;
@@ -45,13 +49,16 @@ export namespace Components {
4549
"fetchNavigators": Function;
4650
"formatter": Function;
4751
"onClickRun": Function;
52+
"permissions": string;
4853
}
4954
interface CustomDropDown {
5055
"dropDownValue": string;
5156
"optionListProp": { label: string; selected: boolean; }[];
5257
"selectHandler": any;
5358
}
5459
interface DataTable {
60+
"canDeleteRow": boolean;
61+
"canEditRow": boolean;
5562
"columns": {
5663
id: number | string;
5764
key: string;
@@ -128,9 +135,11 @@ export namespace Components {
128135
"doc": any;
129136
}
130137
interface EditorPage {
138+
"permissions": string;
131139
"url": string;
132140
}
133141
interface EditorRes {
142+
"permissions": string;
134143
}
135144
interface FluidContainer {
136145
}
@@ -168,6 +177,7 @@ export namespace Components {
168177
}
169178
interface InsertNodeModal {
170179
"fetchNavigators": Function;
180+
"permissions": string;
171181
}
172182
interface InviteComponent {
173183
"apiurl": string;
@@ -194,6 +204,13 @@ export namespace Components {
194204
"headerList": object[];
195205
"rowPerPage": number[];
196206
}
207+
interface LoginForm {
208+
"email": string;
209+
"error": string;
210+
"mode": string;
211+
"password": string;
212+
"url": string;
213+
}
197214
interface LogsTable {
198215
"clearSearch": any;
199216
"currentPage": number;
@@ -266,6 +283,7 @@ export namespace Components {
266283
"width": 'full' | 'auto';
267284
}
268285
interface ProfileComponent {
286+
"permissions": string;
269287
"stringifieduser": string;
270288
"url": string;
271289
}
@@ -298,6 +316,7 @@ export namespace Components {
298316
"url": string;
299317
}
300318
interface TabComponent {
319+
"permissions": string;
301320
}
302321
interface TableSearchModalForm {
303322
"alias": string;
@@ -361,12 +380,24 @@ declare global {
361380
prototype: HTMLAllUsersElement;
362381
new (): HTMLAllUsersElement;
363382
};
383+
interface HTMLAsideContainerElement extends Components.AsideContainer, HTMLStencilElement {
384+
}
385+
var HTMLAsideContainerElement: {
386+
prototype: HTMLAsideContainerElement;
387+
new (): HTMLAsideContainerElement;
388+
};
364389
interface HTMLBackdropFilterElement extends Components.BackdropFilter, HTMLStencilElement {
365390
}
366391
var HTMLBackdropFilterElement: {
367392
prototype: HTMLBackdropFilterElement;
368393
new (): HTMLBackdropFilterElement;
369394
};
395+
interface HTMLBannerComponentElement extends Components.BannerComponent, HTMLStencilElement {
396+
}
397+
var HTMLBannerComponentElement: {
398+
prototype: HTMLBannerComponentElement;
399+
new (): HTMLBannerComponentElement;
400+
};
370401
interface HTMLBasicDropdownElement extends Components.BasicDropdown, HTMLStencilElement {
371402
}
372403
var HTMLBasicDropdownElement: {
@@ -529,6 +560,12 @@ declare global {
529560
prototype: HTMLLogTableWrapperElement;
530561
new (): HTMLLogTableWrapperElement;
531562
};
563+
interface HTMLLoginFormElement extends Components.LoginForm, HTMLStencilElement {
564+
}
565+
var HTMLLoginFormElement: {
566+
prototype: HTMLLoginFormElement;
567+
new (): HTMLLoginFormElement;
568+
};
532569
interface HTMLLogsTableElement extends Components.LogsTable, HTMLStencilElement {
533570
}
534571
var HTMLLogsTableElement: {
@@ -700,7 +737,9 @@ declare global {
700737
interface HTMLElementTagNameMap {
701738
"add-role": HTMLAddRoleElement;
702739
"all-users": HTMLAllUsersElement;
740+
"aside-container": HTMLAsideContainerElement;
703741
"backdrop-filter": HTMLBackdropFilterElement;
742+
"banner-component": HTMLBannerComponentElement;
704743
"basic-dropdown": HTMLBasicDropdownElement;
705744
"basic-settings": HTMLBasicSettingsElement;
706745
"check-box": HTMLCheckBoxElement;
@@ -728,6 +767,7 @@ declare global {
728767
"loader-component": HTMLLoaderComponentElement;
729768
"log-page": HTMLLogPageElement;
730769
"log-table-wrapper": HTMLLogTableWrapperElement;
770+
"login-form": HTMLLoginFormElement;
731771
"logs-table": HTMLLogsTableElement;
732772
"logs-table-component": HTMLLogsTableComponentElement;
733773
"menu-drop-down": HTMLMenuDropDownElement;
@@ -772,10 +812,14 @@ declare namespace LocalJSX {
772812
"url"?: string;
773813
"users"?: string;
774814
}
815+
interface AsideContainer {
816+
}
775817
interface BackdropFilter {
776818
"backDropHandler"?: any;
777819
"showBackDrop"?: boolean;
778820
}
821+
interface BannerComponent {
822+
}
779823
interface BasicDropdown {
780824
"label"?: string;
781825
"optionHandler"?: any;
@@ -798,13 +842,16 @@ declare namespace LocalJSX {
798842
"fetchNavigators"?: Function;
799843
"formatter"?: Function;
800844
"onClickRun"?: Function;
845+
"permissions"?: string;
801846
}
802847
interface CustomDropDown {
803848
"dropDownValue"?: string;
804849
"optionListProp"?: { label: string; selected: boolean; }[];
805850
"selectHandler"?: any;
806851
}
807852
interface DataTable {
853+
"canDeleteRow"?: boolean;
854+
"canEditRow"?: boolean;
808855
"columns"?: {
809856
id: number | string;
810857
key: string;
@@ -881,9 +928,11 @@ declare namespace LocalJSX {
881928
"doc"?: any;
882929
}
883930
interface EditorPage {
931+
"permissions"?: string;
884932
"url"?: string;
885933
}
886934
interface EditorRes {
935+
"permissions"?: string;
887936
}
888937
interface FluidContainer {
889938
}
@@ -921,6 +970,7 @@ declare namespace LocalJSX {
921970
}
922971
interface InsertNodeModal {
923972
"fetchNavigators"?: Function;
973+
"permissions"?: string;
924974
}
925975
interface InviteComponent {
926976
"apiurl"?: string;
@@ -947,6 +997,13 @@ declare namespace LocalJSX {
947997
"headerList"?: object[];
948998
"rowPerPage"?: number[];
949999
}
1000+
interface LoginForm {
1001+
"email"?: string;
1002+
"error"?: string;
1003+
"mode"?: string;
1004+
"password"?: string;
1005+
"url"?: string;
1006+
}
9501007
interface LogsTable {
9511008
"clearSearch"?: any;
9521009
"currentPage"?: number;
@@ -1019,6 +1076,7 @@ declare namespace LocalJSX {
10191076
"width"?: 'full' | 'auto';
10201077
}
10211078
interface ProfileComponent {
1079+
"permissions"?: string;
10221080
"stringifieduser"?: string;
10231081
"url"?: string;
10241082
}
@@ -1051,6 +1109,7 @@ declare namespace LocalJSX {
10511109
"url"?: string;
10521110
}
10531111
interface TabComponent {
1112+
"permissions"?: string;
10541113
}
10551114
interface TableSearchModalForm {
10561115
"alias"?: string;
@@ -1103,7 +1162,9 @@ declare namespace LocalJSX {
11031162
interface IntrinsicElements {
11041163
"add-role": AddRole;
11051164
"all-users": AllUsers;
1165+
"aside-container": AsideContainer;
11061166
"backdrop-filter": BackdropFilter;
1167+
"banner-component": BannerComponent;
11071168
"basic-dropdown": BasicDropdown;
11081169
"basic-settings": BasicSettings;
11091170
"check-box": CheckBox;
@@ -1131,6 +1192,7 @@ declare namespace LocalJSX {
11311192
"loader-component": LoaderComponent;
11321193
"log-page": LogPage;
11331194
"log-table-wrapper": LogTableWrapper;
1195+
"login-form": LoginForm;
11341196
"logs-table": LogsTable;
11351197
"logs-table-component": LogsTableComponent;
11361198
"menu-drop-down": MenuDropDown;
@@ -1167,7 +1229,9 @@ declare module "@stencil/core" {
11671229
interface IntrinsicElements {
11681230
"add-role": LocalJSX.AddRole & JSXBase.HTMLAttributes<HTMLAddRoleElement>;
11691231
"all-users": LocalJSX.AllUsers & JSXBase.HTMLAttributes<HTMLAllUsersElement>;
1232+
"aside-container": LocalJSX.AsideContainer & JSXBase.HTMLAttributes<HTMLAsideContainerElement>;
11701233
"backdrop-filter": LocalJSX.BackdropFilter & JSXBase.HTMLAttributes<HTMLBackdropFilterElement>;
1234+
"banner-component": LocalJSX.BannerComponent & JSXBase.HTMLAttributes<HTMLBannerComponentElement>;
11711235
"basic-dropdown": LocalJSX.BasicDropdown & JSXBase.HTMLAttributes<HTMLBasicDropdownElement>;
11721236
"basic-settings": LocalJSX.BasicSettings & JSXBase.HTMLAttributes<HTMLBasicSettingsElement>;
11731237
"check-box": LocalJSX.CheckBox & JSXBase.HTMLAttributes<HTMLCheckBoxElement>;
@@ -1195,6 +1259,7 @@ declare module "@stencil/core" {
11951259
"loader-component": LocalJSX.LoaderComponent & JSXBase.HTMLAttributes<HTMLLoaderComponentElement>;
11961260
"log-page": LocalJSX.LogPage & JSXBase.HTMLAttributes<HTMLLogPageElement>;
11971261
"log-table-wrapper": LocalJSX.LogTableWrapper & JSXBase.HTMLAttributes<HTMLLogTableWrapperElement>;
1262+
"login-form": LocalJSX.LoginForm & JSXBase.HTMLAttributes<HTMLLoginFormElement>;
11981263
"logs-table": LocalJSX.LogsTable & JSXBase.HTMLAttributes<HTMLLogsTableElement>;
11991264
"logs-table-component": LocalJSX.LogsTableComponent & JSXBase.HTMLAttributes<HTMLLogsTableComponentElement>;
12001265
"menu-drop-down": LocalJSX.MenuDropDown & JSXBase.HTMLAttributes<HTMLMenuDropDownElement>;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:host {
2+
display: block;
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Component, h } from '@stencil/core';
2+
3+
@Component({
4+
tag: 'aside-container',
5+
styleUrl: 'aside-container.css',
6+
scoped: true,
7+
})
8+
export class AsideContainer {
9+
10+
render() {
11+
return (
12+
<div class='w-full md:w-80 md:mb-4 '>
13+
<slot></slot>
14+
</div>
15+
);
16+
}
17+
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# aside-container
2+
3+
4+
5+
<!-- Auto Generated Below -->
6+
7+
8+
----------------------------------------------
9+
10+
*Built with [StencilJS](https://stenciljs.com/)*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:host {
2+
display: block;
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Component, Host, h } from '@stencil/core';
2+
3+
@Component({
4+
tag: 'banner-component',
5+
styleUrl: 'banner-component.css',
6+
scoped: true,
7+
})
8+
export class BannerComponent {
9+
render() {
10+
return (
11+
<Host>
12+
<div id="banner" tabindex="-1" class="py-1.5 w-full bg-indigo-100 flex z-50 gap-4 justify-center items-start border border-b border-indigo-200 sm:items-center dark:border-gray-700 dark:bg-gray-800">
13+
<p class="w-5/6 text-center text-lg text-indigo-600 font-medium ">You are in <span class="font-semibold">DEMO</span> mode, the database is in read only mode</p>
14+
</div>
15+
</Host>
16+
);
17+
}
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# banner-component
2+
3+
4+
5+
<!-- Auto Generated Below -->
6+
7+
8+
----------------------------------------------
9+
10+
*Built with [StencilJS](https://stenciljs.com/)*

src/components/common/items/data-table/data-table.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ export class DataTable {
9999
@Prop() data: Array<any> = [];
100100
@State() processedData: Array<any> = [];
101101
@Prop() showActions: boolean = false;
102+
@Prop() canEditRow: boolean = false;
103+
@Prop() canDeleteRow: boolean = false;
102104
@Prop() onEdit: (id: number | string, changes: Array<{ prevValue: number | Date | string; newValue: number | Date | string; name: string }>) => Promise<any>;
103105
@Prop() onDelete: (index: number, row: { [field: string]: number | Date | string }) => Promise<any>;
104106
@Prop() onPaginate: (tcurrentPage: number, limit: number) => Promise<void>;
@@ -283,8 +285,8 @@ export class DataTable {
283285
if (!this.isEditing)
284286
return (
285287
<td class={`py-3 whitespace-nowrap text-sm text-gray-900 ${column.customStyle?.cellClass}`} style={{ cursor: 'auto', ...(column.customStyle?.cellStyle || {}) }}>
286-
{getEditingButton()}
287-
{getDeleteButton()}
288+
{getEditingButton(!this.canEditRow)}
289+
{getDeleteButton(!this.canDeleteRow)}
288290
</td>
289291
);
290292

0 commit comments

Comments
 (0)