Skip to content

Commit

Permalink
Merge branch 'develop' into release-79
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/core/apollo/generated/apollo-hooks.ts
#	src/domain/journey/space/SpaceContext/spaceProvider.graphql
  • Loading branch information
bobbykolev committed Jan 2, 2025
2 parents 23afa7e + db79669 commit 5a35444
Show file tree
Hide file tree
Showing 220 changed files with 6,081 additions and 4,788 deletions.
Binary file modified public/contributors/users-grayed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
238 changes: 223 additions & 15 deletions src/core/apollo/generated/apollo-helpers.ts

Large diffs are not rendered by default.

3,076 changes: 1,648 additions & 1,428 deletions src/core/apollo/generated/apollo-hooks.ts

Large diffs are not rendered by default.

4,500 changes: 2,362 additions & 2,138 deletions src/core/apollo/generated/graphql-schema.ts

Large diffs are not rendered by default.

40 changes: 36 additions & 4 deletions src/core/i18n/en/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1983,12 +1983,34 @@
}
}
},
"user": {
"settings": {
"title": "Settings",
"subtitle": "This section allows you to modify the User settings",
"communication": {
"allowOtherUsersToSendMessages": "Allow other users to message me."
},
"privacy": {
"contributorRolesVisible": "Show contributor roles to all registered users"
}
}
},
"organization": {
"create-organization": "Create organization",
"authorization": {
"preferences": {
"title": "Authorization",
"subtitle": "This section allows you to modify the organizations authorization"
"title": "Authorization",
"subtitle": "This section allows you to modify the organizations authorization"
},
"settings": {
"title": "Settings",
"subtitle": "This section allows you to modify the organization settings",
"membership": {
"usersMatchingEmail": "Allow users with emails matching the domain of the Organization to associate themselves."
},
"privacy": {
"title": "Privacy",
"subtitle": "This section allows you to modify the organization privacy settings",
"contributorRolesVisible": "Show contributor roles to all registered users"
}
},
"notifications": {
Expand Down Expand Up @@ -2823,7 +2845,8 @@
"back": "See all discussions"
},
"documentation": {
"title": "Documentation"
"title": "Documentation",
"subtitle": "Platform Manual & Support"
}
},
"operations": {
Expand Down Expand Up @@ -3145,6 +3168,15 @@
"initialPosts": "Initial Posts",
"delete": "Delete post"
},
"documents": {
"title": "Or add documents <tooltip><icon /></tooltip> to your Knowledge Subspace.",
"tooltip": "Supported file formats: Text on websites, .pdf, .doc(x), .xls(x). Maximum file size: 20mb",
"referenceTitle": "Reference Title",
"referenceUrl": "Url",
"addAnother": "Add another document",
"remove": "Remove document",
"initialDocuments": "Initial Links and Documents"
},
"submitDisabled": "Add at least one Post to continue"
},
"externalAI": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ui/content/LabeledCount.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Skeleton } from '@mui/material';
import OrganizationVerifiedStatus from '@/domain/community/organization/organizationVerifiedStatus/OrganizationVerifiedStatus';
import OrganizationVerifiedStatus from '@/domain/community/contributor/organization/OrganizationVerifiedStatus';
import CircleTag from '../tags/CircleTag';
import { Caption } from '../typography';

