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

Make main default again #1248

Merged
merged 57 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
19d146c
separate out incomingShare Viewer and Collaborator CollectionSummaryType
abhinavkgrd Jul 3, 2023
029bd7f
added support for showing collab album in collection selector add to …
abhinavkgrd Jul 3, 2023
17b7776
updated usage of CollectionSummaryType.incomingShare to newer separat…
abhinavkgrd Jul 3, 2023
53b245b
refactor
abhinavkgrd Jul 3, 2023
a69848d
refactor CollectionSummaryType determination and fallback to incoming…
abhinavkgrd Jul 4, 2023
580f4ab
show incoming item on home screen
abhinavkgrd Jul 4, 2023
d63eaf3
run post handleCollectionOps even when toProcessFiles are zero
abhinavkgrd Jul 4, 2023
9407848
show shared file in search screen
abhinavkgrd Jul 4, 2023
d1b9367
remove isIncomingSharedCollection logic and use isOwnFile logic to sh…
abhinavkgrd Jul 4, 2023
677d943
fix function name casing
abhinavkgrd Jul 4, 2023
8d70cdc
add archive/unarchive option to shared album
abhinavkgrd Jul 4, 2023
4f3fe68
add sharedMagicMetadata property and type
abhinavkgrd Jul 4, 2023
d8559c5
Add to collab album support (#1221)
abhinavkgrd Jul 5, 2023
45ea3a6
fix sync crowdin schedule run
abhinavkgrd Jul 7, 2023
0cb4892
fix sync Crowdin schedule run (#1235)
abhinavkgrd Jul 7, 2023
0cad125
update isArchived to handle shared Collection metadata visibility state
abhinavkgrd Jul 8, 2023
7161bc8
support archiving shared album and handle incoming sharee-metadata p…
abhinavkgrd Jul 8, 2023
decc8d5
remove noFallthroughCasesInSwitch false
abhinavkgrd Jul 8, 2023
85f59c2
reenabled strictBindCallApply tsc check
abhinavkgrd Jul 8, 2023
3a91c72
replace isArchived with separate isArchivedFile and isArchivedCollec…
abhinavkgrd Jul 9, 2023
7c24db4
Merge branch 'dev' into incoming-item-home-screen
abhinavkgrd Jul 9, 2023
eefa66f
Merge branch 'incoming-item-home-screen' into add-support-archive-sha…
abhinavkgrd Jul 9, 2023
14fa472
migrate code
abhinavkgrd Jul 9, 2023
10751ec
fix isArchivedCollection
abhinavkgrd Jul 9, 2023
1bb9d9c
clean up code
abhinavkgrd Jul 9, 2023
0e7fb97
pause video beforeChanging to next one
abhinavkgrd Jul 9, 2023
174d5af
rename collectionSummary latestFile to coverFile
abhinavkgrd Jul 10, 2023
3ad621b
update getCollectionLatestFiles to getCollectionCoverFiles
abhinavkgrd Jul 10, 2023
8f18aef
keep both latest and cover File
abhinavkgrd Jul 10, 2023
cde730a
revert unneeded change
abhinavkgrd Jul 10, 2023
b628b9d
add new order CollectionMagicMetadataProps
abhinavkgrd Jul 10, 2023
78abef4
add functionality to pin and unpin albums
abhinavkgrd Jul 10, 2023
4cc8558
support showing pinned at the start of collection list
abhinavkgrd Jul 10, 2023
e5a58c1
remove unneeded size
abhinavkgrd Jul 10, 2023
67e565e
fix incomingShareViewer sort order
abhinavkgrd Jul 10, 2023
bf6ebb2
show download and share quick share option
abhinavkgrd Jul 10, 2023
2dd65cb
fix build
abhinavkgrd Jul 10, 2023
4c075d6
revert folder name change
abhinavkgrd Jul 10, 2023
01b0d1b
refactor and fix issue getCollectionCoverFiles
abhinavkgrd Jul 10, 2023
d4fa666
update comment
abhinavkgrd Jul 10, 2023
11f4d8c
fix getCollectionCoverFiles
abhinavkgrd Jul 11, 2023
b267faf
Show incoming shared files in ALL section (#1224)
abhinavkgrd Jul 11, 2023
0ef6648
Pinned album (#1239)
abhinavkgrd Jul 11, 2023
7b4a609
Merge branch 'dev' into add-support-archive-shared-album
abhinavkgrd Jul 11, 2023
5ae3a99
Merge branch 'dev' into album-cover
abhinavkgrd Jul 11, 2023
3775ecd
allow shared file to latest and cover photo for all section
abhinavkgrd Jul 11, 2023
8b53e55
add option to SingleInputForm to prevent caching of filed values
abhinavkgrd Jul 11, 2023
adf5b16
Add support to archive shared album (#1236)
abhinavkgrd Jul 11, 2023
e62e652
Merge branch 'main' into dev
abhinavkgrd Jul 11, 2023
d809c82
Merge branch 'dev' into album-cover
abhinavkgrd Jul 11, 2023
91879d0
removed "strictPropertyInitialization": false,
abhinavkgrd Jul 11, 2023
96decde
Add option to prevent Input field caching (#1240)
abhinavkgrd Jul 11, 2023
ea92b1a
Album cover (#1238)
abhinavkgrd Jul 11, 2023
61c59e9
Enable stricter typescript (#1241)
abhinavkgrd Jul 11, 2023
c8a72f7
Bump semver from 6.3.0 to 6.3.1
dependabot[bot] Jul 11, 2023
577e2b8
Bump semver from 6.3.0 to 6.3.1 (#1242)
abhinavkgrd Jul 11, 2023
1ed4a6e
Pause video on navigate (#1237)
abhinavkgrd Jul 12, 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 .github/workflows/l18n-crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- name: crowdin action
uses: crowdin/github-action@v1
Expand Down
4 changes: 3 additions & 1 deletion apps/photos/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,5 +537,7 @@
"NEWEST_FIRST": "Newest first",
"OLDEST_FIRST": "Oldest first",
"CONVERSION_FAILED_NOTIFICATION_MESSAGE": "This file could not be previewed. Click here to download the original.",
"SELECT_COLLECTION":"Select album"
"SELECT_COLLECTION":"Select album",
"PIN_ALBUM":"Pin album",
"UNPIN_ALBUM":"Unpin album"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function AllCollectionCard({
return (
<CollectionCard
collectionTile={AllCollectionTile}
latestFile={collectionSummary.latestFile}
coverFile={collectionSummary.coverFile}
onClick={() => onCollectionClick(collectionSummary.id)}
isScrolling={isScrolling}>
<AllCollectionTileText>
Expand Down
4 changes: 2 additions & 2 deletions apps/photos/src/components/Collections/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { LoadingThumbnail } from 'components/PlaceholderThumbnails';

export default function CollectionCard(props: {
children?: any;
latestFile: EnteFile;
coverFile: EnteFile;
onClick: () => void;
collectionTile: any;
isScrolling?: boolean;
}) {
const {
latestFile: file,
coverFile: file,
onClick,
children,
collectionTile: CustomCollectionTile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default function CollectionInfoWithOptions({
return <Favorite />;
case CollectionSummaryType.archived:
return <ArchiveOutlined />;
case CollectionSummaryType.incomingShare:
case CollectionSummaryType.incomingShareViewer:
case CollectionSummaryType.incomingShareCollaborator:
return <PeopleIcon />;
case CollectionSummaryType.outgoingShare:
return <PeopleIcon />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ArchiveIcon from '@mui/icons-material/Archive';
import PeopleIcon from '@mui/icons-material/People';
import LinkIcon from '@mui/icons-material/Link';
import { CollectionSummary } from 'types/collection';
import PushPin from '@mui/icons-material/PushPin';

interface Iprops {
collectionSummary: CollectionSummary;
Expand All @@ -29,7 +30,7 @@ const CollectionListBarCard = (props: Iprops) => {
<Box>
<CollectionCard
collectionTile={CollectionBarTile}
latestFile={collectionSummary.latestFile}
coverFile={collectionSummary.coverFile}
onClick={() => {
onCollectionClick(collectionSummary.id);
}}>
Expand Down Expand Up @@ -63,12 +64,15 @@ function CollectionCardIcon({ collectionType }) {
{collectionType === CollectionSummaryType.outgoingShare && (
<PeopleIcon />
)}
{collectionType === CollectionSummaryType.incomingShare && (
{(collectionType === CollectionSummaryType.incomingShareViewer ||
collectionType ===
CollectionSummaryType.incomingShareCollaborator) && (
<PeopleIcon />
)}
{collectionType === CollectionSummaryType.sharedOnlyViaLink && (
<LinkIcon />
)}
{collectionType === CollectionSummaryType.pinned && <PushPin />}
</CollectionBarTileIcon>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const CollectionCardContainer = React.memo(
);

const getItemKey = (index: number, data: ItemData) => {
return `${data.collectionSummaries[index].id}-${data.collectionSummaries[index].latestFile?.id}`;
return `${data.collectionSummaries[index].id}-${data.collectionSummaries[index].coverFile?.id}`;
};

const CollectionListBar = (props: IProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ import Unarchive from '@mui/icons-material/Unarchive';
import ArchiveOutlined from '@mui/icons-material/ArchiveOutlined';
import SortIcon from '@mui/icons-material/Sort';
import { t } from 'i18next';
import PushPinOutlined from '@mui/icons-material/PushPinOutlined';
import { UnPinIcon } from 'components/icons/UnPinIcon';

interface Iprops {
IsArchived: boolean;
isArchived: boolean;
isPinned: boolean;
handleCollectionAction: (
action: CollectionActions,
loader?: boolean
) => (...args: any[]) => Promise<void>;
}

export function AlbumCollectionOption({
IsArchived,
isArchived,
isPinned,
handleCollectionAction,
}: Iprops) {
return (
Expand All @@ -40,7 +44,26 @@ export function AlbumCollectionOption({
startIcon={<SortIcon />}>
{t('SORT_BY')}
</OverflowMenuOption>
{IsArchived ? (
{isPinned ? (
<OverflowMenuOption
onClick={handleCollectionAction(
CollectionActions.UNPIN_ALBUM,
false
)}
startIcon={<UnPinIcon />}>
{t('UNPIN_ALBUM')}
</OverflowMenuOption>
) : (
<OverflowMenuOption
onClick={handleCollectionAction(
CollectionActions.PIN_ALBUM,
false
)}
startIcon={<PushPinOutlined />}>
{t('PIN_ALBUM')}
</OverflowMenuOption>
)}
{isArchived ? (
<OverflowMenuOption
onClick={handleCollectionAction(
CollectionActions.UNARCHIVE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,46 @@ import React from 'react';
import LogoutIcon from '@mui/icons-material/Logout';
import { CollectionActions } from '.';
import { t } from 'i18next';
import Unarchive from '@mui/icons-material/Unarchive';
import ArchiveOutlined from '@mui/icons-material/ArchiveOutlined';

interface Iprops {
isArchived: boolean;
handleCollectionAction: (
action: CollectionActions,
loader?: boolean
) => (...args: any[]) => Promise<void>;
}

export function SharedCollectionOption({ handleCollectionAction }: Iprops) {
export function SharedCollectionOption({
isArchived,
handleCollectionAction,
}: Iprops) {
return (
<OverflowMenuOption
startIcon={<LogoutIcon />}
onClick={handleCollectionAction(
CollectionActions.CONFIRM_LEAVE_SHARED_ALBUM,
false
)}>
{t('LEAVE_ALBUM')}
</OverflowMenuOption>
<>
{isArchived ? (
<OverflowMenuOption
onClick={handleCollectionAction(
CollectionActions.UNARCHIVE
)}
startIcon={<Unarchive />}>
{t('UNARCHIVE_COLLECTION')}
</OverflowMenuOption>
) : (
<OverflowMenuOption
onClick={handleCollectionAction(CollectionActions.ARCHIVE)}
startIcon={<ArchiveOutlined />}>
{t('ARCHIVE_COLLECTION')}
</OverflowMenuOption>
)}
<OverflowMenuOption
startIcon={<LogoutIcon />}
onClick={handleCollectionAction(
CollectionActions.CONFIRM_LEAVE_SHARED_ALBUM,
false
)}>
{t('LEAVE_ALBUM')}
</OverflowMenuOption>
</>
);
}
27 changes: 24 additions & 3 deletions apps/photos/src/components/Collections/CollectionOptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import React, { useContext, useRef, useState } from 'react';
import * as CollectionAPI from 'services/collectionService';
import * as TrashService from 'services/trashService';
import {
changeCollectionOrder,
changeCollectionSortOrder,
changeCollectionVisibility,
downloadAllCollectionFiles,
downloadHiddenFiles,
} from 'utils/collection';
import { SetCollectionNamerAttributes } from '../CollectionNamer';
import { Collection } from 'types/collection';
import { IsArchived } from 'utils/magicMetadata';
import { isArchivedCollection, isPinnedCollection } from 'utils/magicMetadata';
import { GalleryContext } from 'pages/gallery';
import { logError } from 'utils/sentry';
import { VISIBILITY_STATE } from 'types/magicMetadata';
Expand Down Expand Up @@ -53,6 +54,8 @@ export enum CollectionActions {
LEAVE_SHARED_ALBUM,
SHOW_SORT_ORDER_MENU,
UPDATE_COLLECTION_SORT_ORDER,
PIN_ALBUM,
UNPIN_ALBUM,
}

const CollectionOptions = (props: CollectionOptionsProps) => {
Expand Down Expand Up @@ -132,6 +135,12 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
case CollectionActions.UPDATE_COLLECTION_SORT_ORDER:
callback = updateCollectionSortOrder;
break;
case CollectionActions.PIN_ALBUM:
callback = pinAlbum;
break;
case CollectionActions.UNPIN_ALBUM:
callback = unPinAlbum;
break;
default:
logError(
Error('invalid collection action '),
Expand Down Expand Up @@ -290,6 +299,14 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
await changeCollectionSortOrder(activeCollection, asc);
};

const pinAlbum = async () => {
await changeCollectionOrder(activeCollection, 1);
};

const unPinAlbum = async () => {
await changeCollectionOrder(activeCollection, 0);
};

return (
<HorizontalFlex sx={{ display: 'inline-flex', gap: '16px' }}>
<QuickOptions
Expand Down Expand Up @@ -322,13 +339,17 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
downloadOptionText={t('DOWNLOAD_HIDDEN')}
/>
) : collectionSummaryType ===
CollectionSummaryType.incomingShare ? (
CollectionSummaryType.incomingShareViewer ||
collectionSummaryType ===
CollectionSummaryType.incomingShareCollaborator ? (
<SharedCollectionOption
isArchived={isArchivedCollection(activeCollection)}
handleCollectionAction={handleCollectionAction}
/>
) : (
<AlbumCollectionOption
IsArchived={IsArchived(activeCollection)}
isArchived={isArchivedCollection(activeCollection)}
isPinned={isPinnedCollection(activeCollection)}
handleCollectionAction={handleCollectionAction}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function AddCollectionButton({ showNextModal }: Iprops) {
<CollectionCard
collectionTile={AllCollectionTile}
onClick={() => showNextModal()}
latestFile={null}>
coverFile={null}>
<AllCollectionTileText>
{t('CREATE_COLLECTION')}
</AllCollectionTileText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function CollectionSelectorCard({
return (
<CollectionCard
collectionTile={AllCollectionTile}
latestFile={collectionSummary.latestFile}
coverFile={collectionSummary.coverFile}
onClick={() => onCollectionClick(collectionSummary.id)}>
<AllCollectionTileText>
<Typography>{collectionSummary.name}</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ import {
DUMMY_UNCATEGORIZED_SECTION,
} from 'constants/collection';
import { t } from 'i18next';
import { isSelectAllowedCollection } from 'utils/collection';
import { createUnCategorizedCollection } from 'services/collectionService';
import {
isAddToAllowedCollection,
isMoveToAllowedCollection,
} from 'utils/collection';

export interface CollectionSelectorAttributes {
callback: (collection: Collection) => void;
Expand Down Expand Up @@ -56,15 +59,19 @@ function CollectionSelector({
?.filter(({ id, type }) => {
if (id === attributes.fromCollection) {
return false;
} else if (
attributes.intent === CollectionSelectorIntent.add
) {
return isAddToAllowedCollection(type);
} else if (
attributes.intent === CollectionSelectorIntent.upload
) {
return (
isSelectAllowedCollection(type) ||
isMoveToAllowedCollection(type) ||
type === CollectionSummaryType.uncategorized
);
} else {
return isSelectAllowedCollection(type);
return isMoveToAllowedCollection(type);
}
})
.sort((a, b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppContext } from 'pages/_app';
import React, { useContext } from 'react';
import { t } from 'i18next';
import { unshareCollection } from 'services/collectionService';
import { Collection } from 'types/collection';
import { Collection, CollectionUser } from 'types/collection';
import ShareeRow from './row';

interface Iprops {
Expand All @@ -15,7 +15,7 @@ export function CollectionShareSharees({ collection }: Iprops) {
const appContext = useContext(AppContext);
const galleryContext = useContext(GalleryContext);

const collectionUnshare = async (sharee) => {
const collectionUnshare = async (sharee: CollectionUser) => {
try {
appContext.startLoading();
await unshareCollection(collection, sharee.email);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { SpaceBetweenFlex } from 'components/Container';
import { User } from 'types/user';
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
import OverflowMenu from 'components/OverflowMenu/menu';

import NotInterestedIcon from '@mui/icons-material/NotInterested';
import { OverflowMenuOption } from 'components/OverflowMenu/option';
import { t } from 'i18next';
import { CollectionUser } from 'types/collection';

interface IProps {
sharee: User;
collectionUnshare: (sharee: User) => void;
sharee: CollectionUser;
collectionUnshare: (sharee: CollectionUser) => void;
}
const ShareeRow = ({ sharee, collectionUnshare }: IProps) => {
const handleClick = () => collectionUnshare(sharee);
Expand Down
3 changes: 0 additions & 3 deletions apps/photos/src/components/PhotoFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ interface Props {
deletedFileIds?: Set<number>;
setDeletedFileIds?: (value: Set<number>) => void;
activeCollection: number;
isIncomingSharedCollection?: boolean;
enableDownload?: boolean;
fileToCollectionsMap: Map<number, number[]>;
collectionNameMap: Map<number, string>;
Expand All @@ -61,7 +60,6 @@ const PhotoFrame = ({
deletedFileIds,
setDeletedFileIds,
activeCollection,
isIncomingSharedCollection,
enableDownload,
fileToCollectionsMap,
collectionNameMap,
Expand Down Expand Up @@ -529,7 +527,6 @@ const PhotoFrame = ({
favItemIds={favItemIds}
deletedFileIds={deletedFileIds}
setDeletedFileIds={setDeletedFileIds}
isIncomingSharedCollection={isIncomingSharedCollection}
isTrashCollection={activeCollection === TRASH_SECTION}
isHiddenCollection={activeCollection === HIDDEN_SECTION}
enableDownload={enableDownload}
Expand Down
Loading