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

ui: use route location instead of window.location (PROJQUAY-5392) #1844

Merged
merged 2 commits into from Apr 28, 2023

Conversation

syed
Copy link
Contributor

@syed syed commented Apr 28, 2023

window.location causes issues when running in beta or preview on console

window.location causes issues when running in beta or preview on console
@@ -69,6 +69,9 @@ export default function RepositoriesList(props: RepositoriesListProps) {
const [makePublicModalOpen, setmakePublicModal] = useState(false);
const [makePrivateModalOpen, setmakePrivateModal] = useState(false);
const [err, setErr] = useState<string[]>();
const location = useLocation();

console.log('current route location', location.pathname);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@@ -414,3 +429,7 @@ interface RepoListTableItem {
size: number;
last_modified: number;
}

interface RepositoriesListProps {
organizationName: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for adding the props here? I don't see the organizationName getting used in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see RepositoriesListProps used in src/routes/RepositoriesList/RepositoriesList.tsx:65 but it's not defined so I'm defining it

@@ -20,6 +20,7 @@ function getTabIndex(tab: string) {
export default function TagTabs(props: TagTabsProps) {
const [activeTabKey, setActiveTabKey] = useState<TabIndex>(TabIndex.Details);
const navigate = useNavigate();
const location = useLocation();
Copy link
Contributor

Choose a reason for hiding this comment

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

location here doesn't seem to getting used in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's used in src/routes/TagDetails/TagDetailsTabs.tsx:35 but not defined in the context which causes issues

Copy link
Contributor

@Sunandadadi Sunandadadi left a comment

Choose a reason for hiding this comment

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

lgtm

@syed syed merged commit f22da92 into quay:master Apr 28, 2023
14 of 15 checks passed
dmesser pushed a commit to dmesser/quay that referenced this pull request May 4, 2023
…ay#1844)

* ui: use route location instead of window.location (PROJQUAY-5392)

window.location causes issues when running in beta or preview on console

* remove console.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants