Skip to content

Commit

Permalink
minor(ui): react-quill package update to maintained one (#18067)
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-madlani authored Oct 3, 2024
1 parent 2dceac4 commit de603aa
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 43 deletions.
6 changes: 2 additions & 4 deletions openmetadata-ui/src/main/resources/ui/.licenseheaderrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
"ignoreFile": ".licenseheaderignore",
"license": "LICENSE",
"trailingWhitespace": "TRIM",
"regexIdentifier": "##",
"regexIdentifier": "@@",
"licenseFormats": {
"sh|yml|yaml|^Dockerfile": {
"prepend": "#",
"eachLine": {
"prepend": "# "
},
"append": "#"
}
},
"html|xml": {
"prepend": "<!--",
Expand Down
2 changes: 1 addition & 1 deletion openmetadata-ui/src/main/resources/ui/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright ##[0-9]{4}## Collate.
Copyright @@[0-9]{4}@@ Collate.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
9 changes: 4 additions & 5 deletions openmetadata-ui/src/main/resources/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"pretty": "prettier . --config './.prettierrc.yaml' --ignore-path './.prettierignore' --write",
"build-check": "yarn run json2ts && yarn run js-antlr && yarn run parse-schema",
"commit-check": "yarn run pretty && yarn run build",
"license-header-check": "license-check-and-add check --config-file .licenseheaderrc.json",
"license-header-fix": "license-check-and-add add --config-file .licenseheaderrc.json --regex-replacements $(date +%Y)",
"license-header-check": "license-check-and-add check -f .licenseheaderrc.json",
"license-header-fix": "license-check-and-add add -f .licenseheaderrc.json -r $(date +%Y)",
"json2ts": "sh json2ts.sh",
"parse-schema": "yarn run parse-conn-schema && yarn run parse-ingestion-schema",
"parse-conn-schema": "node parseConnectionSchema && rm -rf connTemp",
Expand Down Expand Up @@ -119,7 +119,7 @@
"react-lazylog": "^4.5.3",
"react-oidc": "^1.0.3",
"react-papaparse": "^4.1.0",
"react-quill": "^2.0.0",
"react-quill-new": "^3.3.2",
"react-reflex": "^4.0.12",
"react-router-dom": "^5.2.0",
"react-toastify": "^8.2.0",
Expand Down Expand Up @@ -245,7 +245,6 @@
"tough-cookie": "4.1.3",
"clean-css": "4.1.11",
"path-to-regexp": "1.9.0",
"terser-webpack-plugin": "5.1.1",
"quill": "^2.0.2"
"terser-webpack-plugin": "5.1.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*
* Copyright 2024 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const CUSTOM_PROPERTIES_TYPES = {
STRING: 'String',
MARKDOWN: 'Markdown',
Expand All @@ -7,13 +19,13 @@ export const CUSTOM_PROPERTIES_TYPES = {

export const FIELD_VALUES_CUSTOM_PROPERTIES = {
STRING: 'This is "testing" string;',
MARKDOWN: `## Overview
MARKDOWN: `### Overview
This project is designed to **simplify** and *automate* daily tasks. It aims to:
- Increase productivity
- Reduce manual effort
- Provide real-time data insights
## Features
### Features
1. **Task Management**: Organize tasks efficiently with custom tags.
2. **Real-Time Analytics**: Get up-to-date insights on task progress.
3. **Automation**: Automate repetitive workflows using custom scripts.`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jest.mock('quilljs-markdown', () => {
return instance;
});

jest.mock('react-quill', () => {
jest.mock('react-quill-new', () => {
class MockQuill {
constructor() {
// eslint-disable-next-line no-console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*/
/* eslint-disable @typescript-eslint/ban-ts-comment */

import { ToolbarEmoji } from '@windmillcode/quill-emoji';
import '@windmillcode/quill-emoji/quill-emoji.css';
import classNames from 'classnames';
import { debounce, isNil } from 'lodash';
import { Parchment } from 'quill';
Expand All @@ -31,7 +29,8 @@ import React, {
} from 'react';
import ReactDOMServer from 'react-dom/server';
import { useTranslation } from 'react-i18next';
import ReactQuill, { Quill } from 'react-quill';
import ReactQuill, { Quill } from 'react-quill-new';
import 'react-quill-new/dist/quill.snow.css';
import { BORDER_COLOR } from '../../../constants/constants';
import {
MENTION_ALLOWED_CHARS,
Expand All @@ -55,7 +54,6 @@ import './feed-editor.less';
import { FeedEditorProp, MentionSuggestionsItem } from './FeedEditor.interface';

Quill.register('modules/markdownOptions', QuillMarkdown);
Quill.register('modules/emoji-toolbar', ToolbarEmoji);
Quill.register(LinkBlot as unknown as Parchment.RegistryDefinition);
const Delta = Quill.import('delta');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*
* Copyright 2024 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.custom-property-right-panel-container {
background: #f8f8f8;
padding: 14px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*
* Copyright 2024 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const COMMON_RESIZABLE_PANEL_CONFIG = {
LEFT_PANEL: {
minWidth: 700,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MentionBlot {
}

// Mock the Quill.import function
jest.mock('react-quill', () => ({
jest.mock('react-quill-new', () => ({
Quill: {
import: jest.fn().mockImplementation(() => {
return MentionBlot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/
import { MentionBlot, MentionBlotData } from 'quill-mention';
import { Quill } from 'react-quill';
import { Quill } from 'react-quill-new';

type RenderType = (
data: MentionBlotData & { link: string; id: string }
Expand Down
2 changes: 0 additions & 2 deletions openmetadata-ui/src/main/resources/ui/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ module.exports = {
},
alias: {
process: 'process/browser',
Quill: 'quill',
quill: 'quill',
},
},

Expand Down
7 changes: 5 additions & 2 deletions openmetadata-ui/src/main/resources/ui/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const process = require('process');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const outputPath = path.join(__dirname, 'dist/assets');
const subPath = process.env.APP_SUB_PATH ?? '';
Expand Down Expand Up @@ -114,12 +115,14 @@ module.exports = {
},
alias: {
process: 'process/browser',
Quill: 'quill',
quill: 'quill',
},
},

plugins: [
// Clean webpack output directory
new CleanWebpackPlugin({
verbose: true,
}),
// Generate index.html from template
new HtmlWebpackPlugin({
favicon: path.join(__dirname, 'public/favicon.png'),
Expand Down
27 changes: 7 additions & 20 deletions openmetadata-ui/src/main/resources/ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4500,13 +4500,6 @@
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==

"@types/quill@^1.3.10":
version "1.3.10"
resolved "https://registry.yarnpkg.com/@types/quill/-/quill-1.3.10.tgz#dc1f7b6587f7ee94bdf5291bc92289f6f0497613"
integrity sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==
dependencies:
parchment "^1.1.2"

"@types/ramda@~0.30.0":
version "0.30.2"
resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.30.2.tgz#70661b20c1bb969589a551b7134ae75008ffbfb6"
Expand Down Expand Up @@ -11079,11 +11072,6 @@ param-case@^3.0.4:
dot-case "^3.0.4"
tslib "^2.0.3"

parchment@^1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/parchment/-/parchment-1.1.4.tgz#aeded7ab938fe921d4c34bc339ce1168bc2ffde5"
integrity sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==

parchment@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/parchment/-/parchment-3.0.0.tgz#2e3a4ada454e1206ae76ea7afcb50e9fb517e7d6"
Expand Down Expand Up @@ -11740,7 +11728,7 @@ quill-mention@^6.0.1:
dependencies:
quill "^2.0.2"

quill@^1.3.7, quill@^2.0.2:
quill@^2.0.2, quill@~2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/quill/-/quill-2.0.2.tgz#5b26bc10a74e9f7fdcfdb5156b3133a3ebf0a814"
integrity sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==
Expand Down Expand Up @@ -12399,14 +12387,13 @@ react-property@2.0.0:
resolved "https://registry.yarnpkg.com/react-property/-/react-property-2.0.0.tgz#2156ba9d85fa4741faf1918b38efc1eae3c6a136"
integrity sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw==

react-quill@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-quill/-/react-quill-2.0.0.tgz#67a0100f58f96a246af240c9fa6841b363b3e017"
integrity sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==
react-quill-new@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/react-quill-new/-/react-quill-new-3.3.2.tgz#10267619b3422ed6ee7a2998f6f2cf3ad2f24658"
integrity sha512-YOBKcUtuz+HsNsYkC0JGmvOJ7Ixy9z9g1VxESart4GQTOYrl4WPAJl0X/REVt46V8CYXYXIBTjbWAwQkvKl+9w==
dependencies:
"@types/quill" "^1.3.10"
lodash "^4.17.4"
quill "^1.3.7"
lodash "^4.17.21"
quill "~2.0.2"

react-redux@^7.2.2:
version "7.2.9"
Expand Down

0 comments on commit de603aa

Please sign in to comment.