Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Fixes Using Chips in the "add Tags" section #9103 #9508

Merged
merged 18 commits into from
Nov 17, 2023

Conversation

Zopsss
Copy link
Contributor

@Zopsss Zopsss commented Oct 15, 2023

Fixes Issue

Fixes #9103

Changes proposed

Added "enter" functionality to the "Tags" input, now we can add new tags by pressing "enter".

Screenshots

2023-10-15.14-57-01.mp4

@github-actions github-actions bot added invalid Inappropriate or invalid for Hacktoberfest contributions ✍ chore: profile This label will be added on PR with request of Data json addition issue linked Pull Request has issue linked labels Oct 15, 2023
Copy link
Member

@kumarsonsoff3 kumarsonsoff3 left a comment

Choose a reason for hiding this comment

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

PRs not related to profile, should not include any data file. Also, you're not allowed to remove someone else json file.

Please revert the changes from data/alevel7.json

@github-actions github-actions bot removed invalid Inappropriate or invalid for Hacktoberfest contributions ✍ chore: profile This label will be added on PR with request of Data json addition labels Oct 16, 2023
@Zopsss
Copy link
Contributor Author

Zopsss commented Oct 16, 2023

PRs not related to profile, should not include any data file. Also, you're not allowed to remove someone else json file.

Please revert the changes from data/alevel7.json

I reverted that commit and pushed the new changes. Sorry for accidently deleting someone's json file.

import XMarkIcon from "@heroicons/react/20/solid/XMarkIcon";
import Input from "../form/Input";

export default function TagsInput({ tags, onTagAdd, onTagRemove }) {
const inputRef = useRef(null);
export default function TagsInput({ tags, onTagAdd, onTagRemove, tagInputRef }) {
Copy link
Member

Choose a reason for hiding this comment

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

If this name was kept the same there would be less changes in the file. I think `inputRef is still descriptive in the scope of this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so should I the tagInputref to inputRef?

Copy link
Member

Choose a reason for hiding this comment

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

Yes please 👍

@eddiejaoude eddiejaoude dismissed kumarsonsoff3’s stale review October 21, 2023 08:26

This has been fixed

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 👍 But this now breaks the events page, please search for where the component TagsInput is used

Screenshot 2023-10-21 at 09 27 12

@Zopsss
Copy link
Contributor Author

Zopsss commented Oct 21, 2023

Thank you for your contribution 👍 But this now breaks the events page, please search for where the component TagsInput is used

Screenshot 2023-10-21 at 09 27 12

Thank you for your contribution 👍 But this now breaks the events page, please search for where the component TagsInput is used

Screenshot 2023-10-21 at 09 27 12

can you specify steps to produce this error?

@eddiejaoude
Copy link
Member

eddiejaoude commented Oct 21, 2023

can you specify steps to produce this error?

I clicked on manage events, then went to edit an event. You can search for where the TagsInput component is used, then you can test these pages also

@Zopsss
Copy link
Contributor Author

Zopsss commented Oct 21, 2023

can you specify steps to produce this error?

I clicked on manage events, then went to edit an event. You can search for where the TagsInput component is used, then you can test these pages also

in my local setup there is no option to add tags on events and VS Code is showing that TagsInput is only used in profile.js file. I also pulled changes but the tags options on event manage page is still not showing.

@badrivlog
Copy link
Contributor

in my local setup there is no option to add tags on events and VS Code is showing that TagsInput is only used in profile.js file. I also pulled changes but the tags options on event manage page is still not showing.

see screen recording below to reproduce the error

Onboarding.Dashboard.-.Google.Chrome.mp4

@@ -57,6 +57,7 @@ export default function ManageEvent({ BASE_URL, event }) {
const [endDate, setEndDate] = useState("");
const [speakingTopic, setspeakingTopic] = useState(event.speakingTopic || "");
const [tags, setTags] = useState(event.tags || []);
const inputRef = useRef(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this variable named inputRef. I think naming the variable simply inputRef might not be very descriptive, because I see in the scope of this function has multiple input fields.

Copy link
Member

Choose a reason for hiding this comment

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

Yep 👍 Inside the tag component it can be inputRef but outside it should be tagInputRef

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry for the late reply, I made the changes as you requested and pushed the changes.

@@ -76,6 +76,8 @@ export default function Profile({ BASE_URL, profile, fileExists }) {
};
});

const inputRef = useRef(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@@ -105,6 +106,10 @@ export default function ManageEvent({ BASE_URL, event }) {
const handleSubmit = async (e) => {
e.preventDefault();

if (document.activeElement === tagInputRef.current) {
console.log('testing');
Copy link
Member

Choose a reason for hiding this comment

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

Please remove debug code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I forgot to remove it before now I've removed it and pushed the changes. Thanks for addressing this.

Copy link
Contributor

@badrivlog badrivlog left a comment

Choose a reason for hiding this comment

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

Looks good to me👍

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

Thank you 👍

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

Sorry I was meant to approve

@eddiejaoude eddiejaoude merged commit 978bc1a into EddieHubCommunity:main Nov 17, 2023
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue linked Pull Request has issue linked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Using Chips in the "add Tags" section
5 participants