Expand Down
2 changes: 1 addition & 1 deletion src/domain/collaboration/CalloutPage/CalloutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { JourneyTypeName } from '@/domain/journey/JourneyTypeName';
import CalloutView from '../callout/CalloutView/CalloutView';
import { AuthorizationPrivilege, CalloutVisibility } from '@/core/apollo/generated/graphql-schema';
import { useCalloutEdit } from '../callout/edit/useCalloutEdit/useCalloutEdit';
import { TypedCalloutDetails } from '../callout/useCallouts/useCallouts';
import { TypedCalloutDetails } from '../calloutsSet/useCallouts/useCallouts';
import DialogWithGrid from '@/core/ui/dialog/DialogWithGrid';
import { useLocation } from 'react-router-dom';
import { DialogContent, Theme, useMediaQuery } from '@mui/material';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,25 @@ fragment InnovationFlowCollaboration on Collaboration {
id
myPrivileges
}
callouts(groups: $filterCalloutGroups) {
calloutsSet {
id
nameID
type
activity
sortOrder
framing {
callouts(groups: $filterCalloutGroups) {
id
profile {
nameID
type
activity
sortOrder
framing {
id
displayName
calloutGroupName: tagset(tagsetName: CALLOUT_GROUP) {
...TagsetDetails
}
flowState: tagset(tagsetName: FLOW_STATE) {
...TagsetDetails
profile {
id
displayName
calloutGroupName: tagset(tagsetName: CALLOUT_GROUP) {
...TagsetDetails
}
flowState: tagset(tagsetName: FLOW_STATE) {
...TagsetDetails
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { ButtonProps } from '@mui/material';
import ButtonWithTooltip from '@/core/ui/button/ButtonWithTooltip';
import InnovationFlowSettingsDialog from './InnovationFlowSettingsDialog';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/callout/CalloutsInContext/CalloutsGroup';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup';
import { SvgIconComponent } from '@mui/icons-material';

interface InnovationFlowSettingsButtonProps extends ButtonProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import InnovationFlowCollaborationToolsBlock from './InnovationFlowCollaboration
import PageContentBlockContextualMenu from '@/core/ui/content/PageContentBlockContextualMenu';
import WrapperMarkdown from '@/core/ui/markdown/WrapperMarkdown';
import ConfirmationDialog from '@/core/ui/dialogs/ConfirmationDialog';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/callout/CalloutsInContext/CalloutsGroup';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup';
import ImportTemplatesDialog from '@/domain/templates/components/Dialogs/ImportTemplateDialog/ImportTemplatesDialog';
import { TemplateType } from '@/core/apollo/generated/graphql-schema';
import { LoadingButton } from '@mui/lab';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Tagset,
UpdateProfileInput,
} from '@/core/apollo/generated/graphql-schema';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/callout/CalloutsInContext/CalloutsGroup';
import { CalloutGroupNameValuesMap } from '@/domain/collaboration/calloutsSet/CalloutsInContext/CalloutsGroup';
import { InnovationFlowState } from '../InnovationFlow';
import { sortCallouts } from '../utils/sortCallouts';
import { useMemo } from 'react';
Expand Down Expand Up @@ -64,12 +64,13 @@ const useInnovationFlowSettings = ({ collaborationId, filterCalloutGroups, skip
});

const collaboration = data?.lookup.collaboration;
const calloutsSetId = collaboration?.calloutsSet?.id;
const innovationFlow = collaboration?.innovationFlow;

// Collaboration
const callouts = useMemo(
() =>
collaboration?.callouts
collaboration?.calloutsSet.callouts
?.map<GroupedCallout>(callout => ({
id: callout.id,
nameID: callout.nameID,
Expand All @@ -82,7 +83,7 @@ const useInnovationFlowSettings = ({ collaborationId, filterCalloutGroups, skip
flowState: mapFlowState(callout.framing.profile.flowState),
}))
.sort((a, b) => a.sortOrder - b.sortOrder) ?? [],
[collaboration?.callouts]
[collaboration?.calloutsSet.callouts]
);

const [updateInnovationFlowCurrentState, { loading: changingState }] = useUpdateInnovationFlowCurrentStateMutation({
Expand Down Expand Up @@ -118,7 +119,7 @@ const useInnovationFlowSettings = ({ collaborationId, filterCalloutGroups, skip
const [updateCalloutsSortOrder, { loading: loadingSortOrder }] = useUpdateCalloutsSortOrderMutation();

const handleUpdateCalloutFlowState = async (calloutId: string, newState: string, insertIndex: number) => {
const callout = collaboration?.callouts?.find(({ id }) => id === calloutId);
const callout = collaboration?.calloutsSet.callouts?.find(({ id }) => id === calloutId);
const flowStateTagset = callout?.framing.profile.flowState;
if (!collaboration || !callout || !flowStateTagset) {
return;
Expand Down Expand Up @@ -171,7 +172,7 @@ const useInnovationFlowSettings = ({ collaborationId, filterCalloutGroups, skip

await updateCalloutsSortOrder({
variables: {
collaborationId: collaboration.id,
calloutsSetID: calloutsSetId!,
calloutIds: sortedCalloutIds,
},
refetchQueries: [refetchInnovationFlowSettingsQuery({ collaborationId: collaborationId!, filterCalloutGroups })],
Expand Down
14 changes: 7 additions & 7 deletions src/domain/collaboration/KnowledgeBase/KnowedgeBasePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { useRouteResolver } from '@/main/routing/resolvers/RouteResolver';
import { ContributeCreationBlock } from '@/domain/journey/common/tabs/Contribute/ContributeCreationBlock';
import MembershipBackdrop from '@/domain/shared/components/Backdrops/MembershipBackdrop';
import { EntityPageSection } from '@/domain/shared/layout/EntityPageSection';
import CalloutsGroupView from '../callout/CalloutsInContext/CalloutsGroupView';
import CalloutsGroupView from '../calloutsSet/CalloutsInContext/CalloutsGroupView';
import CalloutCreationDialog from '../callout/creationDialog/CalloutCreationDialog';
import { useCalloutCreationWithPreviewImages } from '../callout/creationDialog/useCalloutCreation/useCalloutCreationWithPreviewImages';
import { useCalloutCreationWithPreviewImages } from '../calloutsSet/useCalloutCreation/useCalloutCreationWithPreviewImages';
import KnowledgeBaseContainer from './KnowledgeBaseContainer';
import InfoColumn from '@/core/ui/content/InfoColumn';
import ContentColumn from '@/core/ui/content/ContentColumn';
Expand All @@ -16,7 +16,7 @@ import PageContentBlock from '@/core/ui/content/PageContentBlock';
import SpacePageLayout from '@/domain/journey/space/layout/SpacePageLayout';

const KnowledgeBasePage = () => {
const { journeyId, journeyPath, collaborationId } = useRouteResolver();
const { journeyId, journeyPath, collaborationId, calloutsSetId } = useRouteResolver();

const { t } = useTranslation();

Expand All @@ -26,19 +26,19 @@ const KnowledgeBasePage = () => {
handleCreateCalloutClosed,
handleCreateCallout,
loading: loadingCalloutCreation,
} = useCalloutCreationWithPreviewImages({ collaborationId });
} = useCalloutCreationWithPreviewImages({ calloutsSetId });

const handleCreate = () => {
handleCreateCalloutOpened();
};

return (
<SpacePageLayout journeyPath={journeyPath} currentSection={EntityPageSection.KnowledgeBase}>
<KnowledgeBaseContainer collaborationId={collaborationId} journeyTypeName="space">
<KnowledgeBaseContainer collaborationId={collaborationId}>
{({
callouts: {
loading,
canReadCallout,
canReadCalloutsSet: canReadCallout,
canCreateCallout,
groupedCallouts,
onCalloutsSortOrderUpdate,
Expand All @@ -63,7 +63,7 @@ const KnowledgeBasePage = () => {
<ContentColumn>
<CalloutsGroupView
journeyId={journeyId}
collaborationId={collaborationId}
calloutsSetId={calloutsSetId}
callouts={groupedCallouts[CalloutGroupName.Knowledge]}
canCreateCallout={canCreateCallout}
loading={loading}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import { SimpleContainerProps } from '@/core/container/SimpleContainer';
import useCallouts, { UseCalloutsProvided } from '../callout/useCallouts/useCallouts';
import { UseCalloutsProvided } from '../calloutsSet/useCallouts/useCallouts';
import { CalloutGroupName } from '@/core/apollo/generated/graphql-schema';
import { JourneyTypeName } from '@/domain/journey/JourneyTypeName';
import useCalloutsOnCollaboration from '../useCalloutsOnCollaboration';

interface KnowledgeBaseContainerProps
extends SimpleContainerProps<{
callouts: UseCalloutsProvided;
}> {
collaborationId: string | undefined;
journeyTypeName: JourneyTypeName;
}

const KnowledgeBaseContainer = ({ collaborationId, journeyTypeName, children }: KnowledgeBaseContainerProps) => {
const callouts = useCallouts({
const KnowledgeBaseContainer = ({ collaborationId, children }: KnowledgeBaseContainerProps) => {
const callouts = useCalloutsOnCollaboration({
collaborationId,
journeyTypeName,
canReadCollaboration: true,
groupNames: [CalloutGroupName.Knowledge],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ query CollaborationAuthorizationEntitlements($collaborationId: UUID!) {
id
availableEntitlements
}
calloutsSet {
id
authorization {
id
myPrivileges
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ type CollaborationAuthorizationEntitlementsParams = {
collaborationId: string | undefined;
};

type CollaborationAuthorization = {
type CollaborationAuthorizationType = {
collaborationPrivileges: AuthorizationPrivilege[];
canCreateCallout: boolean;
canSaveAsTemplate: boolean;
entitledToSaveAsTemplate: boolean;
canReadCallout: boolean;
canReadCollaboration: boolean;
calloutsSetId: string | undefined;
loading: boolean;
};

export const useCollaborationAuthorizationEntitlements = ({
collaborationId,
}: CollaborationAuthorizationEntitlementsParams): CollaborationAuthorization => {
// For now we always save as template to the current space, but in the future we may want to be able to choose an InnovationPack to save a callout to, and this would make no sense.
}: CollaborationAuthorizationEntitlementsParams): CollaborationAuthorizationType => {
// Currently, we only 'save as template' to the current space, but in the future we may want to be able to choose
// an InnovationPack to save a callout to, and this would make no sense.
// Remove this, and the templateSet privileges query from the SpaceProvider query
const { permissions } = useSpace();

Expand All @@ -29,21 +30,21 @@ export const useCollaborationAuthorizationEntitlements = ({
skip: !collaborationId,
});

const collaborationPrivileges = collaborationData?.lookup.collaboration?.authorization?.myPrivileges ?? [];
const collaborationEntitlements = collaborationData?.lookup.collaboration?.license?.availableEntitlements ?? [];
const canCreateCallout = collaborationPrivileges.includes(AuthorizationPrivilege.CreateCallout);
const collaboration = collaborationData?.lookup.collaboration;
const collaborationPrivileges = collaboration?.authorization?.myPrivileges ?? [];
const collaborationEntitlements = collaboration?.license?.availableEntitlements ?? [];
const canSaveAsTemplate = permissions.canCreateTemplates;
const canReadCallout = collaborationPrivileges.includes(AuthorizationPrivilege.Read);
const canReadCollaboration = collaborationPrivileges.includes(AuthorizationPrivilege.Read);

const entitledToSaveAsTemplate =
collaborationEntitlements?.includes(LicenseEntitlementType.SpaceFlagSaveAsTemplate) ?? false;

return {
collaborationPrivileges,
canCreateCallout,
canSaveAsTemplate,
entitledToSaveAsTemplate,
canReadCallout,
canReadCollaboration,
calloutsSetId: collaboration?.calloutsSet?.id,
loading: loadingCollaboration,
};
};
2 changes: 1 addition & 1 deletion src/domain/collaboration/callout/CalloutForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import CalloutWhiteboardField, {
WhiteboardFieldSubmittedValuesWithPreviewImages,
} from './creationDialog/CalloutWhiteboardField/CalloutWhiteboardField';
import { JourneyTypeName } from '@/domain/journey/JourneyTypeName';
import { JourneyCalloutGroupNameOptions } from './CalloutsInContext/CalloutsGroup';
import { JourneyCalloutGroupNameOptions } from '../calloutsSet/CalloutsInContext/CalloutsGroup';
import { DEFAULT_TAGSET } from '@/domain/common/tags/tagset.constants';
import PostTemplateSelector from '@/domain/templates/components/TemplateSelectors/PostTemplateSelector';
import WhiteboardTemplateSelector from '@/domain/templates/components/TemplateSelectors/WhiteboardTemplateSelector';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CalloutType } from '@/core/apollo/generated/graphql-schema';
import PostCallout from '../post/PostCallout';
import WhiteboardCollectionCallout from '../whiteboard/WhiteboardCollectionCallout';
import CommentsCallout from '../comments/CommentsCallout';
import { TypedCalloutDetails } from '../useCallouts/useCallouts';
import { TypedCalloutDetails } from '../../calloutsSet/useCallouts/useCallouts';
import { BaseCalloutViewProps } from '../CalloutViewTypes';
import LinkCollectionCallout from '../links/LinkCollectionCallout';
import SingleWhiteboardCallout from '../SingleWhiteboard/SingleWhiteboardCallout';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Ribbon } from '@/core/ui/card/Ribbon';
import { Reference, Tagset } from '@/domain/common/profile/Profile';
import References from '@/domain/shared/components/References/References';
import TagsComponent from '@/domain/shared/components/TagsComponent/TagsComponent';
import { WhiteboardFragmentWithCallout } from '../useCallouts/useCallouts';
import { WhiteboardFragmentWithCallout } from '../../calloutsSet/useCallouts/useCallouts';
import { LinkDetails } from '../links/LinkCollectionCallout';
import CalloutHeader from './CalloutHeader';
import CalloutClosedMarginal from './CalloutClosedMarginal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
} from '@mui/icons-material';
import { Reference, Tagset } from '@/domain/common/profile/Profile';
import { JourneyTypeName } from '@/domain/journey/JourneyTypeName';
import { WhiteboardFragmentWithCallout } from '../useCallouts/useCallouts';
import { WhiteboardFragmentWithCallout } from '../../calloutsSet/useCallouts/useCallouts';
import { FormatedLink, LinkDetails } from '../links/LinkCollectionCallout';
import ConfirmationDialog from '@/core/ui/dialogs/ConfirmationDialog';
import useLoadingState from '@/domain/shared/utils/useLoadingState';
Expand Down Expand Up @@ -351,7 +351,7 @@ const CalloutSettingsContainer = ({
<SortDialog
open={sortDialogOpen}
onClose={handleSortDialogClose}
collaborationId={callout.id}
calloutId={callout.id}
contributions={getCalloutItems(callout.type) || []}
onUpdateContributionsOrder={handleSortContributions}
/>
Expand Down
Loading

0 comments on commit 5a35444

Please sign in to comment.