Skip to content

Commit

Permalink
[optimize] upgrade HTML Editor, Node.js & other Upstream packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Jul 4, 2023
1 parent ef1a7c5 commit f750c1c
Show file tree
Hide file tree
Showing 4 changed files with 1,479 additions and 1,498 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 7
version: 8

- uses: actions/setup-node@v3
if: ${{ !env.VERCEL_TOKEN || !env.VERCEL_ORG_ID || !env.VERCEL_PROJECT_ID }}
with:
node-version: 14
node-version: 18
cache: pnpm

- name: Install Dependencies
Expand Down
16 changes: 8 additions & 8 deletions components/Activity/ActivityEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
if (form.checkValidity() === false) return (this.validated = true);

const { name } = this.props,
{ detailHTML } = this,
data = formToJSON<ActivityFormData>(form);

data.banners = [data.bannerUrls ?? []].flat().map(bannerUrl => {
Expand All @@ -67,7 +66,7 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
};
});
// @ts-ignore
await activityStore.updateOne({ ...data, detail: detailHTML.trim() }, name);
await activityStore.updateOne(data, name);

if (!name && confirm(t('create_work_success'))) {
await activityStore.publishOne(data.name);
Expand Down Expand Up @@ -270,15 +269,16 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<HTMLEditor
defaultValue={this.detailHTML}
onChange={code => (this.detailHTML = code)}
/>
{detail && (
<HTMLEditor
name="detail"
defaultValue={detail}
onChange={code => (this.detailHTML = code)}
/>
)}
<Form.Control
className="d-none"
name="detail"
isInvalid={!this.detailHTML.trim() && this.validated}
defaultValue={detail}
/>
<Form.Control.Feedback type="invalid">
{textJoin(t('please_enter'), t('activity_detail'))}
Expand Down
34 changes: 15 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,48 @@
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@giscus/react": "^2.2.8",
"@giscus/react": "^2.3.0",
"array-unique-proposal": "^0.3.4",
"classnames": "^2.3.2",
"echarts-jsx": "^0.5.0",
"editorjs-html": "^3.4.2",
"idea-react": "^1.0.0-beta.1",
"idea-react": "^1.0.0-rc.3",
"koajax": "^0.8.4",
"leaflet": "^1.9.4",
"leaflet.chinatmsproviders": "^3.0.6",
"lodash": "^4.17.21",
"mobx": "^5.15.7",
"mobx-i18n": "^0.3.14",
"mobx-i18n": "^0.3.15",
"mobx-react": "^6.3.1",
"mobx-restful": "^0.6.4",
"mobx-restful": "^0.6.5",
"mobx-restful-table": "^0.11.0",
"next": "^12.3.4",
"react": "^17.0.2",
"react-bootstrap": "^2.7.4",
"react-bootstrap-editor": "^1.0.0-rc.7",
"react-bootstrap": "^2.8.0",
"react-bootstrap-editor": "^1.0.1",
"react-dom": "^17.0.2",
"react-editor-js": "^2.1.0",
"react-leaflet": "^3.2.5",
"web-utility": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@editorjs/editorjs": "^2.27.0",
"@editorjs/paragraph": "^2.9.0",
"@octokit/openapi-types": "^17.2.0",
"@babel/core": "^7.22.6",
"@octokit/openapi-types": "^18.0.0",
"@types/leaflet": "^1.9.3",
"@types/lodash": "^4.14.195",
"@types/node": "^16.18.34",
"@types/react": "^17.0.60",
"eslint": "^8.41.0",
"@types/node": "^18.16.19",
"@types/react": "^17.0.62",
"eslint": "^8.44.0",
"eslint-config-next": "^12.3.4",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"less": "^4.1.3",
"less-loader": "^11.1.2",
"lint-staged": "^13.2.2",
"less-loader": "^11.1.3",
"lint-staged": "^13.2.3",
"next-pwa": "^5.6.0",
"next-with-less": "^2.0.5",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typescript": "~5.0.4",
"webpack": "^5.85.0"
"typescript": "~5.1.6",
"webpack": "^5.88.1"
},
"prettier": {
"singleQuote": true,
Expand Down
Loading

1 comment on commit f750c1c

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for open-hackathon ready!

✅ Preview
https://open-hackathon-oh082hz7n-techquery.vercel.app

Built with commit f750c1c.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.