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: Google drive, OneDrive Connectors #739

Merged
merged 75 commits into from
Dec 24, 2024

Conversation

rflihxyz
Copy link
Contributor

@rflihxyz rflihxyz commented Dec 23, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced Google Drive integration with support for permissions management.
    • Improved API key management with a new copy functionality.
    • Added dialog for suspending synchronization with user confirmation.
    • Tabbed navigation for login and account creation forms.
    • New GoogledrivePermissionMapper and GoogledriveService for managing Google Drive permissions.
    • Introduced OnedriveQueueProcessor for processing OneDrive sync jobs.
    • Enhanced folder and file synchronization capabilities with new methods for handling permissions and metadata.
    • New optional properties for folder and file models to track additional metadata.
    • New optional properties in the Onedrive and GoogleDrive services to enhance internal user and group management.
  • Bug Fixes

    • Resolved issues with API key display formatting.
    • Improved error handling and logging for synchronization processes.
  • Documentation

    • Updated README for clarity on Google Drive permissions.
    • Improved formatting and structure of the "File Storage" section in documentation.
  • Style

    • Minor formatting adjustments across various components for improved readability.
  • Tests

    • Enhanced test coverage for new features and bug fixes.

amuwal and others added 30 commits December 11, 2024 21:14
Copy link

changeset-bot bot commented Dec 23, 2024

⚠️ No Changeset found

Latest commit: c268c24

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

zeropath-ai bot commented Dec 23, 2024

We have finished reviewing your PR. We have found no vulnerabilities.

Reply to this PR with @zeropath-ai followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

Copy link

socket-security bot commented Dec 23, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@changesets/cli@2.27.10 environment, filesystem, shell +44 2.7 MB changesets-release-bot
npm/gitmoji-cli@9.5.0 Transitive: environment, eval, filesystem, network +110 16.8 MB carloscuesta

🚮 Removed packages: npm/@changesets/cli@2.27.1, npm/gitmoji-cli@9.2.0

View full report↗︎

coderabbitai[bot]

This comment was marked as duplicate.

@rflihxyz rflihxyz self-assigned this Dec 23, 2024
@rflihxyz rflihxyz added backend 🔌 Connector Connectors extend our unified API so it can interact with a specific software labels Dec 23, 2024
@rflihxyz rflihxyz linked an issue Dec 23, 2024 that may be closed by this pull request
coderabbitai[bot]

This comment was marked as duplicate.

coderabbitai[bot]

This comment was marked as duplicate.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3989319 and d8185bd.

📒 Files selected for processing (2)
  • apps/webapp/src/components/Nav/main-nav.tsx (1 hunks)
  • apps/webapp/src/components/RootLayout/index.tsx (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
apps/webapp/src/components/RootLayout/index.tsx

[error] 76-77: Provide a text alternative through the alt, aria-label or aria-labelledby attribute

Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.

(lint/a11y/useAltText)


[error] 77-78: Provide a text alternative through the alt, aria-label or aria-labelledby attribute

Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.

(lint/a11y/useAltText)


[error] 89-92: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)


[error] 98-98: Alternative text title element cannot be empty

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

(lint/a11y/noSvgWithoutTitle)


[error] 102-102: Alternative text title element cannot be empty

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

(lint/a11y/noSvgWithoutTitle)

apps/webapp/src/components/Nav/main-nav.tsx

[error] 56-67: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

🔇 Additional comments (3)
apps/webapp/src/components/Nav/main-nav.tsx (3)

5-5: Import usage approved

The introduction of the cn utility function for class name composition remains consistent with its usage across the codebase and helps in maintaining cleaner conditional styling.


8-11: Clear and concise interface definition

Defining NavItem with an optional isExternal property is straightforward and flexible, ensuring future extensibility for additional properties like tracking or instrumentation if necessary.


15-42: Clean navigation item configuration

The static array of items effectively encapsulates the navigation configuration in a single place, including external links via isExternal. This is a good approach to keep the component fully configurable and maintainable.

