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

sync: hosted cloud #1301

Merged
merged 1,530 commits into from
Sep 11, 2023
Merged

sync: hosted cloud #1301

merged 1,530 commits into from
Sep 11, 2023

Conversation

shawndenggh
Copy link
Collaborator

@shawndenggh shawndenggh commented Sep 11, 2023

Summary by CodeRabbit

  • New Feature: Added new methods for getting and updating automation details in AutomationRobotController, IAutomationRobotService, AutomationRobotServiceImpl, ControlMapper, IControlService, and ControlServiceImpl.
  • Refactor: Updated ESLint and Prettier configuration files to improve code formatting and style.
  • Chore: Added a new target _check-lint to the Makefile to ensure linting is performed specifically for the @apitable/datasheet package.
  • Bug Fix: Improved handling of null values in classes within the com.apitable.automation.model package.
  • Refactor: Updated OpenAPI document version from 0.99.0 to 1.0.0, modified validation methods, and introduced new classes and enums in the com.apitable.databusclient.model package.

robot518 and others added 30 commits August 14, 2023 18:54
feat: 第十三次提交rust替换“addRecord2Action”(Only one)函数(#6623)
merge dev后,处理完conflict后,rust重新生成ts
Report a bug.

## 什么环境? What is your Environment?
- 发生环境Enviroment <!-- e.g. integration, staging, production -->:
production

## 怎样复现?  How to reproduce it?
> 尽可能小而精确 as minimally and precisely as possible

## 什么当前结果? What happened?
当前按钮交互没效果

## 你期望什么结果? What you expected to happen?
按钮 Hover 时:var(--bgBglessHover)Active时:var(--bgBglessActive)

## 有什么现场附件截图? Any screenshot or attachments?

![image](https://github.com/vikadata/vikadata/assets/105473667/377e3145-1dbd-4833-a7f6-23158f9add5e)

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

**Style:**
- Updated the hover and active state background colors for
`IconButtonStyle` component. The previous variables
`color.bgBglessSolidHover` and `color.bgBglessSolidActive` have been
replaced with `color.bgBglessHover` and `color.bgBglessActive`,
respectively, to enhance visual feedback.

> 🎉🎨
>
> With a hover and a click, colors take flight,
>
> In our codebase, we've made this right.
>
> Buttons now glow with a softer hue,
>
> A small change, but one that's true! 🌈✨
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# 变化

1. 修复引入 tailwindcss 导致原样式错误
2. 前缀由 `tw-` 改为 `vk-` (`vk` for Vika)
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Style: Fixed mis-styling issue caused by importing Tailwind CSS.
Changed prefix from `tw-` to `vk-` for Vika. Replaced import statements
with `tailwindcss.less`. Updated Tailwind CSS configuration to use 'vk-'
prefix.
- Style: Added three lines of code to import Tailwind CSS components and
utilities.

> "From tw- to vk-, a style reborn,
> Mis-styling fixed, no longer torn.
> With Tailwind's grace, the UI shines,
> Importing components, new styles aligns."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Submit a pull request for this project.

<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->

# Why? 
<!-- 
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->


# What?
<!-- 
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->


# How?
<!-- 
> 大概描述下,如何具体实现的这个Pull Request? 
-->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Bug fix: Improved error handling in the `AutomationRobotRunner` class
by throwing localized error messages obtained from the `Strings` module.
- New Feature: Added a new i18n text key `'action_execute_error'` to the
`stringkeys.interface.ts` file, enhancing translation mapping for
internationalization.

> "Bugs squashed, errors tamed,
> Internationalization now acclaimed.
> With strings and keys, we pave the way,
> For smoother code and a brighter day."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Refactor: Removed unnecessary parameters and simplified code in
various classes and methods.
- Bug fix: Added null check for empty `nodeObjects` parameter in
`AiNodeServiceImpl.create()` method.
- New Feature: Added event handlers to `AiController` class for handling
abort and error events.
- Documentation: Updated signatures of exported classes and constructors
in `ai.model.ts`.
- Chore: Removed unused enum value from `Cache.ts`.

> "Code refactored, bugs fixed,
> New features added, docs uplifted.
> Celebrate the changes, big and small,
> Codebase improved, one and all!"
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
…ate load (#6801)

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Added a `getLocale()` method to the `LoginUserDto` class,
which returns the locale value with underscores replaced by hyphens for
compatibility with user locale format and default locale mail template
load.
- Refactor: Modified the `APITableMailFacadeImpl` class by removing
unused imports, changing the superclass to
`AbstractEnterpriseMailFacade`, and refactoring methods
`getSubjectProperties` and `loadTemplateResourcePath` to use a common
implementation in the superclass.
- New Feature: Introduced a new abstract class
`AbstractEnterpriseMailFacade` in the
`com.apitable.enterprise.notification.interfeces.facade` package. This
class provides methods for loading properties and template resource
paths based on the provided locale and default locale.
- Refactor: Updated the `VikaMailFacadeImpl` class to extend
`AbstractEnterpriseMailFacade` instead of `AbstractMailFacade` and
modified the `getSubjectProperties` and `loadTemplateResourcePath`
methods to call superclass methods.

> "Code changes dance,
> Features enhance.
> Bugs take a chance,
> As we advance."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Submit a pull request for this project.

<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->

# Why? 
<!-- 
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->


# What?
<!-- 
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->


# How?
<!-- 
> 大概描述下,如何具体实现的这个Pull Request? 
-->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Style: Added a new CSS rule to set the z-index of the
`.ant-drawer-header` class in the mobile popup header.
- Style: Removed the `padding` property from the `.ant-drawer-body` CSS
class in the mobile popup header.
- Style: Updated the color property of the mobile popup header.
- Refactor: Introduced a new prop `headerStyle` to the `Popup` component
and memoized the computed value using `useMemo`.
- Refactor: Modified the `UserMenu` component by changing the `color`
prop of the `EditOutlined` component.

> "With style and refactor, this PR arrives,
> Enhancing the UI with pleasant surprise.
> Colors updated, CSS rules refined,
> A celebration of code, harmoniously aligned."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Submit a pull request for this project.


# Why? 



# What?
Migration Resource API


# How?


<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Added a migration resources API endpoint for transferring
resources between buckets.
- New Feature: Introduced `MigrationResourcesRo` class to represent
request parameters for the migration resources API.
- New Feature: Implemented `migrationResources` method in `OssClient`
and its implementations for copying resources between buckets.
- New Feature: Created `MigrationResourcesController` and
`OpsAssetController` to handle resource migration requests.
- Documentation: Added Swagger annotations to `ResourceInfoRo` for API
documentation purposes.

> "Migrating resources with ease,
> Copying files, no need to tease.
> From source to target, they shall flow,
> With this PR, let the migration show!"
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
WASM同时兼容前后端
## Feature

#### 优化 `LayoutType` 的类型
#### 缓存加版本号

https://github.com/vikadata/vikadata/blob/13e517f2621662090987c5b6bf7815ec3c959215/databus/databus-core/src/data_services_manager.rs#L78
#### 解决接口序列化导致无法渲染视图分组过滤的问题:
<img width="734" alt="image"
src="https://github.com/vikadata/vikadata/assets/18455767/d7737253-8893-4077-a4a1-23d3de2285d7">

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Added caching functionality for data snapshots and
revision numbers.
- New Feature: Enhanced code to handle view-related operations such as
filtering, sorting, and styling.
- Bug Fix: Fixed environment variable value in `get_env.ts` to use the
correct `.env` file.
- Refactor: Modified exported function signatures in WebAssembly
modules.
- Refactor: Updated `DataServicesManager` implementation to handle
potential errors and caching logic.
- Refactor: Introduced new async functions for caching and retrieving
snapshots of data.
- test: add trst for datasheet pack Serialize

> "Code evolves, features bloom,
> Caching now brings less gloom.
> Views are styled, sorted with grace,
> Bugs squashed, leaving no trace.
> With WebAssembly, functions change,
> A better experience we arrange."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->

---------

Co-authored-by: Kelly Peilin Chan <kelly@vikadata.com>
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Added a new file `databus-wasm` which is an automatically
generated WebAssembly binding for DataBus.
- New Feature: Introduced new exported functions `add_tn`, `ping_2`, and
`get_records`, as well as a new class `DataBusBridge` with several
methods. The signatures of the exported functions have been altered to
include TypeScript type annotations. The `DataBusBridge` class has a
constructor that takes two string parameters, and it includes methods
such as `init`, `print`, and `get_datasheet_pack`. Overall, the diff
adds new functionality to the codebase.
- Documentation: Added a new import statement to include the
`databus_wasm` module and logged its value.

> "With WebAssembly's power, DataBus now soars,
> New features added, expanding its shores.
> Functions and classes, TypeScript adorned,
> Documentation updated, knowledge reborn.
> Celebrate this PR, a milestone achieved,
> Embrace the changes, let success be perceived!"
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
重构 filterInfo 字段,实际情况中,filter Info 的值会有下面的情况

```shell

[{"name":"陈欣伊","type":3,"avatar":"https://s1.vika.cn/image/2020/03/06/3pATKOBKcGsrdJuKm8sKZA==.png","unitId":"1275353295047004161"},{"name":"陈欣伊","type":3,"unitId":"1280057449658105857"}]

["ExactDate",1656604800000]
```
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Refactor: Changes to `databus-wasm-nodejs`, `databus-wasm-web`, and
`databus-wasm-nodejs` files include function signature modifications,
closures, and logging improvements.
- Data Type Modification: `databus-core/src/so/datasheet_pack.rs`
modifies the width column from an integer to a float.
- Data Type Modification: `databus-core/src/so/view.rs` changes the
`width` field of `ViewColumnSO` struct from `Option<i32>` to
`Option<f64>`.
- Data Type Modification:
`databus-core/src/so/view_mod/view_operation/filter.rs` updates the
`IFilterCondition` struct and `FilterValue` enum with new types.

> "Code refactored, data types transformed,
> A celebration of changes performed.
> Bugs fixed, logic improved,
> With each commit, code's groove moved."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Submit a pull request for this project.

<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->

# Why? 
<!-- 
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->


# What?
<!-- 
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->


# How?
<!-- 
> 大概描述下,如何具体实现的这个Pull Request? 
-->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Style: Updated CSS styles in the user menu, select unit modal, and
permission settings.
- Bug fix: Added logic to check for `isNewUser` property and
`'inviteLinkToken'` key before calling `join()` function and redirecting
to the workbench route.

> "Colors changed, styles refined,
> Bugs fixed, logic defined.
> With each commit, we strive for more,
> Making our codebase strong and pure."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Submit a pull request for this project.

<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->

# Why? 
<!-- 
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->


# What?
<!-- 
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->


# How?
<!-- 
> 大概描述下,如何具体实现的这个Pull Request? 
-->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Bug fix: Updated condition in `common_side.tsx` to check if the
current pathname includes 'workbench' instead of checking the entire
path.
- Bug fix: Modified conditional statement in `field_block.tsx` to
properly evaluate when `cellValue` and `value` are present and their
respective `text` properties are not equal.
- Refactor: Removed unnecessary import statements and updated usage of
`getImageThumbSrc` function in `avatar.tsx`.
- Bug fix: Added null check for `cellValue[0].text` and `(value[0] as
any).text` before comparing them in `field_block.tsx`.

> "Bugs squashed, paths refined,
> Code transformed, logic aligned.
> With each change, we strive for more,
> A better codebase we adore."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Refactor: Modified the workflow in
`.github/workflows/build-ai-server.yml` to add a conditional `build` job
with dependencies.
- Refactor: Removed an import statement and corresponding usage in
`select/dropdown/index.tsx`.
- Refactor: Introduced a new function `handleFilterChange` in
`robot_detail/trigger/record_matches_conditions_filter.tsx`.
- Refactor: Added an options object to `DndProvider` in
`upload_core/upload_core.tsx`.
- Refactor: Renamed classes and updated types in Java files related to
billing configuration and controllers.
- Documentation: Added Javadoc comment to `ProductController` class.
- Refactor: Removed log statements from `StripeWebhookController`.
- New Feature: Added `BillingSchema` enum in `BillingSchema.java`.
- Refactor: Updated `PriceVO` class and related methods in
`PriceVO.java`.
- Refactor: Updated import statements, variable names, and method calls
in `BillingServiceImpl.java`.

> "Code changes dance,
> Bugs have no chance.
> Refactors bring delight,
> Features shine bright.
> With each commit and push,
> Our codebase grows lush."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->

---------

Co-authored-by: paylm penglong feng <fengpenglong@vikadata.com>
Co-authored-by: Caedman Ziwen Lan <lanziwen@apitable.com>
Co-authored-by: Kilian <wangkailang@users.noreply.github.com>
Submit a pull request for this project.

<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->

# Why? 
<!-- 
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->


# What?
<!-- 
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->


# How?
<!-- 
> 大概描述下,如何具体实现的这个Pull Request? 
-->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Refactor: Changes to `NodeContextMenu` component behavior.
- Refactor: Modifications to `useCatalog` function.
- Refactor: Removal of `aiCreateParams` property in
`useCatalogTreeRequest`.
- Refactor: Removal of `previousModalVisible` state and logic in
`useSearchPanel`.
- Refactor: Disabling functionality of `ChatGuide` and
`previousModalVisible`.
- Refactor: JSX modifications in `PublicShareInviteLink` component.
- Refactor: ESLint rule configuration changes.
- New Feature: Introduction of delayed text display in `TextBubble`
component.
- New Feature: Loading state and delay feature in `CUIFormSubmit`
component.

> "Code changes dance,
> Enhancing the software's stance.
> Bugs fixed, features added,
> With joy, the codebase is padded."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->

---------

Signed-off-by: William Chan <root@williamchan.me>
Signed-off-by: William Chan <root@williamchan.me>
Signed-off-by: William Chan <root@williamchan.me>
## feature

- 优化性能,获取数据的过程只反序列化一次
  ```shell
  当前,wasm 在前端对于那种大表几十MB 的大表很慢,分析一下:
  http 纯文本 =>  wasm struct  (反序列化)
  wasm struct  => indexDB  JsValue (序列化1次 反序列化一次)
  wasm struct  => 浏览器 js object(序列化1次 反序列化一次)
  明天用新的方案,应该改成只序列化一次
  ```
- 优化控制台日志提示, 避免只有 `unreached` 的错误。
  
<img width="612" alt="image"
src="https://github.com/vikadata/vikadata/assets/18455767/acc7a064-3266-482f-b171-dabf3cf218a2">

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- Refactor: Removed `ping_2` function and `print` method from
`DataBusBridge` class in `databus-wasm-nodejs`.
- Refactor: Updated exported functions in `databus-wasm-nodejs` and
`databus-wasm-web`, removing some and adding new ones.
- Refactor: Modified `init` function in `DataServicesManager` module of
`databus-core`, adding a new parameter `init_log`.
- Refactor: Modified `init` function in `test_get_records.rs`, adding a
new boolean parameter.
- New Feature: Added `fetch_datasheet_pack_str` function to `ApiDAO`
struct in `api.rs`.
- Refactor: Made several changes to `indexdb_utils.rs`, including
version number, object store checks, and new functions.
- Chore: Modified `databus_core::init` function call in `main.rs`.

> "Code changes dance,
> Bugs have no chance.
> Features shine bright,
> Release with delight!"
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
提高打开表的速度
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:

- Bug fix: Removed unused functions and methods from `databus_wasm` and
`databus_wasm_bg.wasm` files in the
`apitable/packages/databus-wasm-nodejs` and
`apitable/packages/databus-wasm-web` directories. These changes may
impact the external interface and behavior of the code.
- Refactor: Modified the `init` function in `DataServicesManager` module
of `databus-core` to include an additional parameter `init_log`,
improving the speed of opening tables.
- Test: Modified the initialization of the `manager` variable in the
`test_get_records.rs` file.

> "Bugs squashed, code refined,
> Faster tables, peace of mind.
> With each change, we strive for more,
> Making our codebase strong and pure."
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
shawndenggh and others added 23 commits September 8, 2023 00:57
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- Refactor: The `CreditSummaryTask` class has been refactored to improve
code organization and readability. The `summary()` method has been
modified to group credit transactions by date and month, sort them using
a `TreeMap`, and extract new methods for updating transaction status and
calculating credit amount summaries.
- Refactor: The `CreditCostCard` component has been updated to remove
unused imports and commented-out code. The import statement for
`IReduxState` has been updated from `'@apitable/core'`.
- Refactor: The `convertDate` function in the
`credit_cost_card/utils/convert_date.ts` file has been modified to call
a new `formatData` function instead of `formatKey`. The `formatData`
function now formats the data by mapping each item and returning an
object with formatted `dateline` and `credit` properties.
- Refactor: The `formatDate` function in the
`credit_cost_card/utils/date.ts` file has been enhanced to support
different time dimensions. It now uses the `dayjs` library and a
strategy pattern to format today's time, weekdays, months, and years.
- Refactor: Three new methods (`wrapperHours`, `wrapperMonth`, and
`wrapperYear`) have been added to the
`AiCreditTransactionOverallServiceImpl` class to modify the data
returned by the `summary` method based on the selected time dimension.
- Test: A new test method `testSummary()` has been added to the
`CreditSummaryTaskTest` class to test the functionality of the
`summary()` method in the `CreditSummaryTask` class. Mock data is
created for credit transactions with different dates and dimensions, and
the generated chart data is checked for various time dimensions.
- Test: The `testSummaryYesterday()` and `testSummaryLastMonth()` test
methods in the `CreditSummaryTaskTest` class have been marked as
deprecated.
- Test: The `testSummaryWithThisMonth` and `testSummaryWithThisYear`
test methods in the `AiCreditTransactionOverallServiceImplTest` class
have been updated to calculate the size of a list using the
`java.time.YearMonth` class for improved accuracy.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# Human says

As a human, what have you done for this pull request?
Why? What? How?
<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->
<!-- 
# Why?
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->

<!-- 
# What?
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->

<!-- 
# How?
> 大概描述下,如何具体实现的这个Pull Request? 
-->


# AI says

<!-- AI auto review added here -->


<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:

- New Feature: Added support for appending additional parameters to
image URLs in the `getImageThumbSrcForQiniu` function.
- Bug Fix: Fixed rendering of image thumbnails in the `DisplayFileBase`
component by updating the HTML tags and styling.
- Refactor: Refactored the `cellValueToImageSrc` function and made minor
changes to conditional rendering and styling in the `Avatar` and
`FolderShowcase` components.
- Documentation: Updated import statements, function calls, and variable
assignments in multiple components to reflect changes in dependencies.
- Chore: Added a new environment variable `OSS_SIGNATURE_ENABLED` and
included it in the `getEnvVars` function.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
【环境】integration
【版本】v1.0.0-alpha+vika.build6005
【操作步骤】
1. 时光机操作记录中没有屏蔽预览版本
【预期结果】
时光机操作记录中需要屏蔽预览版本


![Image](https://user-images.githubusercontent.com/108248808/265639702-2aeadf8b-679c-4a9d-b360-fd95f99e8846.png)




<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- Style: Updated CSS styles for a list item, changing the cursor style
and commenting out background color changes on hover or when the item is
active.
- New Feature: Modified the `StringsCommandName` object in the code to
update the value of the `CollaCommandName.DeleteRecords` key and add two
new keys (`CollaCommandName.SetDateTimeCellAlarm` and
`CollaCommandName.SetViewAutoSave`) with corresponding string values
from the `Strings` module.
- Refactor: Updated the `commandTran` function to include the new keys
in the `StringsCommandName` object.
- Documentation: Updated the `StringKeysMapType` type definition in the
code, removing several keys and adding new keys related to time machine
actions.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# Human says

As a human, what have you done for this pull request?
Why? What? How?
<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->
<!-- 
# Why?
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->

<!-- 
# What?
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->

<!-- 
# How?
> 大概描述下,如何具体实现的这个Pull Request? 
-->


# AI says

<!-- AI auto review added here -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Added new translation keys `'ai_api_footer_desc'` and
`'ai_remain_credit_label'` to enhance localization capabilities.
- Bug Fix: Modified the `useNetwork` hook to clean up existing message
components when unmounted, improving memory management and preventing
potential memory leaks.
- Enhancement: Added a loading message when the `templateId` variable is
not available, providing better feedback to users during data loading.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
next build 会调用next lint 而抛出异常, 但在CI看不到

故主动在build-server 调用 lint:datasheet

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- New Feature: Improved build process by adding linting step before
running core tests in GitHub Actions workflows.
- New Feature: Added `_check-lint` target to the Makefile, ensuring
linting for the `datasheet` workspace during the build process.
- Refactor: Modified import statements in `index.ts` file to include
additional exports from other files in the `enterprise` module.
- New Feature: Added new environment variables (`IS_ENTERPRISE`,
`API_PROXY`) to `.env` and `.env.local` files in the `datasheet`
package.
- Bug Fix: Added `key` prop to `Box` component in `BaseInfo` component
to ensure unique keys for efficient rendering and avoiding
reconciliation issues.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# Human says

As a human, what have you done for this pull request?
Why? What? How?
<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->
<!-- 
# Why?
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->

<!-- 
# What?
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->

<!-- 
# How?
> 大概描述下,如何具体实现的这个Pull Request? 
-->


# AI says

<!-- AI auto review added here -->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- New Feature: Added a new optional property `stopPropagation` to the
`IDropdownProps` interface in the `FloatUI` component, allowing event
propagation control.
- Refactor: Modified the `Dropdown` component to handle the `isOpen`
state and set the `ref` for the trigger element. Conditionally applied
the `onClick` event handler using `cloneElement` based on the value of
`options.stopPropagation`.
- New Feature: Added three new string keys ('ai_chat',
'automation_stay_tuned', and 'no_step_summary') for localization
purposes in the `stringkeys.interface.ts` file.
- Refactor: Updated the `BaseInfo` component to check for the existence
of `robot.triggers` and `robot.actions` before rendering certain
content. Improved text display when there are no steps yet.
Conditionally rendered the `Avatar` component based on the existence of
`robot.updatedBy.avatar`.
- Style: Made styling updates to the `AutomationPanelContent` component,
including adding a shadow box and gradient background. Introduced the
`VikaSplitPanel` component for layout handling. Renamed some props and
variables for clarity.
- Refactor: Added an import statement and updated the `formList` prop in
the `Side` component to use the value from the `state` object returned
by `useRobotListState()`.
- Refactor: Modified the `AutomationPanel` component by removing an
import statement, changing imports, and updating JSX structure and
styling. Obtained the `currentRobotId` variable from the `useRobot` hook
instead of the `automationState` atom.
- Refactor: Made changes to import statements, component styling, and
event handling in the `AutomationModal` component. Removed the
`changeActionTypeId` function. Adjusted the width of the modal.
- Style: Updated the CSS style of the `.modalContent` class in the
`styles.module.less` file, changing the background color, border color,
and padding of the modal content.
- Refactor: Made changes to the `AutomationRunHistoryList` component,
including removing an import statement, importing a function, adding the
`stopPropagation` property to a component's options object, and
modifying an `onClick` handler.
- Refactor: Removed an extra space in the `TaskItem` component in the
`TaskList` component of the `automation/run_history/list/task.tsx` file.
- Refactor: Added an import statement and modified the `onClick` event
handler in the `AutomationRunHistoryModal` component to asynchronously
call a function and pass the result to another function for downloading
a JSON file.
- Refactor: Included changes in the `robot/api.ts` file.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# Human says

As a human, what have you done for this pull request?
Why? What? How?
<!-- 如果这个Pull Request有对应的Issue,你可以复制Issue的相关信息。 -->
<!-- 
# Why?
> 对应哪个issue?
> 为什么要这个pull request?
> 背景故事或原因是怎样的?
> 你理解的业务需求是怎样的? 
-->

<!-- 
# What?
> 这是一个什么Pull Request?
> 描述一下是什么?
> 对哪些人有好处? 
-->

<!-- 
# How?
> 大概描述下,如何具体实现的这个Pull Request? 
-->


# AI says

<!-- AI auto review added here -->

<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- Bug Fix: Modified the `getBrowserDatabusApiEnabled` function in
`apitable/packages/core/src/modules/database/api/wasm/index.ts` to
correctly determine if the Databus API is enabled. The function now
checks the `ENABLE_DATABUS_API` environment variable and falls back to
local storage if necessary, ensuring accurate behavior.
- Documentation: Updated the code comments and added an error handling
block for improved clarity and maintainability.
- Refactor: Made changes to enhance the logic and error handling of the
`getBrowserDatabusApiEnabled` function, improving its reliability and
performance.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- New Feature: Added a new API endpoint
`GET_FIELD_PERMISSION_PAGE_MEMBER_LIST` to retrieve the list of
collaborators on a specific field in a datasheet.
- New Feature: Introduced a function `getFieldPermissionPageMemberList`
that retrieves the field permissions page member list using an HTTP GET
request with query parameters.
- Refactor: Modified the `EnableFieldPermissionPlus` component to
include state variables, import statements, and a new request function
for fetching collaborator information.
- Refactor: Added a new function `getFieldPermissionMemberListPage` to
the `useCatalogTreeRequest` hook for retrieving a page of field
permission members.
- Style: Made changes to import statements and reformatting in the
`permission.tsx` file.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- Bug Fix: Fixed an issue with the fusion path proxy in version
`v1.0.0-beta` of the API.
- Chore: Updated and synchronized changes related to the hosted cloud. 
- Refactor: Improved thread safety and modularity in the `get_data()`
function by using synchronization mechanisms and encapsulating data
operations within a class or module.
- Error Handling: Added proper error handling for network requests in
the `get_data()` function, providing meaningful error messages or
fallback behavior.
- Security: Implemented SSL certificate validation and suggested
handling authentication and authorization for external API calls in the
`get_data()` function.
- Best Practice: Avoided hardcoding URLs by storing them as
configuration parameters.
- Best Practice: Improved error handling in the `try-except` block by
logging or raising appropriate exceptions.
- Best Practice: Added type hints to the `get_data()` function signature
for better code readability and error checking.
- Best Practice: Enhanced error handling in the route handler to return
meaningful error responses when necessary.
- Best Practice: Suggested using a more robust JSON serialization
library and setting the `Access-Control-Allow-Origin` header for
cross-origin requests in the route handler.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
# Human says

CI test for json0

# AI says

<!-- AI auto review added here -->


<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

Release Notes:
- New Feature: Updated the Node.js version to 16 in the CI setup and
added a new job to run the json0 test using pnpm.
- Bug Fix: Modified the `genRandomOp` function in
`json0-rs-generator.coffee` to skip generating related tests when the
operand is a string.

<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

- Refactor: Removed the `nextActionId` field from the `ActionSimpleVO`
class.
- Refactor: Removed redundant assignments of `action.setNextActionId()`
and fixed a bug by replacing `trigger.getTriggerTypeId()` with
`i.getTriggerTypeId()` in `AutomationRobotServiceImpl`.
- New Feature: Introduced new import statements for
`generateRandomString` from `@apitable/core` and `isEmpty` from `lodash`
in `RobotActionController`. Modified `createAction` method to generate
an `actionId` using `generateRandomString` and update previous action's
`prevActionId` if not empty. Updated parameters passed to
`this.automationActionRepository.createAction`.
- Refactor: Removed import statement for `generateRandomString` from
`@apitable/core` in `AutomationActionRepository`. Modified
`createAction` method to use a new parameter `actionId` directly instead
of generating a random string.
- New Feature: Added a new method `getRobotIdsByResourceIdsAndHasInput`
in `AutomationTriggerRepository` to retrieve robot IDs based on resource
IDs and input presence.
- Refactor: Refactored `getTriggersGroupByResourceId` method in
`RobotTriggerService` to call a new private method
`getAllRevolvedRobotIds` to retrieve robot IDs based on resource IDs.
Empty object is returned if no robot IDs are found. Triggers are fetched
using retrieved robot IDs and grouped by resource ID.
- Test: Added spy and mocked resolved value in
`RobotTriggerServiceTest.ts` to test grouping triggers by resource ID.
- Refactor: Removed redundant assignments of `nextActionId` in
`AutomationRobotServiceImpl` where it was set to the same value as
`actionId`.
- Refactor: Modified `getTriggersGroupByResourceId` method and added a
new private method `getAllRevolvedRobotIds` in `RobotTriggerService`.
`getTriggersGroupByResourceId` now calls `getAllRevolvedRobotIds` to
retrieve robot IDs based on resource IDs. Empty object is returned if no
robot IDs are found. Triggers are fetched using retrieved robot IDs and
grouped by resource ID. `getAllRevolvedRobotIds` retrieves active robots
based on resource IDs, collects their robot IDs in a set, and retrieves
additional robot IDs from the trigger repository. The combined set of
robot IDs is returned.
- Refactor: Added a new method `getRobotIdsByResourceIdsAndHasInput` in
`AutomationTriggerRepository` to retrieve robot IDs based on resource
IDs and input presence.
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
@CLAassistant
Copy link

CLAassistant commented Sep 11, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
11 out of 14 committers have signed the CLA.

✅ laboonly
✅ ChambersChan
✅ JaneSu
✅ wangkailang
✅ wmEvie
✅ zoe-icu
✅ Exclamation-mark
✅ shawndenggh
✅ mr-kelly
✅ okisdev
✅ ranglang
❌ chalme
❌ quppenge
❌ yo-ooiii
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2023

Image description CodeRabbit

Walkthrough

This pull request introduces significant changes to the ESLint and Prettier configuration, Makefile targets, Java classes in the com.apitable.automation and com.apitable.databusclient.model packages, and updates the OpenAPI document version. The changes aim to improve code quality, introduce new features, and enhance data models.

Changes

Files Summary
.eslintrc, .prettierrc Modified ESLint and Prettier configurations to enforce specific code formatting and style rules.
Makefile Added a new target _check-lint to ensure linting is performed for the @apitable/datasheet package.
com.apitable.automation package files Updated methods for getting and updating automation details, improved error handling, and introduced new data object mapping.
com.apitable.automation.model package files Introduced new classes representing data models for automation, added annotations, handled null values correctly, and updated field types.
com.apitable.databusclient.model package files Updated the OpenAPI document version, generated code annotations, validation methods, and introduced new classes and enums representing various data models and types.

🐇💻

Code refined, errors declined,

With every line, we've designed,

A system so aligned,

It's practically enshrined! 🎉🥳


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 99114da and 34c8100 commits.
Files selected (93)
  • .eslintrc (5)
  • .prettierrc (1)
  • Makefile (1)
  • backend-server/application/src/main/java/com/apitable/automation/controller/AutomationRobotController.java (1)
  • backend-server/application/src/main/java/com/apitable/automation/model/ActionSimpleVO.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/model/ActionVO.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/model/AutomationSimpleVO.java (1)
  • backend-server/application/src/main/java/com/apitable/automation/model/AutomationVO.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/model/TriggerSimpleVO.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/model/TriggerVO.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/model/UpdateRobotRO.java (1)
  • backend-server/application/src/main/java/com/apitable/automation/service/IAutomationRobotService.java (2)
  • backend-server/application/src/main/java/com/apitable/automation/service/impl/AutomationRobotServiceImpl.java (5)
  • backend-server/application/src/main/java/com/apitable/control/mapper/ControlMapper.java (1)
  • backend-server/application/src/main/java/com/apitable/control/service/IControlService.java (1)
  • backend-server/application/src/main/java/com/apitable/control/service/impl/ControlServiceImpl.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiCallback.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiClient.java (3)
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiException.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiResponse.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/Configuration.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/GzipRequestInterceptor.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/JSON.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/Pair.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/ProgressRequestBody.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/ProgressResponseBody.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/StringUtil.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/AutomationDaoApiApi.java (6)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/CrateApi.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/DataDaoApiApi.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/DataServicesApiApi.java (7)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/FusionApiApi.java (25)
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/ApiKeyAuth.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/Authentication.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/HttpBasicAuth.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/HttpBearerAuth.java (2)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AbstractOpenApiSchema.java (3)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AiPO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AnyBaseField.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAiPO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAutomationRobotIntroductionSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAutomationSO.java (11)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseDatasheetPackSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseEmptySO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationActionIntroductionPO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationActionPO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationHistoryRO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationHistoryStatusRO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionPO.java (14)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotSO.java (6)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotUpdateRO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationTriggerIntroductionPO.java (5)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationTriggerPO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/BaseDatasheetPackSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/CollectType.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ColorOption.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetMetaSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetPackSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetSnapshotSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DateFormat.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FOperator.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldKindSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldPropertySO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldUpdatedValue.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FilterConjunction.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/GanttColorOption.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/GanttColorType.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IFilterCondition.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IFilterInfo.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ISortInfo.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ISortedField.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IViewLockInfo.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/LinkedFields.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/LookUpFilterPO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodePermissionStateSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodeSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodeSimplePO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordMeta.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RollUpFuncType.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SingleSelectProperty.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SingleTextFieldPropertySO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SymbolAlign.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/TimeFormat.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/UnitSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewColumnSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewRowSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewSO.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewStyleSo.java (1)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/WidgetInPanelSO.java (1)
Files ignored due to filter (23)
  • backend-server/application/src/main/resources/application.yml
  • backend-server/application/src/main/resources/sysconfig/notification.json
  • backend-server/application/src/main/resources/sysconfig/strings.json
  • package.json
  • packages/core/src/config/system_config.source.json
  • packages/databus-wasm-nodejs/cjs/databus_wasm_bg.wasm
  • packages/databus-wasm-nodejs/esm/databus_wasm_bg.wasm
  • packages/databus-wasm-web/databus_wasm_bg.wasm
  • packages/datasheet/package.json
  • packages/datasheet/public/file/langs/strings.de-DE.json
  • packages/datasheet/public/file/langs/strings.en-US.json
  • packages/datasheet/public/file/langs/strings.es-ES.json
  • packages/datasheet/public/file/langs/strings.fr-FR.json
  • packages/datasheet/public/file/langs/strings.it-IT.json
  • packages/datasheet/public/file/langs/strings.ja-JP.json
  • packages/datasheet/public/file/langs/strings.json
  • packages/datasheet/public/file/langs/strings.ko-KR.json
  • packages/datasheet/public/file/langs/strings.ru-RU.json
  • packages/datasheet/public/file/langs/strings.zh-CN.json
  • packages/datasheet/public/file/langs/strings.zh-HK.json
  • packages/datasheet/public/file/pdf/pdf.worker.2.12.313.min.js
  • packages/datasheet/public/file/pdf/pdf.worker.2.4.456.min.js
  • packages/datasheet/public/file/pdf/pdf.worker.2.9.359.min.js
Files not summarized due to errors (23)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/AutomationDaoApiApi.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/FusionApiApi.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AnyBaseField.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAutomationRobotIntroductionSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseDatasheetPackSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationActionPO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionPO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationTriggerPO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetMetaSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetPackSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldPropertySO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IFilterCondition.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodeSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordMeta.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/UnitSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewColumnSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewSO.java (diff tokens exceeds limit)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewStyleSo.java (diff tokens exceeds limit)
Files not reviewed due to errors (40)
  • backend-server/application/src/main/java/com/apitable/automation/model/ActionVO.java (no response)
  • backend-server/application/src/main/java/com/apitable/automation/model/AutomationVO.java (no response)
  • backend-server/application/src/main/java/com/apitable/automation/controller/AutomationRobotController.java (no response)
  • backend-server/application/src/main/java/com/apitable/automation/service/IAutomationRobotService.java (no response)
  • backend-server/application/src/main/java/com/apitable/automation/service/impl/AutomationRobotServiceImpl.java (no response)
  • backend-server/application/src/main/java/com/apitable/control/mapper/ControlMapper.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/Pair.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/AutomationDaoApiApi.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/DataServicesApiApi.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/api/FusionApiApi.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AiPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AnyBaseField.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAutomationRobotIntroductionSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseAutomationSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseDatasheetPackSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ApiResponseEmptySO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationActionPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationHistoryStatusRO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotIntroductionSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationRobotSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationTriggerIntroductionPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationTriggerPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/BaseDatasheetPackSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetMetaSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetPackSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FOperator.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/GanttColorOption.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IFilterCondition.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IFilterInfo.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/IViewLockInfo.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/LinkedFields.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/LookUpFilterPO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordMeta.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RecordSO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SingleSelectProperty.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SingleTextFieldPropertySO.java (no response)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewColumnSO.java (no response)
Files skipped from review due to trivial changes (41)
  • .eslintrc
  • .prettierrc
  • backend-server/application/src/main/java/com/apitable/automation/model/ActionSimpleVO.java
  • backend-server/application/src/main/java/com/apitable/automation/model/AutomationSimpleVO.java
  • backend-server/application/src/main/java/com/apitable/automation/model/TriggerSimpleVO.java
  • backend-server/application/src/main/java/com/apitable/control/service/IControlService.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiCallback.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiClient.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiException.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ApiResponse.java
  • backend-server/application/src/main/java/com/apitable/databusclient/Configuration.java
  • backend-server/application/src/main/java/com/apitable/databusclient/GzipRequestInterceptor.java
  • backend-server/application/src/main/java/com/apitable/databusclient/JSON.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ProgressRequestBody.java
  • backend-server/application/src/main/java/com/apitable/databusclient/ProgressResponseBody.java
  • backend-server/application/src/main/java/com/apitable/databusclient/StringUtil.java
  • backend-server/application/src/main/java/com/apitable/databusclient/api/CrateApi.java
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/Authentication.java
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/HttpBasicAuth.java
  • backend-server/application/src/main/java/com/apitable/databusclient/auth/HttpBearerAuth.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AbstractOpenApiSchema.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationActionIntroductionPO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/AutomationHistoryRO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/CollectType.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ColorOption.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/DatasheetSnapshotSO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldKindSO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldUpdatedValue.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FilterConjunction.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/GanttColorType.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodePermissionStateSO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodeSimplePO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/RollUpFuncType.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/SymbolAlign.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/TimeFormat.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/WidgetInPanelSO.java
  • backend-server/application/src/main/java/com/apitable/databusclient/model/FieldPropertySO.java (diff too large)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/NodeSO.java (diff too large)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/UnitSO.java (diff too large)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewSO.java (diff too large)
  • backend-server/application/src/main/java/com/apitable/databusclient/model/ViewStyleSo.java (diff too large)
Review comments generated (24)
  • Review: 18
  • LGTM: 6

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines 15 to 42
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

export * from './create_guide'; No newline at end of file
package com.apitable.automation.model;

import com.apitable.shared.support.serializer.NullObjectSerializer;
import com.apitable.shared.support.serializer.StringToJsonObjectSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
* TriggerSimpleVO.
*/
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class TriggerVO extends TriggerSimpleVO {

@Schema(description = "Trigger input", type = "java.lang.String", example = "{}")
@JsonSerialize(nullsUsing = NullObjectSerializer.class, using = StringToJsonObjectSerializer.class)
private String input;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [19-43]

The changes in this hunk seem to be converting a JavaScript file into a Java class. This is a significant change and could potentially break any dependent code that was expecting the previous JavaScript module. Please ensure that all dependencies are updated accordingly.

Also, it's good to see that you're using @JsonSerialize with custom serializers for handling nulls and string to JSON object conversion. However, please ensure that these serializers handle edge cases correctly, such as malformed JSON strings or unexpected input types.

Lastly, the input field is declared as a String, but it seems like it might be used to store JSON data based on the StringToJsonObjectSerializer. If possible, consider using a more appropriate data type to represent structured data, such as a Map or a custom class. This would provide better type safety and make the code easier to understand.

Comment on lines +66 to +69
@Override
public String getSpaceIdByControlId(String controlId) {
return controlMapper.selectSpaceIdByControlId(controlId);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The new method getSpaceIdByControlId is introduced without any error handling. If the controlId does not exist in the database, the selectSpaceIdByControlId method might return null or throw an exception. It would be better to handle such scenarios gracefully.

+    @Override
+    public String getSpaceIdByControlId(String controlId) {
+        String spaceId = controlMapper.selectSpaceIdByControlId(controlId);
+        if (spaceId == null) {
+            throw new NotFoundException("Control ID not found: " + controlId);
+        }
+        return spaceId;
+    }

Comment on lines +108 to +112
_check-lint:
yarn install && yarn build:pre
yarn workspaces focus @apitable/core @apitable/i18n-lang @apitable/icons @apitable/components @apitable/widget-sdk @apitable/datasheet root
yarn lint:datasheet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The new _check-lint target in the Makefile seems to be doing more than just linting. It's installing dependencies, building the project, and focusing on several workspaces before running the lint command. This could lead to unexpected side effects if someone is expecting this command to only perform linting. Consider separating these tasks into their own targets for better modularity and clarity of purpose.

  _pre-check:
  	make _check-web

+ _install-dependencies:
+ 	yarn install
+
+ _build-project:
+ 	yarn build:pre
+
+ _focus-workspaces:
+ 	yarn workspaces focus @apitable/core @apitable/i18n-lang @apitable/icons @apitable/components @apitable/widget-sdk @apitable/datasheet root
+
  _check-lint:
- 	yarn install && yarn build:pre
- 	yarn workspaces focus @apitable/core @apitable/i18n-lang @apitable/icons @apitable/components @apitable/widget-sdk @apitable/datasheet root
+ 	make _install-dependencies
+ 	make _build-project
+ 	make _focus-workspaces
  	yarn lint:datasheet

  _check-web:
  	yarn install && yarn build:pre
  	yarn workspaces focus @apitable/core @apitable/i18n-lang @apitable/icons @apitable/components @apitable/widget-sdk @apitable/datasheet root

This way, each target has a single responsibility, making it easier to understand what each one does and allowing them to be used independently if needed.

@@ -2,7 +2,7 @@
* databus-server
* databus-server APIs
*
* The version of the OpenAPI document: 0.99.0
* The version of the OpenAPI document: 1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The version of the OpenAPI document has been updated from 0.99.0 to 1.0.0. This is a major version change, so it's important to ensure that all the API changes are backward compatible or the clients are ready to handle the new version.

- * The version of the OpenAPI document: 0.99.0
+ * The version of the OpenAPI document: 1.0.0

Comment on lines 34 to 39
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

public class DataDaoApiApi {
private ApiClient localVarApiClient;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The import statement for javax.ws.rs.core.GenericType has been removed. If this class was being used in the code, its removal could cause compilation errors. Please ensure that it's not used anywhere in the code or if it's needed, add it back.

- import javax.ws.rs.core.GenericType;

Comment on lines +98 to +101
@javax.annotation.Nullable
public String getFieldId() {
return fieldId;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The getFieldId method is annotated with @Nullable which means it can return null. However, it's good practice to avoid returning null and instead return an Optional.

-   @javax.annotation.Nullable
-   public String getFieldId() {
-     return fieldId;
-   }
+   public Optional<String> getFieldId() {
+     return Optional.ofNullable(fieldId);
+   }

Comment on lines +181 to +206
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ISortedField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ISortedField is not found in the empty JSON string", ISortedField.openapiRequiredFields.toString()));
}
}

Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ISortedField.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ISortedField` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ISortedField.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("fieldId") != null && !jsonObj.get("fieldId").isJsonNull()) && !jsonObj.get("fieldId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fieldId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldId").toString()));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The validateJsonElement method throws an IllegalArgumentException when the JSON element is invalid. It would be better to create a custom exception for this scenario to provide more context about the error.

-   public static void validateJsonElement(JsonElement jsonElement) throws IOException {
+   public static void validateJsonElement(JsonElement jsonElement) throws InvalidJsonElementException {

Comment on lines +244 to +246
public static ISortedField fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ISortedField.class);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The fromJson method throws an IOException when the JSON string is invalid. It would be better to create a custom exception for this scenario to provide more context about the error.

-   public static ISortedField fromJson(String jsonString) throws IOException {
+   public static ISortedField fromJson(String jsonString) throws InvalidJsonStringException {

Comment on lines +253 to +255
public String toJson() {
return JSON.getGson().toJson(this);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The toJson method converts the current instance to a JSON string. It would be better to handle any potential JsonProcessingException within this method and throw a custom exception instead.

-   public String toJson() {
-     return JSON.getGson().toJson(this);
-   }
+   public String toJson() throws JsonConversionException {
+     try {
+       return JSON.getGson().toJson(this);
+     } catch (JsonProcessingException e) {
+       throw new JsonConversionException("Error converting ISortedField to JSON", e);
+     }
+   }

Comment on lines +1 to +256
return o.toString().replace("\n", "\n ");
}


public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;

static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("hidden");
openapiFields.add("recordId");

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("recordId");
}

/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ViewRowSO
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ViewRowSO.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ViewRowSO is not found in the empty JSON string", ViewRowSO.openapiRequiredFields.toString()));
}
}

Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ViewRowSO.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ViewRowSO` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ViewRowSO.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("recordId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recordId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recordId").toString()));
}
}

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ViewRowSO.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ViewRowSO' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ViewRowSO> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ViewRowSO.class));

return (TypeAdapter<T>) new TypeAdapter<ViewRowSO>() {
@Override
public void write(JsonWriter out, ViewRowSO value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}

@Override
public ViewRowSO read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}

}.nullSafe();
}
}

