这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged

Rc #1179

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
ded35e0
Merge branch 'main' of https://github.com/htuerker/rowy into feat/for…
Sep 26, 2022
9e6c092
Merge branch 'develop' of https://github.com/htuerker/rowy into feat/…
Sep 26, 2022
355648e
feat(formula-field): add formula field draft
Sep 26, 2022
16fef73
Merge branch 'develop' of https://github.com/htuerker/rowy into feat/…
Nov 15, 2022
c361d2f
Merge branch 'feature/rowy-706-table-upgrade' of https://github.com/r…
Nov 15, 2022
d4343ce
update to new table system
Nov 16, 2022
8e899da
enable derivatives logging in code editor
bofeiw Nov 21, 2022
5baa638
enable actions logging in code editor
bofeiw Nov 23, 2022
0f92fbb
Merge branch 'develop' into feature/functions-logging
bofeiw Nov 23, 2022
74852a8
fix action/derivative type hint issue
bofeiw Nov 23, 2022
cc2b860
enable connectors logging in code editor
bofeiw Nov 23, 2022
7fb8860
worked on issue #562
iamanishroy Nov 23, 2022
35a173f
enable webhooks logging in code editor
bofeiw Nov 23, 2022
8c490a4
worked on issue #562
iamanishroy Nov 24, 2022
58856c7
Merge branch 'anishroy' of https://github.com/iamanishroy/rowy into d…
shamsmosowi Nov 25, 2022
3a57d6e
added reordering feature to the hidden fields menu
iamanishroy Nov 25, 2022
9c312bb
added comment
iamanishroy Nov 25, 2022
9bfe324
HiddenFields2 to HiddenFields
iamanishroy Nov 25, 2022
2c206d2
enable logging in extensions code editor
bofeiw Nov 27, 2022
ea873d4
Merge branch 'develop' into feature/functions-logging
bofeiw Nov 27, 2022
2fc323e
Update src/components/TableToolbar/HiddenFields.tsx
notsidney Nov 28, 2022
966e1d6
Merge branch 'rowyio:develop' into develop
iamanishroy Nov 29, 2022
4949a50
Merge branch 'develop' into feature/functions-logging
bofeiw Dec 2, 2022
aaa0392
Merge branch 'develop' of https://github.com/rowyio/rowy into feat/fo…
htuerker Dec 8, 2022
d7801a1
add output field to formula field
htuerker Dec 8, 2022
30a5630
add listener fields
htuerker Dec 8, 2022
065484a
add rowy loggin tab
bofeiw Dec 8, 2022
bd4a979
Merge branch 'rowyio:develop' into develop
iamanishroy Dec 9, 2022
11d2635
fix function body extracter
Dec 10, 2022
8747ffd
rowy logging ui implementation
bofeiw Dec 10, 2022
3b91bf9
add editor diagnostics
Dec 11, 2022
77beb42
Feat: add reordering of Select and Multiselect field option
saravanan-inc Dec 13, 2022
f53c9ef
Modified default/empty hook and extension settings
mshamsrainey Dec 13, 2022
430833c
bug fix: small blip in the ordering
iamanishroy Dec 17, 2022
9aef2cf
revalidate cache
iamanishroy Dec 17, 2022
4bde3ce
fix empty formula function
Dec 18, 2022
f6e53f6
update formula field icon
Dec 18, 2022
2b17953
add snackbar message to ask for more rowy run memory allocation if ev…
bofeiw Dec 18, 2022
063295a
Merge branch 'develop' of https://github.com/rowyio/rowy into develop
shamsmosowi Dec 21, 2022
8b1d2f3
Merge branch 'rc' into develop
shamsmosowi Dec 21, 2022
dd59eb3
Merge branch 'main' into develop
shamsmosowi Dec 21, 2022
5771931
Merge branch 'develop' into ROWY-766-webhook-defaults
shamsmosowi Dec 23, 2022
a5fda7a
Merge pull request #1015 from mshamsrainey/ROWY-766-webhook-defaults
shamsmosowi Dec 23, 2022
f89e0e1
add,remove,edit columns
shamsmosowi Dec 23, 2022
f9abf4b
show a snackbar error when firestore pemission rejects a change
iamanishroy Dec 25, 2022
65fabca
feat(formula-field): fix error state
Dec 25, 2022
8915bb7
Merge pull request #1026 from rowyio/feature/better-derivative-failur…
shamsmosowi Dec 26, 2022
2f84295
Merge pull request #1036 from rowyio/table-lvl-admin
shamsmosowi Dec 26, 2022
a5e3303
feat(formula-field): fix function regexp, expand listener fields
Dec 26, 2022
313b24e
Merge branch 'develop' into feat/formula-field
shamsmosowi Dec 26, 2022
5a3841e
Merge pull request #949 from rowyio/feat/formula-field
shamsmosowi Dec 26, 2022
c3c7a85
Merge pull request #1040 from rowyio/develop
shamsmosowi Dec 27, 2022
072686b
expand rowy logging into tabs: extension, webhook, column(derivative/…
bofeiw Dec 28, 2022
28f6ea5
column logs: only allow logging view for connector/action/default val…
bofeiw Dec 29, 2022
503dae7
auto refresh when switching log tabs
bofeiw Dec 29, 2022
2959741
add back old functions logging
bofeiw Dec 29, 2022
4e96c5b
fix load more not working
bofeiw Dec 29, 2022
9b7a31f
worked on adding "Import JSON feat"
iamanishroy Dec 30, 2022
305d47d
reuse Rowy rowy loggin types
bofeiw Dec 30, 2022
f86d67a
Merge branch 'develop' into feature/functions-logging
bofeiw Dec 30, 2022
6d81bbf
Merge pull request #1010 from rowyio/feature/functions-logging
shamsmosowi Dec 30, 2022
5fad802
fix: column names are only determined by the first row
iamanishroy Dec 30, 2022
58d02c2
add table path filter to logging
bofeiw Dec 30, 2022
8c36459
ignore id column
iamanishroy Dec 31, 2022
5b49964
optimistic updates with useFirestoreDocWithAtom
iamanishroy Dec 31, 2022
d7a4cdf
added required dependencies
iamanishroy Dec 31, 2022
e754b25
disable drag if user does not have permission
iamanishroy Dec 31, 2022
fed06b3
let -> const
iamanishroy Dec 31, 2022
4264e24
Merge pull request #1042 from iamanishroy/feat-import-json
shamsmosowi Dec 31, 2022
c914097
Merge pull request #1023 from iamanishroy/develop
shamsmosowi Dec 31, 2022
d480db1
Merge pull request #1044 from rowyio/fix/logging-filter
shamsmosowi Dec 31, 2022
7459731
Merge pull request #1043 from rowyio/develop
shamsmosowi Dec 31, 2022
c439b35
log alert
shamsmosowi Jan 1, 2023
6845e33
fix broken atom
Jan 2, 2023
355a8b2
Merge pull request #1048 from rowyio/fix/broken-atom
shamsmosowi Jan 2, 2023
4383181
Merge pull request #1049 from rowyio/develop
shamsmosowi Jan 2, 2023
e59a10c
worked on copy/paste feature
iamanishroy Jan 4, 2023
c665baf
added json support
iamanishroy Jan 4, 2023
0675ddc
better error message
iamanishroy Jan 4, 2023
d80815f
feat(ROWY-831): add preview table
Jan 3, 2023
6bfaae0
fix side effect causing crash
Jan 3, 2023
df2e7d2
fix filter condition
Jan 3, 2023
c1d5c21
fix: prevent redirecting to link when deleting file (#1047)
jyash97 Jan 5, 2023
6717a0f
Merge pull request #1057 from rowyio/ROWY-864-fix-table-crash
shamsmosowi Jan 5, 2023
a48088c
#ROWY-763: Select all option in CSV import
mshamsrainey Jan 6, 2023
f803a3a
fix table crashing, for filtered group collections
shamsmosowi Jan 6, 2023
d4a41b7
update error message
shamsmosowi Jan 6, 2023
3360103
Merge pull request #1059 from rowyio/develop
shamsmosowi Jan 6, 2023
ebc5967
null check on .some functions
bofeiw Jan 6, 2023
f7cce06
requires cloud function setup before creating related columns
bofeiw Jan 6, 2023
7be0755
consistent "require cloud function" text on both default values and c…
bofeiw Jan 6, 2023
f1531a5
#ROWY-763: Select all for Airtable wizard, format
mshamsrainey Jan 6, 2023
c726e78
getting subtable schema
iamanishroy Jan 7, 2023
f28ca3e
import subtables
iamanishroy Jan 7, 2023
818759e
Bump json5 from 1.0.1 to 1.0.2
dependabot[bot] Jan 8, 2023
afbd8f4
removed logs
iamanishroy Jan 8, 2023
d9a1393
update code template style and indentation
bofeiw Jan 9, 2023
155caa9
Merge pull request #1060 from rowyio/fix/undefined-some-function
shamsmosowi Jan 9, 2023
6ff51fe
fix: optimistic update (#1052)
iamanishroy Jan 9, 2023
b80c806
Merge pull request #1070 from rowyio/feature/code-templates-comments-…
shamsmosowi Jan 11, 2023
ac6c60b
Merge pull request #1054 from iamanishroy/feat-copy-paste-kb-shortcut
shamsmosowi Jan 11, 2023
68fbd11
Merge pull request #1067 from rowyio/dependabot/npm_and_yarn/json5-1.0.2
shamsmosowi Jan 11, 2023
d3312d8
Merge pull request #1062 from mshamsrainey/import-wizard-select-all
shamsmosowi Jan 11, 2023
f1e309a
Merge pull request #1061 from rowyio/feature/requrie-rowy-run-to-crea…
shamsmosowi Jan 11, 2023
9d4161e
Merge pull request #1066 from iamanishroy/feat-support-copying-subtables
shamsmosowi Jan 11, 2023
455982c
Merge pull request #1074 from rowyio/develop
shamsmosowi Jan 11, 2023
5ce182a
Fix: copy/paste is picking up all fields in a subtable as subtable type
iamanishroy Jan 14, 2023
1ee76fa
renaming/ cleaning
iamanishroy Jan 14, 2023
b34add1
fix: reordering of Select and Multiselect field option
saravanan-inc Jan 7, 2023
45ab7ab
add value formatter to reference field filter
shamsmosowi Jan 16, 2023
9845477
allow derivatives to be filterable from context menu
shamsmosowi Jan 16, 2023
b63d273
Merge pull request #1080 from iamanishroy/feat-copy-paste-kb-shortcut
shamsmosowi Jan 16, 2023
3097763
Merge pull request #1082 from rowyio/develop
shamsmosowi Jan 16, 2023
35e4d5f
enable filter from column menu for derivatives
shamsmosowi Jan 16, 2023
5ea4323
Merge branch 'develop' into rc
shamsmosowi Jan 16, 2023
507304d
Merge pull request #1012 from saravanan-inc/reorderSelectMultiSelectF…
shamsmosowi Jan 16, 2023
d55846e
add auth and storage to webhook parser
shamsmosowi Jan 16, 2023
3b715d3
worked on making cards fully clickable
iamanishroy Jan 18, 2023
24dc2a1
link for action scripts
shamsmosowi Jan 19, 2023
a630220
Merge pull request #1084 from iamanishroy/fully-clickable-card
shamsmosowi Jan 19, 2023
8474668
Merge pull request #1086 from rowyio/develop
shamsmosowi Jan 19, 2023
0e3fbaa
add default logging statements to all code templates
bofeiw Jan 21, 2023
3e0b429
Updated link in create table
iamanishroy Jan 22, 2023
3ba7b0d
fixed numbers getting inverted
iamanishroy Jan 22, 2023
6f43992
Merge pull request #1088 from rowyio/feature/default-logging-statements
shamsmosowi Jan 23, 2023
6dd76a1
Merge pull request #1089 from iamanishroy/ui-update
shamsmosowi Jan 25, 2023
d4f2c70
editable user column
iamanishroy Jan 26, 2023
502553c
add npm usage examples to code templates
bofeiw Jan 26, 2023
19867b6
worked on backward compatibility
iamanishroy Jan 28, 2023
8eadc91
feat: add image reorder user interface
Feb 1, 2023
cc54ae2
worked on saving table sorts
iamanishroy Feb 1, 2023
f82075c
applied on column menu
iamanishroy Feb 1, 2023
e66bdf9
#ROWY-851: Centered sign out screen
mshamsrainey Feb 1, 2023
0603c1f
fix javascript floating point error in percentage field
bofeiw Feb 3, 2023
cd65a5c
variable name changed
iamanishroy Feb 4, 2023
9758cc2
Merge pull request #1108 from rowyio/fix/percentage-precision-error
shamsmosowi Feb 6, 2023
1d6b586
Merge pull request #1105 from mshamsrainey/851-center-align-signout
shamsmosowi Feb 6, 2023
72dab1f
Merge pull request #1097 from rowyio/feature/code-editor-npm-examples
shamsmosowi Feb 6, 2023
d655c26
feat: add image reorder functionality
Feb 6, 2023
ebb9d64
removed info icon
iamanishroy Feb 7, 2023
2c77eeb
feat: add drag and drop to file field
Feb 8, 2023
3902111
Merge branch 'reorderImageFileField' of https://github.com/saravanan-…
Feb 8, 2023
d621afc
Added new filed ARRAY
iamanishroy Feb 11, 2023
1464b63
date-time detect fix
iamanishroy Feb 11, 2023
f9b54d7
set common format for import export of date/time
iamanishroy Feb 13, 2023
6a947c6
removed unwanted imports
iamanishroy Feb 13, 2023
98b316e
detect type fixes
iamanishroy Feb 14, 2023
0febee0
hide unneccessary fields
Feb 15, 2023
00a76bb
fix clone object error
Feb 15, 2023
7a99cb9
Merge pull request #1056 from rowyio/ROWY-831-preview-table
shamsmosowi Feb 15, 2023
0bde7dc
Merge pull request #1118 from iamanishroy/import-export-csv-fixes
shamsmosowi Feb 17, 2023
571f60f
Merge pull request #1119 from iamanishroy/update-info-panel
shamsmosowi Feb 17, 2023
9527511
Merge pull request #1116 from iamanishroy/new-field-array
shamsmosowi Feb 17, 2023
ebb8b85
Update index.tsx
shamsmosowi Feb 17, 2023
36bd687
Merge pull request #1096 from iamanishroy/feat-editable-user-column
shamsmosowi Feb 17, 2023
9163a71
Merge pull request #1124 from rowyio/develop
shamsmosowi Feb 17, 2023
845c141
refactor: hide the drag and drop icon when there's only one image and…
Feb 18, 2023
e41e481
add support for reordering in the sidedrawer
Feb 18, 2023
e26949a
parse array values
iamanishroy Feb 18, 2023
c8d340e
number/date fix
iamanishroy Feb 18, 2023
818fc52
save default sort for the user
iamanishroy Feb 21, 2023
11c331b
Merge pull request #1127 from iamanishroy/import-export-csv-fixes
shamsmosowi Feb 22, 2023
55bd670
Merge pull request #1126 from iamanishroy/fix/import-json
shamsmosowi Feb 22, 2023
a160407
Merge pull request #1103 from iamanishroy/save-sort-on-update
shamsmosowi Feb 22, 2023
eee88d9
Merge pull request #1112 from saravanan-inc/reorderImageFileField
shamsmosowi Feb 22, 2023
0bec338
Merge pull request #1130 from rowyio/develop
shamsmosowi Feb 22, 2023
f756f1f
allow multiple params for logging
bofeiw Feb 23, 2023
cf569c1
fixed: bug on clearing value
iamanishroy Feb 23, 2023
e5f0cbd
remove not required console logs
iamanishroy Feb 23, 2023
0b82b6d
Merge pull request #1133 from iamanishroy/save-sort-on-update
shamsmosowi Feb 23, 2023
b43efea
Merge pull request #1132 from iamanishroy/feat-editable-user-column
shamsmosowi Feb 23, 2023
4bbe1e9
Merge pull request #1131 from rowyio/feature/logging-multi-params
shamsmosowi Feb 23, 2023
eef7edb
Merge pull request #1134 from rowyio/develop
shamsmosowi Feb 24, 2023
869763c
add ref object to worker context
Feb 26, 2023
e48d063
bug fix: infinite rendering
iamanishroy Feb 26, 2023
eafb209
added comments
iamanishroy Feb 26, 2023
2301718
Merge pull request #1139 from iamanishroy/save-sort-on-update
shamsmosowi Feb 26, 2023
276033e
Merge pull request #1136 from rowyio/ROWY-969-formula-field-add-ref-t…
shamsmosowi Feb 26, 2023
189b106
Merge pull request #1140 from rowyio/develop
shamsmosowi Feb 26, 2023
6b136b0
add code action: replace console.log with logging.log
bofeiw Feb 27, 2023
1150871
Merge pull request #1141 from rowyio/feature/code-action-consolelog
shamsmosowi Mar 1, 2023
f36adf2
fix(preview-table): fix table sort bug
Mar 1, 2023
d02d72f
feat(preview-table): add serialized ref including parent recursively
Mar 2, 2023
0987499
Merge pull request #1144 from rowyio/ROWY-962-ROWY-976-preview-table
shamsmosowi Mar 2, 2023
efce39a
added custom hook [to be tested]
iamanishroy Mar 7, 2023
2ef0255
Merge pull request #1148 from iamanishroy/fix-resizing-app-crash
shamsmosowi Mar 10, 2023
9382d8c
Merge pull request #1158 from rowyio/develop
shamsmosowi Mar 13, 2023
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
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ to start.
## Working on existing issues



Before you get started working on an [issue](https://github.com/rowyio/rowy/issues), please make sure to share that you are working on it by commenting on the issue and posting a message on #contributions channel in Rowy's [Discord](https://discord.com/invite/fjBugmvzZP). The maintainers will then assign the issue to you after making sure any relevant information or context in addition is provided before you can start on the task.

Once you are assigned a task, please provide periodic updates or share any questions or roadblocks on either discord or the Github issue, so that the commmunity or the project maintainers can provide you any feedback or guidance as needed. If you are inactive for more than 1-2 week on a issue that was assigned to you, then we will assume you have stopped working on it and we will unassign it from you - so that we can give a chance to others in the community to work on it.
Expand Down
4 changes: 2 additions & 2 deletions src/atoms/projectScope/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const tablesAtom = atom<TableSettings[]>((get) => {
return sortBy(tables, "name")
.filter((table) =>
userRoles.includes("ADMIN") || Array.isArray(table.roles)
? table.roles.some((role) => userRoles.includes(role))
? table.roles?.some((role) => userRoles.includes(role))
: false
)
.map((table) => ({
Expand Down Expand Up @@ -105,7 +105,7 @@ export const deleteTableAtom = atom<

/** Stores a function to get a table’s schema doc (without listener) */
export const getTableSchemaAtom = atom<
((id: string) => Promise<TableSchema>) | undefined
((id: string, withSubtables?: boolean) => Promise<TableSchema>) | undefined
>(undefined);

/** Roles used in the project based on table settings */
Expand Down
2 changes: 0 additions & 2 deletions src/atoms/projectScope/rowyRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const rowyRunAtom = atom((get) => {
handleNotSetUp,
}: IRowyRunRequestProps): Promise<Response | any | false> => {
if (!currentUser) {
console.log("Rowy Run: Not signed in", route.path);
if (handleNotSetUp) handleNotSetUp();
return false;
}
Expand All @@ -85,7 +84,6 @@ export const rowyRunAtom = atom((get) => {
? rowyRunServices?.[service]
: rowyRunUrl;
if (!serviceUrl) {
console.log("Rowy Run: Not set up", route.path);
if (handleNotSetUp) handleNotSetUp();
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/projectScope/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const tableSettingsDialogSchemaAtom = atom(async (get) => {
const tableId = get(tableSettingsDialogIdAtom);
const getTableSchema = get(getTableSchemaAtom);
if (!tableId || !getTableSchema) return {} as TableSchema;
return getTableSchema(tableId);
return getTableSchema(tableId, true);
});

/** Open the Get Started checklist from anywhere */
Expand Down
10 changes: 6 additions & 4 deletions src/atoms/tableScope/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const tableRowsDbAtom = atom<TableRow[]>([]);

/** Combine tableRowsLocal and tableRowsDb */
export const tableRowsAtom = atom<TableRow[]>((get) => {
const rowsDb = [...get(tableRowsDbAtom)];
const rowsDb = get(tableRowsDbAtom);
const rowsLocal = get(tableRowsLocalAtom);

// Optimization: create Map of rowsDb by path to index for faster lookup
Expand All @@ -178,15 +178,17 @@ export const tableRowsAtom = atom<TableRow[]>((get) => {
if (rowsDbMap.has(row._rowy_ref.path)) {
const index = rowsDbMap.get(row._rowy_ref.path)!;
const merged = updateRowData({ ...rowsDb[index] }, row);
rowsDb.splice(index, 1);
rowsDbMap.delete(row._rowy_ref.path);
return merged;
}

return row;
});

// Merge the two arrays
return [...rowsLocalToMerge, ...rowsDb];
return [
...rowsLocalToMerge,
...rowsDb.filter((row) => rowsDbMap.has(row._rowy_ref.path)),
];
});

/** Store next page state for infinite scroll */
Expand Down
16 changes: 14 additions & 2 deletions src/atoms/tableScope/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export type ImportAirtableData = { records: Record<string, any>[] };

/** Store import CSV popover and wizard state */
export const importCsvAtom = atom<{
importType: "csv" | "tsv";
importType: "csv" | "tsv" | "json";
csvData: ImportCsvData | null;
}>({ importType: "csv", csvData: null });

Expand Down Expand Up @@ -142,14 +142,26 @@ export const selectedCellAtom = atom<SelectedCell | null>(null);
export const contextMenuTargetAtom = atom<HTMLElement | null>(null);

export type CloudLogFilters = {
type: "webhook" | "functions" | "audit" | "build";
type: "extension" | "webhook" | "column" | "audit" | "build" | "functions";
timeRange:
| { type: "seconds" | "minutes" | "hours" | "days"; value: number }
| { type: "range"; start: Date; end: Date };
severity?: Array<keyof typeof SEVERITY_LEVELS>;
webhook?: string[];
extension?: string[];
column?: string[];
auditRowId?: string;
buildLogExpanded?: number;
functionType?: (
| "connector"
| "derivative-script"
| "action"
| "derivative-function"
| "extension"
| "defaultValue"
| "hooks"
)[];
loggingSource?: ("backend-scripts" | "backend-function" | "hooks")[];
};
/** Store cloud log modal filters in URL */
export const cloudLogFiltersAtom = atomWithHash<CloudLogFilters>(
Expand Down
38 changes: 37 additions & 1 deletion src/components/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import Editor, { EditorProps } from "@monaco-editor/react";
import Editor, { EditorProps, Monaco } from "@monaco-editor/react";
import type { editor } from "monaco-editor/esm/vs/editor/editor.api";

import { useTheme, Box, BoxProps, AppBar, Toolbar } from "@mui/material";
Expand Down Expand Up @@ -72,6 +72,36 @@ export default function CodeEditor({
onValidate?.(markers);
};

const validate = (monaco: Monaco, model: editor.ITextModel) => {
const markers = [];
for (let i = 1; i < model.getLineCount() + 1; i++) {
const range = {
startLineNumber: i,
startColumn: 1,
endLineNumber: i,
endColumn: model.getLineLength(i) + 1,
};
const line = model.getValueInRange(range);
for (const keyword of ["console.log", "console.warn", "console.error"]) {
const consoleLogIndex = line.indexOf(keyword);
if (consoleLogIndex >= 0) {
markers.push({
message: `Replace with ${keyword.replace(
"console",
"logging"
)}: Rowy Cloud Logging provides a better experience to view logs. Simply replace 'console' with 'logging'. \n\nhttps://docs.rowy.io/cloud-logs`,
severity: monaco.MarkerSeverity.Warning,
startLineNumber: range.startLineNumber,
endLineNumber: range.endLineNumber,
startColumn: consoleLogIndex + 1,
endColumn: consoleLogIndex + keyword.length + 1,
});
}
}
}
monaco.editor.setModelMarkers(model, "owner", markers);
};

return (
<TrapFocus open={fullScreen}>
<Box
Expand All @@ -94,6 +124,12 @@ export default function CodeEditor({
beforeMount={(monaco) => {
monaco.editor.defineTheme("github-light", githubLightTheme as any);
monaco.editor.defineTheme("github-dark", githubDarkTheme as any);
monaco.editor.onDidCreateModel((model) => {
validate(monaco, model);
model.onDidChangeContent(() => {
validate(monaco, model);
});
});
}}
onMount={(editor) => {
if (onFocus) editor.onDidFocusEditorWidget(onFocus);
Expand Down
96 changes: 56 additions & 40 deletions src/components/CodeEditor/CodeEditorHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { projectScope, projectIdAtom } from "@src/atoms/projectScope";

export interface ICodeEditorHelperProps {
docLink: string;
disableDefaultVariables?: boolean;
disableSecretManagerLink?: boolean;
disableCloudManagerLink?: boolean;
additionalVariables?: {
key: string;
description: string;
Expand All @@ -17,28 +20,37 @@ export interface ICodeEditorHelperProps {

export default function CodeEditorHelper({
docLink,
disableDefaultVariables,
disableSecretManagerLink,
disableCloudManagerLink,
additionalVariables,
}: ICodeEditorHelperProps) {
const [projectId] = useAtom(projectIdAtom, projectScope);

const availableVariables = [
{
key: "db",
description: `db object provides access to firestore database instance of this project. giving you access to any collection or document in this firestore instance`,
},
{
key: "auth",
description: `auth provides access to a firebase auth instance, can be used to manage auth users or generate tokens.`,
},
{
key: "storage",
description: `firebase Storage can be accessed through this, storage.bucket() returns default storage bucket of the firebase project.`,
},
{
key: "rowy",
description: `rowy provides a set of functions that are commonly used, such as easy file uploads & access to GCP Secret Manager`,
},
];
const availableVariables = disableDefaultVariables
? []
: [
{
key: "db",
description: `db object provides access to firestore database instance of this project. giving you access to any collection or document in this firestore instance`,
},
{
key: "auth",
description: `auth provides access to a firebase auth instance, can be used to manage auth users or generate tokens.`,
},
{
key: "storage",
description: `firebase Storage can be accessed through this, storage.bucket() returns default storage bucket of the firebase project.`,
},
{
key: "rowy",
description: `rowy provides a set of functions that are commonly used, such as easy file uploads & access to GCP Secret Manager`,
},
{
key: "logging",
description: `logging.log is encouraged to replace console.log`,
},
];

return (
<Stack
Expand Down Expand Up @@ -73,29 +85,33 @@ export default function CodeEditorHelper({
spacing={1}
style={{ marginTop: -4 }}
>
<Tooltip title="Secret Manager&nbsp;↗">
<IconButton
size="small"
color="primary"
target="_blank"
rel="noopener noreferrer"
href={`https://console.cloud.google.com/security/secret-manager?project=${projectId}`}
>
<SecretsIcon fontSize="small" />
</IconButton>
</Tooltip>
{!disableSecretManagerLink && (
<Tooltip title="Secret Manager&nbsp;↗">
<IconButton
size="small"
color="primary"
target="_blank"
rel="noopener noreferrer"
href={`https://console.cloud.google.com/security/secret-manager?project=${projectId}`}
>
<SecretsIcon fontSize="small" />
</IconButton>
</Tooltip>
)}

<Tooltip title="Configure Cloud Function&nbsp;↗">
<IconButton
size="small"
color="primary"
target="_blank"
rel="noopener noreferrer"
href={`https://console.cloud.google.com/functions/list?project=${projectId}`}
>
<FunctionsIcon fontSize="small" />
</IconButton>
</Tooltip>
{!disableCloudManagerLink && (
<Tooltip title="Configure Cloud Function&nbsp;↗">
<IconButton
size="small"
color="primary"
target="_blank"
rel="noopener noreferrer"
href={`https://console.cloud.google.com/functions/list?project=${projectId}`}
>
<FunctionsIcon fontSize="small" />
</IconButton>
</Tooltip>
)}

<Tooltip title="Examples & documentation&nbsp;↗">
<IconButton
Expand Down
1 change: 1 addition & 0 deletions src/components/CodeEditor/extensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ExtensionContext = {
extensionBody: any;
};
RULES_UTILS: any;
logging: RowyLogging;
};

// extension body definition
Expand Down
5 changes: 5 additions & 0 deletions src/components/CodeEditor/rowy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ type uploadOptions = {
folderPath?: string;
fileName?: string;
};
type RowyLogging = {
log: (...payload: any[]) => void;
warn: (...payload: any[]) => void;
error: (...payload: any[]) => void;
};
interface Rowy {
metadata: {
/**
Expand Down
Loading