<path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/>
</svg>
) : (
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Associate a title or aria-label with the SVG icon.
Like the previous comment, this SVG should define either <title> or an aria-label attribute.

- <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <svg
+   width="15"
+   height="15"
+   viewBox="0 0 15 15"
+   fill="none"
+   xmlns="http://www.w3.org/2000/svg"
+   aria-label="Copy to clipboard icon"
+ >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
width="15"
height="15"
viewBox="0 0 15 15"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-label="Copy to clipboard icon"
>
🧰 Tools
🪛 Biome (1.9.4)

[error] 102-102: Alternative text title element cannot be empty

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

(lint/a11y/noSvgWithoutTitle)

<TooltipTrigger asChild>
<Button size="sm" variant="outline">
{copiesProjectID ? (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="15" height="15" fill="#ffffff">
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Provide a title or aria-label for the SVG icon.
SVG elements should include a <title> or aria-label to ensure that assistive technologies can describe the symbol.

Example:

- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="15" height="15" fill="#ffffff">
+ <svg
+   xmlns="http://www.w3.org/2000/svg"
+   viewBox="0 0 448 512"
+   width="15"
+   height="15"
+   fill="#ffffff"
+   aria-label="Success checkmark icon"
+ >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="15" height="15" fill="#ffffff">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
width="15"
height="15"
fill="#ffffff"
aria-label="Success checkmark icon"
>
🧰 Tools
🪛 Biome (1.9.4)

[error] 98-98: Alternative text title element cannot be empty

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

(lint/a11y/noSvgWithoutTitle)

Comment on lines +89 to +92
<div
className="cursor-pointer"
onClick={handleCopyRight}
>
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Enable keyboard interactions for better accessibility.
Elements with onClick should also handle onKeyDown or onKeyUp to support users navigating via keyboard.

Here’s a possible adjustment:

- <div 
-   className="cursor-pointer" 
-   onClick={handleCopyRight}
- >
+ <div
+   className="cursor-pointer"
+   role="button"
+   tabIndex={0}
+   onClick={handleCopyRight}
+   onKeyDown={(e) => {
+     if (e.key === "Enter") {
+       handleCopyRight();
+     }
+   }}
+ >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
className="cursor-pointer"
onClick={handleCopyRight}
>
<div
className="cursor-pointer"
role="button"
tabIndex={0}
onClick={handleCopyRight}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleCopyRight();
}
}}
>
🧰 Tools
🪛 Biome (1.9.4)

[error] 89-92: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

Comment on lines +76 to +78
{theme == "light" ?
<img src="/logo-panora-black.png" className='w-14' /> :
<img src="/logo-panora-white-hq.png" className='w-14' />
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Add descriptive alt text for improved accessibility.
Include an alt or aria-label attribute to describe the purpose or content of each <img> element, allowing screen readers to convey this information to users with visual impairments.

Below is a possible fix:

- {theme == "light" ? 
-   <img src="/logo-panora-black.png" className='w-14' /> : 
-   <img src="/logo-panora-white-hq.png" className='w-14' />
- }
+ {theme === "light" ? 
+   <img src="/logo-panora-black.png" className="w-14" alt="Panora black logo" /> : 
+   <img src="/logo-panora-white-hq.png" className="w-14" alt="Panora white logo" />
+ }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{theme == "light" ?
<img src="/logo-panora-black.png" className='w-14' /> :
<img src="/logo-panora-white-hq.png" className='w-14' />
{theme === "light" ?
<img src="/logo-panora-black.png" className="w-14" alt="Panora black logo" /> :
<img src="/logo-panora-white-hq.png" className="w-14" alt="Panora white logo" />
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 76-77: Provide a text alternative through the alt, aria-label or aria-labelledby attribute

Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.

(lint/a11y/useAltText)


[error] 77-78: Provide a text alternative through the alt, aria-label or aria-labelledby attribute

Meaningful alternative text on elements helps users relying on screen readers to understand content's purpose within a page.
If the content is decorative, redundant, or obscured, consider hiding it from assistive technologies with the aria-hidden attribute.

(lint/a11y/useAltText)

Comment on lines +56 to +71
<div
key={item.href}
onClick={() => onLinkClick(item.href)}
className={cn(
"flex items-center rounded-md px-3 py-2 text-sm font-medium cursor-pointer",
"transition-colors",
"hover:bg-accent hover:text-accent-foreground",
pathname === `/${item.href}`
? "bg-accent text-accent-foreground"
: "text-muted-foreground hover:text-primary"
)}
>
<item.icon className="mr-2 h-4 w-4" />
<span>{item.title}</span>
{item.isExternal && <ExternalLink className="ml-2 h-4 w-4" />}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Address accessibility concerns for keyboard navigation

Currently, the click event is assigned to a <div> without providing keyboard accessibility features. According to most accessibility guidelines and the static analysis hint (lint/a11y/useKeyWithClickEvents), elements that handle onClick should also handle keyboard events (e.g., onKeyDown, onKeyUp, or onKeyPress) or be changed to a more semantically appropriate element such as a <button> or an <a> with href. This ensures that keyboard users and assistive technologies can activate the same behavior.

Below is an example fix using a <button> as the interactive element:

- <div
-   key={item.href}
-   onClick={() => onLinkClick(item.href)}
-   className={cn(
-     ...
-   )}
- >
+ <button
+   key={item.href}
+   onClick={() => onLinkClick(item.href)}
+   onKeyPress={() => onLinkClick(item.href)}
+   className={cn(
+     ...
+   )}
+ >
    <item.icon className="mr-2 h-4 w-4" />
    <span>{item.title}</span>
    {item.isExternal && <ExternalLink className="ml-2 h-4 w-4" />}
- </div>
+ </button>

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 56-67: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

@panoratech panoratech deleted a comment from coderabbitai bot Dec 24, 2024
@rflihxyz rflihxyz merged commit 2483653 into main Dec 24, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend 🔌 Connector Connectors extend our unified API so it can interact with a specific software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: Non Working Connectors (File Storage)
2 participants