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

feat: implement of repo collection [OSPP 2023] #713

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0bf655a
feat: developed RepoCollection Button through antd component
andyhuang18 Aug 9, 2023
f1288e6
feat: implement LocalStorage,SetDefault,DeleteCollection,AddCurRepo f…
andyhuang18 Aug 15, 2023
b5b428a
style: yarn run prettier for index.scss
andyhuang18 Aug 15, 2023
e109bfa
feat: refactor view
andyhuang18 Sep 24, 2023
b540522
feat: implement storage feature
andyhuang18 Sep 26, 2023
ed4f400
feat: implement collection modal from popup button
andyhuang18 Sep 26, 2023
f1e3428
feat: implement collection modal using tabs and repo list beside
andyhuang18 Sep 26, 2023
0abec7d
feat: implement collection modal from repository dropdown click
andyhuang18 Sep 27, 2023
72dcdd0
feat: solve reopen modal problem
andyhuang18 Sep 27, 2023
914060c
feat: implement collection editor function (quick import need to be d…
andyhuang18 Sep 28, 2023
c20f2ba
feat: add judgment for whether there is initial data
andyhuang18 Sep 28, 2023
5335062
feat: create CollectionEditor component
andyhuang18 Sep 29, 2023
5cad16d
feat: use GitHub REST API to get repo and its description
andyhuang18 Sep 29, 2023
8f942b2
feat: implement CollectionEditor add and edit feature
andyhuang18 Sep 29, 2023
64e6436
feat: solve formatting and naming issues
andyhuang18 Oct 10, 2023
2f237d2
feat: refactor data structure
andyhuang18 Oct 11, 2023
0b90d6d
refactor: implement the collection button in the original GitHub styl…
andyhuang18 Oct 15, 2023
ba662b0
Merge branch 'repo-collection-final' into feat/repo-collection
tyn1998 Oct 15, 2023
19f3973
chore: update yarn.lock
andyhuang18 Oct 15, 2023
445c6cc
Merge branch 'repo-collection-final' into feat/repo-collection
andyhuang18 Oct 15, 2023
4b5e9c0
fix: update module import
andyhuang18 Oct 15, 2023
737e219
chore: update yarn.lock
andyhuang18 Oct 15, 2023
8bdb270
fix: duplicate rendering after tab switches
andyhuang18 Oct 15, 2023
4e3d2c0
fix: prevent duplicate finally
andyhuang18 Oct 15, 2023
d50520a
refactor: give CollectionModal a separate directory
andyhuang18 Oct 15, 2023
b96ec1b
refactor: CollectionList (30%) and AddToCollections (1%)
andyhuang18 Oct 15, 2023
a993260
feat: support basic interactions with CollectionButton
andyhuang18 Oct 15, 2023
56606f9
chore: disable charts-design
andyhuang18 Oct 15, 2023
81c3225
chore: allow overflow when there are many exsiting collections
andyhuang18 Oct 15, 2023
3fc9fa0
chore: add comments
andyhuang18 Oct 15, 2023
3989dad
chore: add manage button in AddToCollections
andyhuang18 Oct 15, 2023
24f6d52
refactor: a possible final directory
andyhuang18 Oct 15, 2023
fddb551
chore: support to open modal from CollectionList
andyhuang18 Oct 15, 2023
46791e0
fix: fix typo
andyhuang18 Oct 16, 2023
5d0c22d
feat: add confirm check before collection deletion
andyhuang18 Oct 16, 2023
6782d37
feat: set default key for Table and add Radio for quick import (User/…
andyhuang18 Oct 16, 2023
ec01eeb
refactor: move custom type definition to context.ts
andyhuang18 Oct 16, 2023
ec49e31
refactor: use constate to better manage locally global state
andyhuang18 Oct 16, 2023
8b3fc28
feat: store and useStore for repo-collection
andyhuang18 Oct 16, 2023
051d854
chore: update repo name after turbo:restore
andyhuang18 Oct 16, 2023
e544fd1
feat: replace some part with real data
andyhuang18 Oct 16, 2023
6944fd0
feat: AddToCollections(100%)
andyhuang18 Oct 18, 2023
f82543a
fix: a simple lock mechanism to prevent concurrent updates in store.ts
andyhuang18 Oct 18, 2023
868b4c0
feat: implement CollectionDisplayModal and rename filename
andyhuang18 Oct 20, 2023
ba2945c
refactor: rename view.tsx
andyhuang18 Oct 20, 2023
643309b
feat: add divider for footer in AddToCollections
andyhuang18 Oct 20, 2023
3668eb4
refactor: remove redundant initialization
andyhuang18 Oct 20, 2023
1e0bcf7
refactor: rollback and delete displayModal
andyhuang18 Oct 20, 2023
c25f58d
feat: implement of CollectionManageModal
andyhuang18 Oct 21, 2023
ced0589
feat: implement of CollectionEditor confirm
andyhuang18 Oct 21, 2023
20f3cdc
feat: use await/async function
andyhuang18 Oct 21, 2023
2ccd9fc
Merge branch 'feat/repo-collection' into feat/repo-collection
andyhuang18 Oct 21, 2023
b408207
chore: fix typo and add validator for duplicate collection name
andyhuang18 Oct 22, 2023
c23c26f
style: maximize the collection modal size
andyhuang18 Oct 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"@hot-loader/react-dom": "^17.0.2",
"@types/chrome": "^0.0.203",
"@uifabric/icons": "^7.6.2",
"@ant-design/icons": "latest",
"antd": "5.8.2",
"buffer": "^6.0.3",
"delay": "^5.0.0",
"dom-loaded": "^3.0.0",
Expand Down
84 changes: 84 additions & 0 deletions src/pages/ContentScripts/features/repo-collection/Collection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import React, { useEffect, useRef, useState } from 'react';
import { Button, Col, List, Modal, Row, Tabs } from 'antd';

interface CollectionProps {
data: any;
closeModal: () => void;
}

// ToDo forwardRef

const Collection = (props: CollectionProps): JSX.Element => {
const collectionData = props.data;
const [loading, setLoading] = useState(false);
const [open, setOpen] = useState(true);
const listData = collectionData[1];

const showModal = () => {
setOpen(true);
};

const handleOk = () => {
setLoading(true);
setTimeout(() => {
setLoading(false);
setOpen(false);
}, 3000);
};

const handleCancel = () => {
props.closeModal();
};
return (
<>
<Modal
width={1200}
centered
open={open}
title={
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: '24px',
fontWeight: 'bold',
marginBottom: '20px',
}}
>
'{collectionData[0]}' Collection Dashboard
</div>
}
onOk={handleOk}
onCancel={handleCancel}
footer={[
<button className={'btn'} onClick={handleCancel}>
返回
</button>,
]}
>
<Row>
<Col xs={{ span: 5, offset: 1 }} lg={{ span: 4 }}>
<div style={{ marginTop: '50px' }}>
<List
header={
<div style={{ fontSize: '18px', fontWeight: 'bold' }}>
Repositories
</div>
}
bordered
dataSource={listData}
renderItem={(item) => <List.Item>{item}</List.Item>}
/>
</div>
</Col>
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 12, offset: 2 }}>
Graph is here
</Col>
</Row>
</Modal>
</>
);
};

export default Collection;
Loading