diff --git a/frontend/src/components/SharedProjectPage/elements.jsx b/frontend/src/components/SharedProjectPage/elements.jsx
index f77a631ec2..cfb2edb4ab 100644
--- a/frontend/src/components/SharedProjectPage/elements.jsx
+++ b/frontend/src/components/SharedProjectPage/elements.jsx
@@ -11,14 +11,12 @@ import Readme from '@components/Board/Readme'
const PageElements = ({
assetPath,
repoName,
- hasUploadPermission,
hasIBOM,
kitspaceYAML,
bomInfo,
zipUrl,
readme,
boardSpecs,
- previewOnly,
description,
projectName,
projectFullname,
@@ -28,18 +26,6 @@ const PageElements = ({
readmeExists,
boardShowcaseAssetsExist,
}) => {
- const AssetPlaceholderWithUploadPermissions = ({ asset }) => (
-
- )
-
- AssetPlaceholderWithUploadPermissions.propTypes = {
- asset: string.isRequired,
- }
-
return (
<>
>
) : (
-
+
)}
@@ -70,7 +56,7 @@ const PageElements = ({
zipUrl={zipUrl}
/>
) : (
-
+
)}
{bomInfoExists ? (
) : (
-
+
)}
{readmeExists ? (
) : (
-
+
)}
>
)
}
-const AssetPlaceholder = ({ asset, hasUploadPermission, previewOnly }) => {
+const AssetPlaceholder = ({ asset }) => {
let message = `No ${asset} files were found`
- if (hasUploadPermission && previewOnly) {
- message += ', commit files to the original repo and it will be synced'
- } else if (hasUploadPermission && !previewOnly) {
- message += ', upload some'
- }
-
return (
{
AssetPlaceholder.propTypes = {
asset: string.isRequired,
- hasUploadPermission: bool.isRequired,
- previewOnly: bool.isRequired,
}
PageElements.propTypes = {
assetPath: string.isRequired,
- hasUploadPermission: bool.isRequired,
hasIBOM: bool.isRequired,
kitspaceYAML: shape({
summary: string,
diff --git a/frontend/src/components/SharedProjectPage/index.jsx b/frontend/src/components/SharedProjectPage/index.jsx
index 360f990c63..3902c6d140 100644
--- a/frontend/src/components/SharedProjectPage/index.jsx
+++ b/frontend/src/components/SharedProjectPage/index.jsx
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import { useRouter } from 'next/router'
-import { Loader, Message } from 'semantic-ui-react'
+import { Loader } from 'semantic-ui-react'
import Page from '@components/Page'
import { useMigrationStatus } from '@hooks/Gitea'
@@ -73,16 +73,6 @@ const SharedProjectPage = props => {
return (
- {props.isSynced && props.hasUploadPermission ? (
-
- A synced repository!
-
- Files uploading isn't supported for synced repositories.
- Please commit files to the original git repository and it will be synced
- automatically.
-
-
- ) : null}
props.notFound ? :
-MultiProjectPage.getInitialProps = async ({ query, req = null, res = null }) => {
+MultiProjectPage.getInitialProps = async ({ query, res = null }) => {
const { user: username, repo: repoName, project: projectName } = query
const repoFullName = `${username}/${repoName}`
const rootAssetPath = `${assetUrl}/files/${repoFullName}/HEAD`
const assetPath = `${rootAssetPath}/${projectName}`
- const session = req?.session ?? JSON.parse(sessionStorage.getItem('session'))
const exists = await repoExists(repoFullName)
if (exists) {
@@ -38,7 +37,6 @@ MultiProjectPage.getInitialProps = async ({ query, req = null, res = null }) =>
[kitspaceYAMLExists, kitspaceYamlArray],
finishedProcessing,
hasIBOM,
- hasUploadPermission,
] = await Promise.all([
getRepo(repoFullName),
getReadme(assetPath),
@@ -47,8 +45,6 @@ MultiProjectPage.getInitialProps = async ({ query, req = null, res = null }) =>
getKitspaceYamlArray(rootAssetPath),
getIsProcessingDone(rootAssetPath),
hasInteractiveBom(assetPath),
- // The repo owner and collaborators can upload files.
- canCommit(repoFullName, session.user?.username, session.apiToken),
])
const kitspaceYAML = kitspaceYamlArray.find(p => p.name === projectName)
@@ -68,7 +64,6 @@ MultiProjectPage.getInitialProps = async ({ query, req = null, res = null }) =>
rootAssetPath,
repo,
projectFullname: repoFullName,
- hasUploadPermission,
hasIBOM,
kitspaceYAML,
zipUrl,
diff --git a/frontend/src/pages/_app.jsx b/frontend/src/pages/_app.jsx
index 40ce215b64..a17f305649 100644
--- a/frontend/src/pages/_app.jsx
+++ b/frontend/src/pages/_app.jsx
@@ -30,7 +30,6 @@ import 'semantic-ui-css/components/dimmer.min.css'
import 'semantic-ui-css/components/table.min.css'
import 'semantic-ui-css/components/progress.min.css'
-import AuthProvider from '@contexts/AuthContext'
import './_app.scss'
if (typeof window !== 'undefined') {
@@ -42,7 +41,7 @@ if (typeof window !== 'undefined') {
}
}
-function KitspaceApp({ Component, pageProps, session, isStaticFallback }) {
+function KitspaceApp({ Component, pageProps, isStaticFallback }) {
const setStaticFallback = isStaticFallback ? (