/**
* Create an instance of ViewRowSO given an JSON string
*
* @param jsonString JSON string
* @return An instance of ViewRowSO
* @throws IOException if the JSON string is invalid with respect to ViewRowSO
*/
public static ViewRowSO fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ViewRowSO.class);
}

/**
* Convert an instance of ViewRowSO to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The ViewRowSO class seems to be auto-generated by OpenAPI Generator. The changes include the addition of a new field hidden, along with its getter, setter, and builder methods. There's also a static method validateJsonElement that validates a JSON element against the ViewRowSO model.

However, there is a potential issue in the validateJsonElement method. It checks if the recordId field is a JSON primitive, but it doesn't check if the hidden field is a JSON primitive as well. This could lead to runtime errors if the hidden field in the JSON is not a primitive type (boolean).

+      if (!jsonObj.get("hidden").isJsonPrimitive()) {
+        throw new IllegalArgumentException(String.format("Expected the field `hidden` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hidden").toString()));
+      }

Also, the equalsNullable and hashCodeNullable methods are defined but never used. If these methods are not needed, consider removing them to reduce unnecessary code complexity.

-  private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
-    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
-  }
-
-  private static <T> int hashCodeNullable(JsonNullable<T> a) {
-    if (a == null) {
-      return 1;
-    }
-    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
-  }

Lastly, the CustomTypeAdapterFactory inner class creates a custom Gson TypeAdapter for the ViewRowSO class. This custom adapter validates the JSON element before deserializing it into a ViewRowSO object. However, the validation is only performed when reading (deserializing) the JSON, not when writing (serializing) it. If you want to ensure that the serialized JSON also adheres to the model, consider adding validation in the write method as well.

+  @Override
+  public void write(JsonWriter out, ViewRowSO value) throws IOException {
+    JsonElement jsonElement = thisAdapter.toJsonTree(value);
+    validateJsonElement(jsonElement);
+    elementAdapter.write(out, jsonElement.getAsJsonObject());
+  }

Please review these suggestions and apply them if they align with your project requirements and coding standards.

@shawndenggh shawndenggh merged commit e82967e into develop Sep 11, 2023
22 checks passed
@shawndenggh shawndenggh deleted the sync/hosted branch September 11, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet