diff --git a/components/lib/storySelector.tsx b/components/lib/storySelector.tsx deleted file mode 100644 index b027e362..00000000 --- a/components/lib/storySelector.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import * as React from 'react' -import { useContext } from 'react' -import { Select } from '@navikt/ds-react' -import { UserState } from '../../lib/context' - -type StorySelectorProps = { - register: any - group: string -} -export const StorySelector = ({ register, group }: StorySelectorProps) => { - const userInfo = useContext(UserState) - - const stories = [ - ...new Set( - userInfo?.stories - .filter((s) => s.owner?.group == group) - .map((s) => { - return { id: s.id, name: s.name } - }) - ), - ] - - return ( - - ) -} -export default StorySelector diff --git a/components/lib/tokenModal.tsx b/components/lib/tokenModal.tsx deleted file mode 100644 index a3ef8465..00000000 --- a/components/lib/tokenModal.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from 'react' -import { Modal } from '@navikt/ds-react' -import { useStoryTokenQuery } from '../../lib/schema/graphql' -import ErrorMessage from './error' -import LoaderSpinner from './spinner' -import Copy from './copy' - -interface tokenModalProps { - open: boolean - onCancel: () => void - id: string -} - -export const TokenModal = ({ id, open, onCancel }: tokenModalProps) => { - const token = useStoryTokenQuery({ variables: { id } }) - const updateLink = `${token.data?.storyToken.token}` - - return ( - - -
- {token.error && } - {token.loading || (!token.data && )} - {token.data && ( - - {updateLink} - - - )} -
-
-
- ) -} -export default TokenModal diff --git a/components/productArea/content.tsx b/components/productArea/content.tsx index 4af95247..6fe8c197 100644 --- a/components/productArea/content.tsx +++ b/components/productArea/content.tsx @@ -1,8 +1,7 @@ import { Tabs } from "@navikt/ds-react"; import { PAItem } from "../../pages/productArea/[id]"; import SearchResultLink from "../search/searchResultLink"; -import { Story, useProductAreasQuery, useTeamkatalogenQuery, useUserInfoDetailsQuery } from "../../lib/schema/graphql"; -import { owner } from "../../lib/schema/yupValidations"; +import { useProductAreasQuery, useTeamkatalogenQuery } from "../../lib/schema/graphql"; import { useContext } from "react"; import { UserState } from "../../lib/context"; @@ -12,27 +11,10 @@ interface ProductAreaContentProps { setCurrentTab: React.Dispatch> } -interface UnifiedStory{ - __typename?: "Story" | "QuartoStory" | undefined - id: string - name: string - created: any - keywords: string[] - description?: string - lastModified?: any - owner?: { - __typename?: "Owner" | undefined; - group: string; - teamkatalogenURL?: string; - } - } - const ProductAreaContent = ({ currentItem, currentTab, setCurrentTab }: ProductAreaContentProps) => { const tk = useTeamkatalogenQuery({ variables: { q: '' }, }) - var allStories = currentItem.stories.map(it=> it as UnifiedStory) - .concat(currentItem.quartoStories.map(it=> it as UnifiedStory)) const po = useProductAreasQuery() const userInfo= useContext(UserState) @@ -50,7 +32,7 @@ const ProductAreaContent = ({ currentItem, currentTab, setCurrentTab }: ProductA />}
- {allStories && allStories.map((s: any, idx: number) => ( + {currentItem.stories && currentItem.stories.map((s: any, idx: number) => ( ))} - {allStories.length == 0 && "Ingen fortellinger"} + {currentItem.stories.length == 0 && "Ingen fortellinger"}
it.dataproducts.length || it.stories.length || - it.quartoStories.length || it.insightProducts.length ).sort((l, r) => (l.name < r.name ? -1 : 1)) return ( @@ -48,7 +47,7 @@ const ProductAreaSidebar = ({
{productAreaItems.map((d: any, idx: number) => - d.stories.length + d.quartoStories.length + d.dataproducts.length + d.insightProducts.length ? ( + d.stories.length + d.dataproducts.length + d.insightProducts.length ? (
{' '} - {d.stories.length + d.quartoStories.length} + {d.stories.length}
@@ -102,7 +101,7 @@ const ProductAreaSidebar = ({ aria-label="datafortellinger" className="text-text-subtle" />{' '} - {d.stories.length + d.quartoStories.length} + {d.stories.length}
diff --git a/components/search/resultList.tsx b/components/search/resultList.tsx index 4fe2f8f0..c3ad23b3 100644 --- a/components/search/resultList.tsx +++ b/components/search/resultList.tsx @@ -3,7 +3,7 @@ import { Exact, SearchContentWithOptionsQuery, SearchOptions, - useDeleteQuartoStoryMutation, + useDeleteStoryMutation, useProductAreasQuery, useTeamkatalogenQuery, } from '../../lib/schema/graphql' @@ -38,13 +38,6 @@ type ResultListInterface = { __typename?: 'Story' id: string name: string - keywords?: string[] - owner?: { __typename?: 'Owner'; group: string } | null | undefined - }[] - quartoStories?: { - __typename?: 'QuartoStory' - id: string - name: string group: string keywords?: string[] teamkatalogenURL?: string | null | undefined @@ -68,7 +61,6 @@ const ResultList = ({ search, dataproducts, stories, - quartoStories, insightProducts, searchParam, updateQuery, @@ -96,9 +88,9 @@ const ResultList = ({ }) const po = useProductAreasQuery() - const [deleteQuartoQuery] = useDeleteQuartoStoryMutation() + const [deleteStoryQuery] = useDeleteStoryMutation() const userInfo= useContext(UserState) - const deleteQuarto = (id: string) => deleteQuartoQuery({ + const deleteStory = (id: string) => deleteStoryQuery({ variables:{ id: id }, @@ -120,9 +112,6 @@ const ResultList = ({ const datastories = data.search.filter( (d) => d.result.__typename === 'Story' ) - const quartostories = data.search.filter( - (d)=> d.result.__typename === 'QuartoStory' - ) return ( @@ -137,7 +126,7 @@ const ResultList = ({ {datastories.map( - (d, idx) => - d.result.__typename === 'Story' && ( - - ) - ).concat(quartostories.map( (it, idx)=> ( - it.result.__typename ==='QuartoStory' && ( + it.result.__typename ==='Story' && ( {dataproducts.map( @@ -224,11 +198,11 @@ const ResultList = ({ ) } - if (stories || quartoStories) { + if (stories) { return (
- {quartoStories?.map((s, idx) => ( + {stories?.map((s, idx) => ( - ))} - {stories?.map((s, idx) => ( - ))} diff --git a/components/search/searchResultLink.tsx b/components/search/searchResultLink.tsx index ff4f3091..5fdea6bb 100644 --- a/components/search/searchResultLink.tsx +++ b/components/search/searchResultLink.tsx @@ -3,7 +3,7 @@ import { Detail, Heading, Link } from '@navikt/ds-react' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { CoApplicant, Table } from '@navikt/ds-icons' -import { ProductAreasQuery, TeamkatalogenQuery, useDeleteInsightProductMutation, useDeleteQuartoStoryMutation } from '../../lib/schema/graphql' +import { ProductAreasQuery, TeamkatalogenQuery, useDeleteInsightProductMutation, useDeleteStoryMutation } from '../../lib/schema/graphql' import humanizeDate from '../../lib/humanizeDate' import DeleteModal from '../lib/deleteModal' import { useState } from 'react' @@ -63,8 +63,8 @@ export const SearchResultLink = ({ const [deleteInsightProductMutation] = useDeleteInsightProductMutation(); const editResource = () => { - if (resourceType == 'Quarto fortelling') { - router.push(`/quarto/${id}/edit`) + if (resourceType == 'datafortelling') { + router.push(`/story/${id}/edit`) } else if (resourceType == 'innsiktsprodukt') { router.push(`/insightProduct/edit?id=${id}`) } @@ -122,7 +122,7 @@ export const SearchResultLink = ({
{editable &&
Endre beskrivelse + >Endre metadata Slett
}
diff --git a/components/stories/editForm.tsx b/components/stories/editForm.tsx deleted file mode 100644 index 067de7d1..00000000 --- a/components/stories/editForm.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { Fieldset } from '@navikt/ds-react' -import { - StoryQuery, - useUpdateStoryMetadataMutation, -} from '../../lib/schema/graphql' -import TopBar from '../lib/topBar' -import RightJustifiedSubmitButton from '../widgets/formSubmit' -import { useRouter } from 'next/router' -import { useForm } from 'react-hook-form' -import TeamkatalogenSelector from '../lib/teamkatalogenSelector' -import { StoryDocument } from '../../lib/schema/graphql' -import { useState } from 'react' -import { editStoryValidation } from '../../lib/schema/yupValidations' -import { yupResolver } from '@hookform/resolvers/yup' -import TagsSelector from '../lib/tagsSelector' - -interface SaveFormProps { - story: StoryQuery['story'] -} - -function EditForm({ story }: SaveFormProps) { - const router = useRouter() - const { register, handleSubmit, formState, watch, setValue } = useForm({ - resolver: yupResolver(editStoryValidation), - defaultValues: { - keywords: story.keywords, - teamkatalogenURL: story.owner.teamkatalogenURL, - }, - }) - const [productAreaID, setProductAreaID] = useState('') - const [teamID, setTeamID] = useState('') - - const { errors } = formState - const keywords = watch('keywords') - - const onDelete = (keyword: string) => { - setValue( - 'keywords', - keywords.filter((k: string) => k !== keyword) - ) - } - - const onAdd = (keyword: string) => { - keywords - ? setValue('keywords', [...keywords, keyword]) - : setValue('keywords', [keyword]) - } - - const [updateStoryMetadata] = useUpdateStoryMetadataMutation() - - const onSubmit = (requestData: any) => { - updateStoryMetadata({ - refetchQueries: [ - 'searchContent', - { - query: StoryDocument, - variables: { id: story.id }, - }, - ], - variables: { - id: story.id, - name: story.name, - keywords, - teamkatalogenURL: requestData.teamkatalogenURL, - productAreaID: productAreaID, - teamID: teamID, - }, - }) - .then((published: any) => { - if (published.errors) { - console.log(published.errors) - } - if (published.data) { - router.push(`/story/${published.data?.updateStoryMetadata.id}`) - } - }) - .catch((error: Error) => { - console.log(error) - }) - } - - return ( -
- -
-
-
- - - router.push(`/story/${story.id}`)} - /> -
-
-
-
- ) -} - -export default EditForm diff --git a/components/stories/editQuartoStoryMetadata.tsx b/components/stories/editStoryMetadata.tsx similarity index 88% rename from components/stories/editQuartoStoryMetadata.tsx rename to components/stories/editStoryMetadata.tsx index a3155b93..005746b6 100644 --- a/components/stories/editQuartoStoryMetadata.tsx +++ b/components/stories/editStoryMetadata.tsx @@ -1,8 +1,7 @@ import { yupResolver } from '@hookform/resolvers/yup' -import { FieldValues, useForm } from 'react-hook-form' +import { useForm } from 'react-hook-form' import ErrorMessage from '../lib/error' import { useRouter } from 'next/router' -import { useMutation } from '@apollo/client' import TeamkatalogenSelector from '../lib/teamkatalogenSelector' import DescriptionEditor from '../lib/DescriptionEditor' import { @@ -16,8 +15,7 @@ import * as yup from 'yup' import { useContext, useState } from 'react' import TagsSelector from '../lib/tagsSelector' import {UserState} from "../../lib/context"; -import { UPDATE_QUARTOSTORY_METADATA } from '../../lib/queries/story/updateQuartoStory' -import { useUpdateQuartoStoryMetadataMutation } from '../../lib/schema/graphql' +import { useUpdateStoryMetadataMutation } from '../../lib/schema/graphql' import { USER_INFO } from '../../lib/queries/userInfo/userInfo' const schema = yup.object().shape({ @@ -29,7 +27,7 @@ const schema = yup.object().shape({ }) -export interface EditQuartoStoryMetadataFields { +export interface EditStoryMetadataFields { id: string name: string description: string @@ -38,12 +36,12 @@ export interface EditQuartoStoryMetadataFields { group: string } -export const EditQuartoStoryMetadataForm = ({id, name, description, keywords, teamkatalogenURL, group}: EditQuartoStoryMetadataFields) => { +export const EditStoryMetadataForm = ({id, name, description, keywords, teamkatalogenURL, group}: EditStoryMetadataFields) => { const router = useRouter() const [productAreaID, setProductAreaID] = useState('') const [teamID, setTeamID] = useState('') const userInfo = useContext(UserState) - const [updateQuartoQuery, {loading, error}] = useUpdateQuartoStoryMetadataMutation() + const [updateStoryQuery, {loading, error}] = useUpdateStoryMetadataMutation() const { register, handleSubmit, @@ -78,10 +76,8 @@ export const EditQuartoStoryMetadataForm = ({id, name, description, keywords, te : setValue('keywords', [keyword]) } - const valueOrNull = (val: string) => (val == '' ? null : val) - const onSubmit = async (data: any) => { - const editQuartoData = { + const editStoryData = { variables: { id: id, name: data.name, @@ -99,7 +95,7 @@ export const EditQuartoStoryMetadataForm = ({id, name, description, keywords, te ] } - updateQuartoQuery(editQuartoData).then(()=>{ + updateStoryQuery(editStoryData).then(()=>{ amplitudeLog('skjema fullført', { skjemanavn: 'endre-datafortelling' }) router.back() }).catch(e=>{ diff --git a/components/stories/header.tsx b/components/stories/header.tsx deleted file mode 100644 index 3b159962..00000000 --- a/components/stories/header.tsx +++ /dev/null @@ -1,25 +0,0 @@ -interface HeaderProps { - text: string - size: number -} - -function Header({ text, size }: HeaderProps) { - switch (size) { - case 1: - return

{text}

- case 2: - return

{text}

- case 3: - return

{text}

- case 4: - return

{text}

- case 5: - return
{text}
- case 6: - return
{text}
- default: - return

{text}

- } -} - -export default Header diff --git a/components/stories/metadataTable.tsx b/components/stories/metadataTable.tsx deleted file mode 100644 index 0797111d..00000000 --- a/components/stories/metadataTable.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import humanizeDate from '../../lib/humanizeDate' -import * as React from 'react' -import { ExternalLink } from '@navikt/ds-icons' -import { StoryQuery } from '../../lib/schema/graphql' -import { Link } from '@navikt/ds-react' -import { TagPill } from '../lib/tagPill' - -interface StoryProps { - children?: React.ReactNode - owner: StoryQuery['story']['owner'] - created: string - lastModified: string - keywords: string[] | undefined -} - -export const MetadataTable = ({ - owner, - created, - lastModified, - keywords, - children, -}: StoryProps) => { - console.log(owner) - return ( -
-
    - {children} - {owner?.group && ( - <> -
  • -

    Eier

    -
    - {owner?.teamID && owner?.teamkatalogenURL ? ( - - {owner.group.split('@')[0]} - - ) : ( - owner?.group.split('@')[0] - )} -
    -
  • - - )} -
  • -

    Opprettet

    -
    {humanizeDate(created)}
    -
  • - {lastModified && ( - <> -
  • -

    Oppdatert

    -
    - {humanizeDate(lastModified, 'PP HH:mm')} -
    -
  • - - )} - {!!keywords && keywords.length > 0 && ( - <> -
  • -

    Nøkkelord

    -
    - {!!keywords && ( - <> - {keywords.map((k, i) => ( - - {k} - - ))} - - )} -
    -
  • - - )} -
-
- ) -} diff --git a/components/stories/newStory.tsx b/components/stories/newStory.tsx index 3b233fd0..6ce524d2 100644 --- a/components/stories/newStory.tsx +++ b/components/stories/newStory.tsx @@ -11,11 +11,10 @@ import * as yup from 'yup'; import { ChangeEvent, useContext, useRef, useState } from 'react'; import TagsSelector from '../lib/tagsSelector'; import { UserState } from '../../lib/context'; -import { CREATE_QUARTO_STORY } from '../../lib/queries/story/createQuartoStory'; +import { CREATE_STORY } from '../../lib/queries/story/createStory'; import { TreeItem, TreeView } from '@mui/lab'; import { FileTextFillIcon, FolderFillIcon, TrashIcon } from '@navikt/aksel-icons'; -import { Header } from '@navikt/ds-react-internal'; -import { UploadFile, useCreateQuartoStoryMutation } from '../../lib/schema/graphql'; +import { UploadFile } from '../../lib/schema/graphql'; const defaultValues: FieldValues = { name: null, @@ -44,7 +43,7 @@ export const NewStoryForm = () => { const [teamID, setTeamID] = useState(''); const userInfo = useContext(UserState); const [inputKey, setInputKey] = useState(0); - const [quartoFiles, setQuartoFiles] = useState([]); + const [storyFiles, setStoryFiles] = useState([]); const singleFileInputRef = useRef(null); const folderFileInputRef = useRef(null); @@ -91,7 +90,7 @@ export const NewStoryForm = () => { const onSubmit = async (data: any) => { const uploadData = { variables: { - files: quartoFiles.map(it=>({ + files: storyFiles.map(it=>({ path: fixRelativePath(it), file: it, })), @@ -120,10 +119,10 @@ export const NewStoryForm = () => { } const [createStory, { loading, error: backendError }] = useMutation( - CREATE_QUARTO_STORY, + CREATE_STORY, { onCompleted: (data) => { - router.push(`/quarto/${data.createQuartoStory.id}`); + router.push(`/story/${data.createStory.id}`); }, }, ) @@ -152,7 +151,7 @@ export const NewStoryForm = () => { const handleFileUpload = (event: ChangeEvent) => { const files = event.target.files; if (files && files.length > 0) { - setQuartoFiles(Array.from(files)); + setStoryFiles(Array.from(files)); } } @@ -197,10 +196,10 @@ export const NewStoryForm = () => { const handleDeleteClick = (isFile: boolean, node: any) => { var filesToDelete = isFile ? [node] : gatherFilesToDelete(node) - const remained = quartoFiles.filter((file) => { + const remained = storyFiles.filter((file) => { return !filesToDelete.find(it => it == file) }) - setQuartoFiles(remained); + setStoryFiles(remained); setInputKey(inputKey + 1) }; @@ -310,9 +309,9 @@ export const NewStoryForm = () => { {/* @ts-expect-error */} - {quartoFiles.length > 0 && ( + {storyFiles.length > 0 && ( - {renderTree(generateFileTree(quartoFiles))} + {renderTree(generateFileTree(storyFiles))} )} {backendError && } diff --git a/components/stories/plotly.tsx b/components/stories/plotly.tsx deleted file mode 100644 index fbe14704..00000000 --- a/components/stories/plotly.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { usePlotlyViewQuery } from '../../lib/schema/graphql' - -//@ts-ignore -import Plot from 'react-plotly.js' -import LoaderSpinner from '../lib/spinner' -import ErrorMessage from '../lib/error' - -interface ResultsProps { - id: string -} - -export function Plotly({ id }: ResultsProps) { - const { data, loading, error } = usePlotlyViewQuery({ - variables: { id }, - }) - if (error) return - if (loading || !data) return - const spec = JSON.parse(JSON.stringify(data.storyView)) - spec.layout.width = undefined - spec.layout.autosize = true - return ( -
- -
- ) -} - -export default Plotly diff --git a/components/stories/story.tsx b/components/stories/story.tsx deleted file mode 100644 index 4212c245..00000000 --- a/components/stories/story.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import { InView } from 'react-intersection-observer' -import { StoryQuery } from '../../lib/schema/graphql' -import ReactMarkdown from 'react-markdown' -import remarkGfm from 'remark-gfm' -import Header from './header' -import LoaderSpinner from '../lib/spinner' -import TopBar from '../lib/topBar' -import * as React from 'react' -import Link from 'next/link' -import { Dispatch, SetStateAction } from 'react' -import VegaView from './vegaView' -import { MetadataTable } from './metadataTable' -import dynamic from 'next/dynamic' - -interface StoryProps { - isOwner?: boolean - story: StoryQuery['story'] - draft?: boolean - setShowDelete?: Dispatch> - setShowToken?: Dispatch> -} - -export function Story({ - story, - draft, - isOwner, - setShowDelete, - setShowToken, -}: StoryProps) { - const views = story.views as StoryQuery['story']['views'] - const Plotly = dynamic(() => import("./plotly")); - - return ( -
- -
-
- {views.map((view, id) => { - if (view.__typename === 'StoryViewHeader') { - return
- } - - if (view.__typename === 'StoryViewMarkdown') { - return ( - - {view.content} - - ) - } - if (view.__typename === 'StoryViewPlotly') { - return ( - - {({ inView, ref }) => { - return inView ? ( -
- -
- ) : ( -
- -
- ) - }} -
- ) - } - if (view.__typename === 'StoryViewVega') { - return ( - - {({ inView, ref }) => { - return inView ? ( -
- -
- ) : ( -
- -
- ) - }} -
- ) - } - })} -
-
-
- ); -} - -export default Story diff --git a/components/stories/vegaView.tsx b/components/stories/vegaView.tsx deleted file mode 100644 index 3dbefc57..00000000 --- a/components/stories/vegaView.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { StoryViewVega, useVegaViewQuery } from '../../lib/schema/graphql' -import { VegaLite, Vega } from 'react-vega' - -import LoaderSpinner from '../lib/spinner' -import ErrorMessage from '../lib/error' - -interface ResultsProps { - id: string -} - -export function VegaView({ id }: ResultsProps) { - const { data, loading, error } = useVegaViewQuery({ - variables: { id }, - }) - if (error) return - if (loading || !data) return - const storyViews = data.storyView as StoryViewVega - - let storyView = JSON.parse(JSON.stringify(storyViews.spec)) - storyView.width = 'container' - if (storyView.$schema?.includes('vega-lite')) { - return ( -
- -
- ) - } - return ( -
- -
- ) -} - -export default VegaView diff --git a/lib/queries/productAreas/productArea.ts b/lib/queries/productAreas/productArea.ts index 47513e66..005f732f 100644 --- a/lib/queries/productAreas/productArea.ts +++ b/lib/queries/productAreas/productArea.ts @@ -24,18 +24,6 @@ export const GET_PRODUCT_AREA = gql` } } stories{ - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - teamContact - } - } - quartoStories{ id name created @@ -74,18 +62,6 @@ export const GET_PRODUCT_AREA = gql` } } stories{ - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - teamContact - } - } - quartoStories{ id name created diff --git a/lib/queries/productAreas/productAreas.ts b/lib/queries/productAreas/productAreas.ts index a9944552..98c00a6f 100644 --- a/lib/queries/productAreas/productAreas.ts +++ b/lib/queries/productAreas/productAreas.ts @@ -15,17 +15,6 @@ export const GET_PRODUCT_AREAS = gql` } } stories{ - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - } - } - quartoStories{ id name description @@ -55,10 +44,6 @@ export const GET_PRODUCT_AREAS = gql` id name } - quartoStories{ - id - name - } insightProducts{ id name diff --git a/lib/queries/search/searchResultWithOptions.ts b/lib/queries/search/searchResultWithOptions.ts index 6f601679..b530c974 100644 --- a/lib/queries/search/searchResultWithOptions.ts +++ b/lib/queries/search/searchResultWithOptions.ts @@ -32,18 +32,6 @@ export const SEARCH_CONTENT_WITH_OPTIONS = gql` } } ... on Story { - __typename - id - name - created - keywords - modified: lastModified - group: owner { - group - teamkatalogenURL - } - } - ... on QuartoStory { __typename id name diff --git a/lib/queries/story/createQuartoStory.ts b/lib/queries/story/createQuartoStory.ts deleted file mode 100644 index 5d4a3887..00000000 --- a/lib/queries/story/createQuartoStory.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CREATE_QUARTO_STORY = gql` - mutation createQuartoStory($files: [UploadFile!]!, $input: NewQuartoStory!) { - createQuartoStory(files: $files, input: $input) { - id - } - } -` diff --git a/lib/queries/story/createStory.ts b/lib/queries/story/createStory.ts new file mode 100644 index 00000000..bee02c55 --- /dev/null +++ b/lib/queries/story/createStory.ts @@ -0,0 +1,9 @@ +import { gql } from 'graphql-tag' + +export const CREATE_STORY = gql` + mutation createStory($files: [UploadFile!]!, $input: NewStory!) { + createStory(files: $files, input: $input) { + id + } + } +` diff --git a/lib/queries/story/deleteQuartoStory.ts b/lib/queries/story/deleteQuartoStory.ts deleted file mode 100644 index 28dfa1ad..00000000 --- a/lib/queries/story/deleteQuartoStory.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const DELETE_QUARTOSTORY = gql` - mutation deleteQuartoStory($id: ID!) { - deleteQuartoStory(id: $id) - } -` \ No newline at end of file diff --git a/lib/queries/story/deleteStory.ts b/lib/queries/story/deleteStory.ts index 6db69e04..ca68421c 100644 --- a/lib/queries/story/deleteStory.ts +++ b/lib/queries/story/deleteStory.ts @@ -1,7 +1,7 @@ import { gql } from 'graphql-tag' -export const DELETE_DATASTORY = gql` +export const DELETE_STORY = gql` mutation deleteStory($id: ID!) { deleteStory(id: $id) } -` +` \ No newline at end of file diff --git a/lib/queries/story/plotly.ts b/lib/queries/story/plotly.ts deleted file mode 100644 index 54060873..00000000 --- a/lib/queries/story/plotly.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GET_PLOTLY = gql` - query PlotlyView($id: ID!) { - storyView(id: $id) { - ... on StoryViewPlotly { - id - data - layout - frames - } - } - } -` diff --git a/lib/queries/story/publish.ts b/lib/queries/story/publish.ts deleted file mode 100644 index 555c308c..00000000 --- a/lib/queries/story/publish.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const PUBLISH_STORY = gql` - mutation publishStory($input: NewStory!) { - publishStory(input: $input) { - id - } - } -` diff --git a/lib/queries/story/quartoStory.ts b/lib/queries/story/quartoStory.ts deleted file mode 100644 index 52cb9dfa..00000000 --- a/lib/queries/story/quartoStory.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GET_QUARTOSTORY = gql` - query quartoStory($id: ID!) { - quartoStory(id: $id) { - id - name - description - created - lastModified - keywords - group - teamkatalogenURL - productAreaID - teamID - } - } -` \ No newline at end of file diff --git a/lib/queries/story/stories.ts b/lib/queries/story/stories.ts deleted file mode 100644 index ec76e62a..00000000 --- a/lib/queries/story/stories.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GET_STORIES = gql` - query stories { - stories { - id - name - owner { - group - teamkatalogenURL - } - } - } -` diff --git a/lib/queries/story/story.ts b/lib/queries/story/story.ts index c71ed05c..ba225ffd 100644 --- a/lib/queries/story/story.ts +++ b/lib/queries/story/story.ts @@ -1,30 +1,18 @@ import { gql } from 'graphql-tag' export const GET_STORY = gql` - query Story($id: ID!) { - story(id: $id) { + query dataStory($id: ID!) { + dataStory(id: $id) { id name + description created lastModified keywords - owner { - group - teamkatalogenURL - productAreaID - teamID - } - views { - id - __typename - ... on StoryViewHeader { - content - level - } - ... on StoryViewMarkdown { - content - } - } + group + teamkatalogenURL + productAreaID + teamID } } -` +` \ No newline at end of file diff --git a/lib/queries/story/storyToken.ts b/lib/queries/story/storyToken.ts deleted file mode 100644 index 1c050046..00000000 --- a/lib/queries/story/storyToken.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GET_STORYTOKEN = gql` - query StoryToken($id: ID!) { - storyToken(id: $id) { - token - } - } -` diff --git a/lib/queries/story/updateQuartoStory.ts b/lib/queries/story/updateQuartoStory.ts deleted file mode 100644 index 5ce4a23e..00000000 --- a/lib/queries/story/updateQuartoStory.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UPDATE_QUARTOSTORY_METADATA = gql` - mutation updateQuartoStoryMetadata( - $id: ID! - $name: String! - $description: String! - $keywords: [String!]! - $teamkatalogenURL: String - $productAreaID: String - $teamID: String - $group: String! - ) { - updateQuartoStoryMetadata( - id: $id - name: $name - description: $description - keywords: $keywords - teamkatalogenURL: $teamkatalogenURL - productAreaID: $productAreaID - teamID: $teamID - group: $group - ) { - id - } - } -` \ No newline at end of file diff --git a/lib/queries/story/update.ts b/lib/queries/story/updateStory.ts similarity index 82% rename from lib/queries/story/update.ts rename to lib/queries/story/updateStory.ts index 287e2437..5eafedf1 100644 --- a/lib/queries/story/update.ts +++ b/lib/queries/story/updateStory.ts @@ -3,21 +3,25 @@ import { gql } from 'graphql-tag' export const UPDATE_STORY_METADATA = gql` mutation updateStoryMetadata( $id: ID! - $keywords: [String!]! $name: String! + $description: String! + $keywords: [String!]! $teamkatalogenURL: String $productAreaID: String $teamID: String + $group: String! ) { updateStoryMetadata( id: $id - keywords: $keywords name: $name + description: $description + keywords: $keywords teamkatalogenURL: $teamkatalogenURL productAreaID: $productAreaID teamID: $teamID + group: $group ) { id } } -` +` \ No newline at end of file diff --git a/lib/queries/story/vega.ts b/lib/queries/story/vega.ts deleted file mode 100644 index d0a21f9a..00000000 --- a/lib/queries/story/vega.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GET_PLOTLY = gql` - query VegaView($id: ID!) { - storyView(id: $id) { - ... on StoryViewVega { - id - spec - } - } - } -` diff --git a/lib/queries/userInfo/userInfo.ts b/lib/queries/userInfo/userInfo.ts index 55f74a45..7cd71327 100644 --- a/lib/queries/userInfo/userInfo.ts +++ b/lib/queries/userInfo/userInfo.ts @@ -69,15 +69,6 @@ export const USER_INFO = gql` } } stories { - id - name - keywords - owner { - group - teamkatalogenURL - } - } - quartoStories { id name description diff --git a/lib/schema/graphql.ts b/lib/schema/graphql.ts index 944a51a0..752f868e 100644 --- a/lib/schema/graphql.ts +++ b/lib/schema/graphql.ts @@ -366,11 +366,11 @@ export type Mutation = { */ createJoinableViews: Scalars['String']; /** - * createQuartoStory creates a quarto story. + * createStory creates a data story. * * Requires authentication. */ - createQuartoStory: QuartoStory; + createStory: Story; /** * deleteAccessRequest deletes a dataset access request. * @@ -396,13 +396,7 @@ export type Mutation = { */ deleteInsightProduct: Scalars['Boolean']; /** - * deleteQuartoStory deletes an existing quarto story. - * - * Requires authentication. - */ - deleteQuartoStory: Scalars['Boolean']; - /** - * deleteStory deletes an existing story. + * deleteStory deletes an existing data story. * * Requires authentication. */ @@ -427,12 +421,6 @@ export type Mutation = { * Requires authentication */ mapDataset: Scalars['Boolean']; - /** - * publishStory publishes a story draft. - * - * Requires authentication. - */ - publishStory: Story; /** * revokeAccessToDataset revokes access for a subject to the dataset. * @@ -471,13 +459,7 @@ export type Mutation = { */ updateKeywords: Scalars['Boolean']; /** - * updateQuartoStoryMetadata updates metadata on an existing quarto story. - * - * Requires authentication. - */ - updateQuartoStoryMetadata: QuartoStory; - /** - * updateStoryMetadata updates metadata on an existing story. + * updateStoryMetadata updates metadata on an existing data story. * * Requires authentication. */ @@ -515,9 +497,9 @@ export type MutationCreateJoinableViewsArgs = { }; -export type MutationCreateQuartoStoryArgs = { +export type MutationCreateStoryArgs = { files: Array; - input: NewQuartoStory; + input: NewStory; }; @@ -541,11 +523,6 @@ export type MutationDeleteInsightProductArgs = { }; -export type MutationDeleteQuartoStoryArgs = { - id: Scalars['ID']; -}; - - export type MutationDeleteStoryArgs = { id: Scalars['ID']; }; @@ -573,11 +550,6 @@ export type MutationMapDatasetArgs = { }; -export type MutationPublishStoryArgs = { - input: NewStory; -}; - - export type MutationRevokeAccessToDatasetArgs = { id: Scalars['ID']; }; @@ -619,7 +591,7 @@ export type MutationUpdateKeywordsArgs = { }; -export type MutationUpdateQuartoStoryMetadataArgs = { +export type MutationUpdateStoryMetadataArgs = { description: Scalars['String']; group: Scalars['String']; id: Scalars['ID']; @@ -630,17 +602,7 @@ export type MutationUpdateQuartoStoryMetadataArgs = { teamkatalogenURL?: InputMaybe; }; - -export type MutationUpdateStoryMetadataArgs = { - id: Scalars['ID']; - keywords: Array; - name: Scalars['String']; - productAreaID?: InputMaybe; - teamID?: InputMaybe; - teamkatalogenURL?: InputMaybe; -}; - -/** NadaToken contains the team token of the corresponding team for updating quarto stories */ +/** NadaToken contains the team token of the corresponding team for updating data stories */ export type NadaToken = { __typename?: 'NadaToken'; /** name of team */ @@ -765,42 +727,23 @@ export type NewJoinableViews = { name: Scalars['String']; }; -/** NewQuartoStory contains the metadata and content of quarto stories. */ -export type NewQuartoStory = { - /** description of the quarto story. */ +/** NewStory contains the metadata and content of data stories. */ +export type NewStory = { + /** description of the data story. */ description?: InputMaybe; - /** group is the owner group of the quarto */ + /** group is the owner group of the data story. */ group: Scalars['String']; - /** id of the quarto story. */ + /** id of the data story. */ id?: InputMaybe; /** keywords for the story used as tags. */ keywords: Array; - /** name of the quarto story. */ + /** name of the data story. */ name: Scalars['String']; /** Id of the creator's product area. */ productAreaID?: InputMaybe; /** Id of the creator's team. */ teamID?: InputMaybe; - /** teamkatalogenURL of the creator */ - teamkatalogenURL?: InputMaybe; -}; - -export type NewStory = { - /** group is the owner group for the story. */ - group: Scalars['String']; - /** id is the id for the draft story. */ - id: Scalars['ID']; - /** keywords for the datastory used as tags. */ - keywords?: InputMaybe>; - /** name is the title of the story */ - name: Scalars['String']; - /** Id of the team's product area. */ - productAreaID?: InputMaybe; - /** target is the id of the published story to overwrite. Keep empty to create new story. */ - target?: InputMaybe; - /** Id of the team. */ - teamID?: InputMaybe; - /** owner Teamkatalogen URL for the dataproduct. */ + /** teamkatalogenURL of the creator. */ teamkatalogenURL?: InputMaybe; }; @@ -863,8 +806,6 @@ export type ProductArea = { insightProducts: Array; /** name is the name of the product area. */ name: Scalars['String']; - /** quarto stories is the stories owned by the product area. */ - quartoStories: Array; /** stories is the stories owned by the product area. */ stories: Array; /** teams is the teams in the product area. */ @@ -882,33 +823,6 @@ export type PseudoDataset = { name: Scalars['String']; }; -/** QuartoStory contains the metadata and content of data stories. */ -export type QuartoStory = { - __typename?: 'QuartoStory'; - /** created is the timestamp for when the dataproduct was created */ - created: Scalars['Time']; - /** creator of the quarto story. */ - creator: Scalars['String']; - /** description of the quarto story. */ - description: Scalars['String']; - /** group is the owner group of the quarto */ - group: Scalars['String']; - /** id of the quarto story. */ - id: Scalars['ID']; - /** keywords for the story used as tags. */ - keywords: Array; - /** lastModified is the timestamp for when the dataproduct was last modified */ - lastModified?: Maybe; - /** name of the quarto story. */ - name: Scalars['String']; - /** Id of the creator's product area. */ - productAreaID?: Maybe; - /** Id of the creator's team. */ - teamID?: Maybe; - /** teamkatalogenURL of the creator */ - teamkatalogenURL?: Maybe; -}; - export type Query = { __typename?: 'Query'; /** searches slack public channels to validate the channel name */ @@ -919,6 +833,8 @@ export type Query = { accessRequestsForDataset: Array; /** accessiblePseudoDatasets returns the pseudo datasets the user has access to. */ accessiblePseudoDatasets: Array; + /** dataStory returns the given story. */ + dataStory: Story; /** dataproduct returns the given dataproduct. */ dataproduct: Dataproduct; /** dataproducts returns a list of dataproducts. Pagination done using the arguments. */ @@ -961,22 +877,8 @@ export type Query = { productArea: ProductArea; /** productAreas returns all product areas. */ productAreas: Array; - /** quartoStory returns the given story. */ - quartoStory: QuartoStory; /** search through existing dataproducts. */ search: Array; - /** stories returns all either draft or published stories depending on the draft boolean. */ - stories: Array; - /** story returns the given story. */ - story: Story; - /** - * storyToken returns the update token for the data story. - * - * Requires authentication. - */ - storyToken: StoryToken; - /** storyView returns the given story view. */ - storyView: StoryView; /** team returns the given team. */ team: Team; /** searches teamkatalogen for teams where team name matches query input */ @@ -1003,6 +905,11 @@ export type QueryAccessRequestsForDatasetArgs = { }; +export type QueryDataStoryArgs = { + id: Scalars['ID']; +}; + + export type QueryDataproductArgs = { id: Scalars['ID']; }; @@ -1074,37 +981,12 @@ export type QueryProductAreaArgs = { }; -export type QueryQuartoStoryArgs = { - id: Scalars['ID']; -}; - - export type QuerySearchArgs = { options?: InputMaybe; q?: InputMaybe; }; -export type QueryStoriesArgs = { - draft?: InputMaybe; -}; - - -export type QueryStoryArgs = { - id: Scalars['ID']; -}; - - -export type QueryStoryTokenArgs = { - id: Scalars['ID']; -}; - - -export type QueryStoryViewArgs = { - id: Scalars['ID']; -}; - - export type QueryTeamArgs = { id: Scalars['String']; }; @@ -1174,7 +1056,7 @@ export type SearchQuery = { text?: InputMaybe; }; -export type SearchResult = Dataproduct | QuartoStory | Story; +export type SearchResult = Dataproduct | Story; export type SearchResultRow = { __typename?: 'SearchResultRow'; @@ -1190,76 +1072,28 @@ export enum SearchType { /** Story contains the metadata and content of data stories. */ export type Story = { __typename?: 'Story'; - /** created is the timestamp for when the data story was created. */ + /** created is the timestamp for when the data story was created */ created: Scalars['Time']; + /** creator of the data story. */ + creator: Scalars['String']; + /** description of the data story. */ + description: Scalars['String']; + /** group is the owner group of the data story */ + group: Scalars['String']; /** id of the data story. */ id: Scalars['ID']; /** keywords for the story used as tags. */ keywords: Array; - /** lastModified is the timestamp for when the data story was last modified. */ + /** lastModified is the timestamp for when the data story was last modified */ lastModified?: Maybe; /** name of the data story. */ name: Scalars['String']; - /** owner of the data story. Changes to the data story can only be done by a member of the owner. */ - owner: Owner; - /** views contains a list of the different view data in the data story. */ - views: Array; -}; - -/** StoryToken contains the token used for updating a data story. */ -export type StoryToken = { - __typename?: 'StoryToken'; - /** id of the story token. */ - id: Scalars['ID']; - /** token is the update token for the data story. */ - token: Scalars['String']; -}; - -export type StoryView = { - /** id of the story view. */ - id: Scalars['ID']; -}; - -/** StoryViewHeader contains the metadata and content of a header story view. */ -export type StoryViewHeader = StoryView & { - __typename?: 'StoryViewHeader'; - /** content contains the header text. */ - content: Scalars['String']; - /** id of the header story view. */ - id: Scalars['ID']; - /** level is the size of the header text. */ - level: Scalars['Int']; -}; - -/** StoryViewMarkdown contains the metadata and content of a markdown story view. */ -export type StoryViewMarkdown = StoryView & { - __typename?: 'StoryViewMarkdown'; - /** content contains the markdown text. */ - content: Scalars['String']; - /** id of the markdown story view. */ - id: Scalars['ID']; -}; - -/** StoryViewPlotly contains the metadata and content of a plotly story view. */ -export type StoryViewPlotly = StoryView & { - __typename?: 'StoryViewPlotly'; - /** view data for the plotly graph. */ - data: Array; - /** frames contains view data when plotly figures has different views */ - frames: Array; - /** id of the plotly story view. */ - id: Scalars['ID']; - /** layout contains metadata on the plotly graph layout. */ - layout: Scalars['Map']; -}; - -/** StoryViewVega contains the metadata and content of a vega story view. */ -export type StoryViewVega = StoryView & { - __typename?: 'StoryViewVega'; - /** id of the vega story view. */ - id: Scalars['ID']; - /** spec contains data and metadata on the vega graph. */ - spec: Scalars['Map']; + /** Id of the creator's product area. */ + productAreaID?: Maybe; + /** Id of the creator's team. */ + teamID?: Maybe; + /** teamkatalogenURL of the creator */ + teamkatalogenURL?: Maybe; }; /** SubjectType defines all possible types that can request access to a dataset. */ @@ -1296,8 +1130,6 @@ export type Team = { name: Scalars['String']; /** productAreaID is the id of the product area. */ productAreaID: Scalars['String']; - /** quartoStories is the quartoStories owned by the team. */ - quartoStories: Array; /** stories is the stories owned by the team. */ stories: Array; }; @@ -1417,9 +1249,7 @@ export type UserInfo = { nadaTokens: Array; /** name of user. */ name: Scalars['String']; - /** quarto stories is the stories owned by the user's group */ - quartoStories: Array; - /** stories is a list of stories with one of the users groups as owner. */ + /** stories is the stories owned by the user's group */ stories: Array; }; @@ -1669,12 +1499,12 @@ export type ProductAreaQueryVariables = Exact<{ }>; -export type ProductAreaQuery = { __typename?: 'Query', productArea: { __typename?: 'ProductArea', id: string, name: string, dashboardURL: string, teams: Array<{ __typename?: 'Team', id: string, name: string, dashboardURL: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, quartoStories: Array<{ __typename?: 'QuartoStory', id: string, name: string, created: any, lastModified?: any | null, description: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, created: any, lastModified?: any | null, group: string, teamkatalogenURL?: string | null, keywords: Array, type: string, link: string }> }>, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, quartoStories: Array<{ __typename?: 'QuartoStory', id: string, name: string, created: any, description: string, lastModified?: any | null, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, created: any, group: string, teamkatalogenURL?: string | null, lastModified?: any | null, keywords: Array, type: string, link: string }> } }; +export type ProductAreaQuery = { __typename?: 'Query', productArea: { __typename?: 'ProductArea', id: string, name: string, dashboardURL: string, teams: Array<{ __typename?: 'Team', id: string, name: string, dashboardURL: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, created: any, lastModified?: any | null, description: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, created: any, lastModified?: any | null, group: string, teamkatalogenURL?: string | null, keywords: Array, type: string, link: string }> }>, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, created: any, description: string, lastModified?: any | null, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, created: any, group: string, teamkatalogenURL?: string | null, lastModified?: any | null, keywords: Array, type: string, link: string }> } }; export type ProductAreasQueryVariables = Exact<{ [key: string]: never; }>; -export type ProductAreasQuery = { __typename?: 'Query', productAreas: Array<{ __typename?: 'ProductArea', id: string, name: string, areaType: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, owner: { __typename?: 'Owner', group: string } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null } }>, quartoStories: Array<{ __typename?: 'QuartoStory', id: string, name: string, description: string, created: any, lastModified?: any | null, keywords: Array }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, type: string, group: string, teamkatalogenURL?: string | null, link: string }>, teams: Array<{ __typename?: 'Team', id: string, name: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string }>, stories: Array<{ __typename?: 'Story', id: string, name: string }>, quartoStories: Array<{ __typename?: 'QuartoStory', id: string, name: string }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string }> }> }> }; +export type ProductAreasQuery = { __typename?: 'Query', productAreas: Array<{ __typename?: 'ProductArea', id: string, name: string, areaType: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, description: string, owner: { __typename?: 'Owner', group: string } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, description: string, created: any, lastModified?: any | null, keywords: Array }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, type: string, group: string, teamkatalogenURL?: string | null, link: string }>, teams: Array<{ __typename?: 'Team', id: string, name: string, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string }>, stories: Array<{ __typename?: 'Story', id: string, name: string }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string }> }> }> }; export type JoinableViewQueryVariables = Exact<{ id: Scalars['ID']; @@ -1700,14 +1530,14 @@ export type SearchContentQueryVariables = Exact<{ }>; -export type SearchContentQuery = { __typename?: 'Query', search: Array<{ __typename?: 'SearchResultRow', excerpt: string, result: { __typename: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, datasets: Array<{ __typename?: 'Dataset', name: string, datasource: { __typename?: 'BigQuery', lastModified: any, type: 'BigQuery' } }>, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } } | { __typename?: 'QuartoStory' } | { __typename?: 'Story' } }> }; +export type SearchContentQuery = { __typename?: 'Query', search: Array<{ __typename?: 'SearchResultRow', excerpt: string, result: { __typename: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, datasets: Array<{ __typename?: 'Dataset', name: string, datasource: { __typename?: 'BigQuery', lastModified: any, type: 'BigQuery' } }>, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } } | { __typename?: 'Story' } }> }; export type SearchContentWithOptionsQueryVariables = Exact<{ options: SearchOptions; }>; -export type SearchContentWithOptionsQuery = { __typename?: 'Query', search: Array<{ __typename?: 'SearchResultRow', excerpt: string, result: { __typename: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, datasets: Array<{ __typename?: 'Dataset', id: string, name: string, datasource: { __typename?: 'BigQuery', lastModified: any, table: string, type: 'BigQuery' } }>, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } } | { __typename: 'QuartoStory', id: string, name: string, description: string, created: any, teamkatalogenURL?: string | null, keywords: Array, groupName: string, modified?: any | null } | { __typename: 'Story', id: string, name: string, created: any, keywords: Array, modified?: any | null, group: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null } } }> }; +export type SearchContentWithOptionsQuery = { __typename?: 'Query', search: Array<{ __typename?: 'SearchResultRow', excerpt: string, result: { __typename: 'Dataproduct', id: string, name: string, description: string, created: any, lastModified: any, keywords: Array, slug: string, datasets: Array<{ __typename?: 'Dataset', id: string, name: string, datasource: { __typename?: 'BigQuery', lastModified: any, table: string, type: 'BigQuery' } }>, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, teamContact?: string | null } } | { __typename: 'Story', id: string, name: string, description: string, created: any, teamkatalogenURL?: string | null, keywords: Array, groupName: string, modified?: any | null } }> }; export type SlackQueryVariables = Exact<{ name: Scalars['String']; @@ -1716,13 +1546,13 @@ export type SlackQueryVariables = Exact<{ export type SlackQuery = { __typename?: 'Query', IsValidSlackChannel: boolean }; -export type CreateQuartoStoryMutationVariables = Exact<{ +export type CreateStoryMutationVariables = Exact<{ files: Array | UploadFile; - input: NewQuartoStory; + input: NewStory; }>; -export type CreateQuartoStoryMutation = { __typename?: 'Mutation', createQuartoStory: { __typename?: 'QuartoStory', id: string } }; +export type CreateStoryMutation = { __typename?: 'Mutation', createStory: { __typename?: 'Story', id: string } }; export type DeleteInsightProductMutationVariables = Exact<{ id: Scalars['ID']; @@ -1731,13 +1561,6 @@ export type DeleteInsightProductMutationVariables = Exact<{ export type DeleteInsightProductMutation = { __typename?: 'Mutation', deleteInsightProduct: boolean }; -export type DeleteQuartoStoryMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type DeleteQuartoStoryMutation = { __typename?: 'Mutation', deleteQuartoStory: boolean }; - export type DeleteStoryMutationVariables = Exact<{ id: Scalars['ID']; }>; @@ -1745,59 +1568,14 @@ export type DeleteStoryMutationVariables = Exact<{ export type DeleteStoryMutation = { __typename?: 'Mutation', deleteStory: boolean }; -export type PlotlyViewQueryVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type PlotlyViewQuery = { __typename?: 'Query', storyView: { __typename?: 'StoryViewHeader' } | { __typename?: 'StoryViewMarkdown' } | { __typename?: 'StoryViewPlotly', id: string, data: Array, layout: any, frames: Array } | { __typename?: 'StoryViewVega' } }; - -export type PublishStoryMutationVariables = Exact<{ - input: NewStory; -}>; - - -export type PublishStoryMutation = { __typename?: 'Mutation', publishStory: { __typename?: 'Story', id: string } }; - -export type QuartoStoryQueryVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type QuartoStoryQuery = { __typename?: 'Query', quartoStory: { __typename?: 'QuartoStory', id: string, name: string, description: string, created: any, lastModified?: any | null, keywords: Array, group: string, teamkatalogenURL?: string | null, productAreaID?: string | null, teamID?: string | null } }; - -export type StoriesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type StoriesQuery = { __typename?: 'Query', stories: Array<{ __typename?: 'Story', id: string, name: string, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null } }> }; - -export type StoryQueryVariables = Exact<{ +export type DataStoryQueryVariables = Exact<{ id: Scalars['ID']; }>; -export type StoryQuery = { __typename?: 'Query', story: { __typename?: 'Story', id: string, name: string, created: any, lastModified?: any | null, keywords: Array, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null, productAreaID?: string | null, teamID?: string | null }, views: Array<{ __typename: 'StoryViewHeader', content: string, level: number, id: string } | { __typename: 'StoryViewMarkdown', content: string, id: string } | { __typename: 'StoryViewPlotly', id: string } | { __typename: 'StoryViewVega', id: string }> } }; - -export type StoryTokenQueryVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type StoryTokenQuery = { __typename?: 'Query', storyToken: { __typename?: 'StoryToken', token: string } }; +export type DataStoryQuery = { __typename?: 'Query', dataStory: { __typename?: 'Story', id: string, name: string, description: string, created: any, lastModified?: any | null, keywords: Array, group: string, teamkatalogenURL?: string | null, productAreaID?: string | null, teamID?: string | null } }; export type UpdateStoryMetadataMutationVariables = Exact<{ - id: Scalars['ID']; - keywords: Array | Scalars['String']; - name: Scalars['String']; - teamkatalogenURL?: InputMaybe; - productAreaID?: InputMaybe; - teamID?: InputMaybe; -}>; - - -export type UpdateStoryMetadataMutation = { __typename?: 'Mutation', updateStoryMetadata: { __typename?: 'Story', id: string } }; - -export type UpdateQuartoStoryMetadataMutationVariables = Exact<{ id: Scalars['ID']; name: Scalars['String']; description: Scalars['String']; @@ -1809,14 +1587,7 @@ export type UpdateQuartoStoryMetadataMutationVariables = Exact<{ }>; -export type UpdateQuartoStoryMetadataMutation = { __typename?: 'Mutation', updateQuartoStoryMetadata: { __typename?: 'QuartoStory', id: string } }; - -export type VegaViewQueryVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type VegaViewQuery = { __typename?: 'Query', storyView: { __typename?: 'StoryViewHeader' } | { __typename?: 'StoryViewMarkdown' } | { __typename?: 'StoryViewPlotly' } | { __typename?: 'StoryViewVega', id: string, spec: any } }; +export type UpdateStoryMetadataMutation = { __typename?: 'Mutation', updateStoryMetadata: { __typename?: 'Story', id: string } }; export type TeamkatalogenQueryVariables = Exact<{ q?: InputMaybe | Scalars['String']>; @@ -1828,7 +1599,7 @@ export type TeamkatalogenQuery = { __typename?: 'Query', teamkatalogen: Array<{ export type UserInfoDetailsQueryVariables = Exact<{ [key: string]: never; }>; -export type UserInfoDetailsQuery = { __typename?: 'Query', userInfo: { __typename?: 'UserInfo', name: string, email: string, loginExpiration: any, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string } }>, accessable: { __typename?: 'AccessibleDatasets', owned: Array<{ __typename?: 'Dataset', id: string, name: string, dataproductID: string, keywords: Array, slug: string, dataproduct: { __typename?: 'Dataproduct', name: string, slug: string }, owner: { __typename?: 'Owner', group: string } }>, granted: Array<{ __typename?: 'Dataset', id: string, name: string, dataproductID: string, keywords: Array, slug: string, dataproduct: { __typename?: 'Dataproduct', name: string, slug: string }, owner: { __typename?: 'Owner', group: string } }> }, groups: Array<{ __typename?: 'Group', name: string, email: string }>, nadaTokens: Array<{ __typename?: 'NadaToken', team: string, token: string }>, googleGroups?: Array<{ __typename?: 'Group', name: string, email: string }> | null, allGoogleGroups?: Array<{ __typename?: 'Group', name: string, email: string }> | null, gcpProjects: Array<{ __typename?: 'GCPProject', id: string, group: { __typename?: 'Group', name: string, email: string } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, keywords: Array, owner: { __typename?: 'Owner', group: string, teamkatalogenURL?: string | null } }>, quartoStories: Array<{ __typename?: 'QuartoStory', id: string, name: string, description: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, type: string, link: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, accessRequests: Array<{ __typename?: 'AccessRequest', id: string, datasetID: string, subject: string, subjectType: SubjectType, granter?: string | null, status: AccessRequestStatus, created: any, expires?: any | null, owner: string, reason?: string | null, polly?: { __typename?: 'Polly', id: string, name: string, externalID: string, url: string } | null }> } }; +export type UserInfoDetailsQuery = { __typename?: 'Query', userInfo: { __typename?: 'UserInfo', name: string, email: string, loginExpiration: any, dataproducts: Array<{ __typename?: 'Dataproduct', id: string, name: string, keywords: Array, slug: string, owner: { __typename?: 'Owner', group: string } }>, accessable: { __typename?: 'AccessibleDatasets', owned: Array<{ __typename?: 'Dataset', id: string, name: string, dataproductID: string, keywords: Array, slug: string, dataproduct: { __typename?: 'Dataproduct', name: string, slug: string }, owner: { __typename?: 'Owner', group: string } }>, granted: Array<{ __typename?: 'Dataset', id: string, name: string, dataproductID: string, keywords: Array, slug: string, dataproduct: { __typename?: 'Dataproduct', name: string, slug: string }, owner: { __typename?: 'Owner', group: string } }> }, groups: Array<{ __typename?: 'Group', name: string, email: string }>, nadaTokens: Array<{ __typename?: 'NadaToken', team: string, token: string }>, googleGroups?: Array<{ __typename?: 'Group', name: string, email: string }> | null, allGoogleGroups?: Array<{ __typename?: 'Group', name: string, email: string }> | null, gcpProjects: Array<{ __typename?: 'GCPProject', id: string, group: { __typename?: 'Group', name: string, email: string } }>, stories: Array<{ __typename?: 'Story', id: string, name: string, description: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, insightProducts: Array<{ __typename?: 'InsightProduct', id: string, name: string, description: string, type: string, link: string, keywords: Array, group: string, teamkatalogenURL?: string | null }>, accessRequests: Array<{ __typename?: 'AccessRequest', id: string, datasetID: string, subject: string, subjectType: SubjectType, granter?: string | null, status: AccessRequestStatus, created: any, expires?: any | null, owner: string, reason?: string | null, polly?: { __typename?: 'Polly', id: string, name: string, externalID: string, url: string } | null }> } }; export type UserInfoAccessableDataproductQueryVariables = Exact<{ [key: string]: never; }>; @@ -3213,18 +2984,6 @@ export const ProductAreaDocument = gql` } } stories { - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - teamContact - } - } - quartoStories { id name created @@ -3263,18 +3022,6 @@ export const ProductAreaDocument = gql` } } stories { - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - teamContact - } - } - quartoStories { id name created @@ -3342,17 +3089,6 @@ export const ProductAreasDocument = gql` } } stories { - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - } - } - quartoStories { id name description @@ -3382,10 +3118,6 @@ export const ProductAreasDocument = gql` id name } - quartoStories { - id - name - } insightProducts { id name @@ -3624,18 +3356,6 @@ export const SearchContentWithOptionsDocument = gql` } } ... on Story { - __typename - id - name - created - keywords - modified: lastModified - group: owner { - group - teamkatalogenURL - } - } - ... on QuartoStory { __typename id name @@ -3711,40 +3431,40 @@ export function useSlackLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions; export type SlackLazyQueryHookResult = ReturnType; export type SlackQueryResult = Apollo.QueryResult; -export const CreateQuartoStoryDocument = gql` - mutation createQuartoStory($files: [UploadFile!]!, $input: NewQuartoStory!) { - createQuartoStory(files: $files, input: $input) { +export const CreateStoryDocument = gql` + mutation createStory($files: [UploadFile!]!, $input: NewStory!) { + createStory(files: $files, input: $input) { id } } `; -export type CreateQuartoStoryMutationFn = Apollo.MutationFunction; +export type CreateStoryMutationFn = Apollo.MutationFunction; /** - * __useCreateQuartoStoryMutation__ + * __useCreateStoryMutation__ * - * To run a mutation, you first call `useCreateQuartoStoryMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateQuartoStoryMutation` returns a tuple that includes: + * To run a mutation, you first call `useCreateStoryMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreateStoryMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [createQuartoStoryMutation, { data, loading, error }] = useCreateQuartoStoryMutation({ + * const [createStoryMutation, { data, loading, error }] = useCreateStoryMutation({ * variables: { * files: // value for 'files' * input: // value for 'input' * }, * }); */ -export function useCreateQuartoStoryMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useCreateStoryMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateQuartoStoryDocument, options); + return Apollo.useMutation(CreateStoryDocument, options); } -export type CreateQuartoStoryMutationHookResult = ReturnType; -export type CreateQuartoStoryMutationResult = Apollo.MutationResult; -export type CreateQuartoStoryMutationOptions = Apollo.BaseMutationOptions; +export type CreateStoryMutationHookResult = ReturnType; +export type CreateStoryMutationResult = Apollo.MutationResult; +export type CreateStoryMutationOptions = Apollo.BaseMutationOptions; export const DeleteInsightProductDocument = gql` mutation deleteInsightProduct($id: ID!) { deleteInsightProduct(id: $id) @@ -3776,37 +3496,6 @@ export function useDeleteInsightProductMutation(baseOptions?: Apollo.MutationHoo export type DeleteInsightProductMutationHookResult = ReturnType; export type DeleteInsightProductMutationResult = Apollo.MutationResult; export type DeleteInsightProductMutationOptions = Apollo.BaseMutationOptions; -export const DeleteQuartoStoryDocument = gql` - mutation deleteQuartoStory($id: ID!) { - deleteQuartoStory(id: $id) -} - `; -export type DeleteQuartoStoryMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteQuartoStoryMutation__ - * - * To run a mutation, you first call `useDeleteQuartoStoryMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteQuartoStoryMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteQuartoStoryMutation, { data, loading, error }] = useDeleteQuartoStoryMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useDeleteQuartoStoryMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteQuartoStoryDocument, options); - } -export type DeleteQuartoStoryMutationHookResult = ReturnType; -export type DeleteQuartoStoryMutationResult = Apollo.MutationResult; -export type DeleteQuartoStoryMutationOptions = Apollo.BaseMutationOptions; export const DeleteStoryDocument = gql` mutation deleteStory($id: ID!) { deleteStory(id: $id) @@ -3838,82 +3527,9 @@ export function useDeleteStoryMutation(baseOptions?: Apollo.MutationHookOptions< export type DeleteStoryMutationHookResult = ReturnType; export type DeleteStoryMutationResult = Apollo.MutationResult; export type DeleteStoryMutationOptions = Apollo.BaseMutationOptions; -export const PlotlyViewDocument = gql` - query PlotlyView($id: ID!) { - storyView(id: $id) { - ... on StoryViewPlotly { - id - data - layout - frames - } - } -} - `; - -/** - * __usePlotlyViewQuery__ - * - * To run a query within a React component, call `usePlotlyViewQuery` and pass it any options that fit your needs. - * When your component renders, `usePlotlyViewQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = usePlotlyViewQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function usePlotlyViewQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(PlotlyViewDocument, options); - } -export function usePlotlyViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(PlotlyViewDocument, options); - } -export type PlotlyViewQueryHookResult = ReturnType; -export type PlotlyViewLazyQueryHookResult = ReturnType; -export type PlotlyViewQueryResult = Apollo.QueryResult; -export const PublishStoryDocument = gql` - mutation publishStory($input: NewStory!) { - publishStory(input: $input) { - id - } -} - `; -export type PublishStoryMutationFn = Apollo.MutationFunction; - -/** - * __usePublishStoryMutation__ - * - * To run a mutation, you first call `usePublishStoryMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `usePublishStoryMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [publishStoryMutation, { data, loading, error }] = usePublishStoryMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function usePublishStoryMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(PublishStoryDocument, options); - } -export type PublishStoryMutationHookResult = ReturnType; -export type PublishStoryMutationResult = Apollo.MutationResult; -export type PublishStoryMutationOptions = Apollo.BaseMutationOptions; -export const QuartoStoryDocument = gql` - query quartoStory($id: ID!) { - quartoStory(id: $id) { +export const DataStoryDocument = gql` + query dataStory($id: ID!) { + dataStory(id: $id) { id name description @@ -3929,171 +3545,43 @@ export const QuartoStoryDocument = gql` `; /** - * __useQuartoStoryQuery__ - * - * To run a query within a React component, call `useQuartoStoryQuery` and pass it any options that fit your needs. - * When your component renders, `useQuartoStoryQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useQuartoStoryQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useQuartoStoryQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(QuartoStoryDocument, options); - } -export function useQuartoStoryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(QuartoStoryDocument, options); - } -export type QuartoStoryQueryHookResult = ReturnType; -export type QuartoStoryLazyQueryHookResult = ReturnType; -export type QuartoStoryQueryResult = Apollo.QueryResult; -export const StoriesDocument = gql` - query stories { - stories { - id - name - owner { - group - teamkatalogenURL - } - } -} - `; - -/** - * __useStoriesQuery__ - * - * To run a query within a React component, call `useStoriesQuery` and pass it any options that fit your needs. - * When your component renders, `useStoriesQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useStoriesQuery({ - * variables: { - * }, - * }); - */ -export function useStoriesQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(StoriesDocument, options); - } -export function useStoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(StoriesDocument, options); - } -export type StoriesQueryHookResult = ReturnType; -export type StoriesLazyQueryHookResult = ReturnType; -export type StoriesQueryResult = Apollo.QueryResult; -export const StoryDocument = gql` - query Story($id: ID!) { - story(id: $id) { - id - name - created - lastModified - keywords - owner { - group - teamkatalogenURL - productAreaID - teamID - } - views { - id - __typename - ... on StoryViewHeader { - content - level - } - ... on StoryViewMarkdown { - content - } - } - } -} - `; - -/** - * __useStoryQuery__ - * - * To run a query within a React component, call `useStoryQuery` and pass it any options that fit your needs. - * When your component renders, `useStoryQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useStoryQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useStoryQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(StoryDocument, options); - } -export function useStoryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(StoryDocument, options); - } -export type StoryQueryHookResult = ReturnType; -export type StoryLazyQueryHookResult = ReturnType; -export type StoryQueryResult = Apollo.QueryResult; -export const StoryTokenDocument = gql` - query StoryToken($id: ID!) { - storyToken(id: $id) { - token - } -} - `; - -/** - * __useStoryTokenQuery__ + * __useDataStoryQuery__ * - * To run a query within a React component, call `useStoryTokenQuery` and pass it any options that fit your needs. - * When your component renders, `useStoryTokenQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useDataStoryQuery` and pass it any options that fit your needs. + * When your component renders, `useDataStoryQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useStoryTokenQuery({ + * const { data, loading, error } = useDataStoryQuery({ * variables: { * id: // value for 'id' * }, * }); */ -export function useStoryTokenQuery(baseOptions: Apollo.QueryHookOptions) { +export function useDataStoryQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(StoryTokenDocument, options); + return Apollo.useQuery(DataStoryDocument, options); } -export function useStoryTokenLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useDataStoryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(StoryTokenDocument, options); + return Apollo.useLazyQuery(DataStoryDocument, options); } -export type StoryTokenQueryHookResult = ReturnType; -export type StoryTokenLazyQueryHookResult = ReturnType; -export type StoryTokenQueryResult = Apollo.QueryResult; +export type DataStoryQueryHookResult = ReturnType; +export type DataStoryLazyQueryHookResult = ReturnType; +export type DataStoryQueryResult = Apollo.QueryResult; export const UpdateStoryMetadataDocument = gql` - mutation updateStoryMetadata($id: ID!, $keywords: [String!]!, $name: String!, $teamkatalogenURL: String, $productAreaID: String, $teamID: String) { + mutation updateStoryMetadata($id: ID!, $name: String!, $description: String!, $keywords: [String!]!, $teamkatalogenURL: String, $productAreaID: String, $teamID: String, $group: String!) { updateStoryMetadata( id: $id - keywords: $keywords name: $name + description: $description + keywords: $keywords teamkatalogenURL: $teamkatalogenURL productAreaID: $productAreaID teamID: $teamID + group: $group ) { id } @@ -4115,11 +3603,13 @@ export type UpdateStoryMetadataMutationFn = Apollo.MutationFunction; export type UpdateStoryMetadataMutationResult = Apollo.MutationResult; export type UpdateStoryMetadataMutationOptions = Apollo.BaseMutationOptions; -export const UpdateQuartoStoryMetadataDocument = gql` - mutation updateQuartoStoryMetadata($id: ID!, $name: String!, $description: String!, $keywords: [String!]!, $teamkatalogenURL: String, $productAreaID: String, $teamID: String, $group: String!) { - updateQuartoStoryMetadata( - id: $id - name: $name - description: $description - keywords: $keywords - teamkatalogenURL: $teamkatalogenURL - productAreaID: $productAreaID - teamID: $teamID - group: $group - ) { - id - } -} - `; -export type UpdateQuartoStoryMetadataMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateQuartoStoryMetadataMutation__ - * - * To run a mutation, you first call `useUpdateQuartoStoryMetadataMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateQuartoStoryMetadataMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateQuartoStoryMetadataMutation, { data, loading, error }] = useUpdateQuartoStoryMetadataMutation({ - * variables: { - * id: // value for 'id' - * name: // value for 'name' - * description: // value for 'description' - * keywords: // value for 'keywords' - * teamkatalogenURL: // value for 'teamkatalogenURL' - * productAreaID: // value for 'productAreaID' - * teamID: // value for 'teamID' - * group: // value for 'group' - * }, - * }); - */ -export function useUpdateQuartoStoryMetadataMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateQuartoStoryMetadataDocument, options); - } -export type UpdateQuartoStoryMetadataMutationHookResult = ReturnType; -export type UpdateQuartoStoryMetadataMutationResult = Apollo.MutationResult; -export type UpdateQuartoStoryMetadataMutationOptions = Apollo.BaseMutationOptions; -export const VegaViewDocument = gql` - query VegaView($id: ID!) { - storyView(id: $id) { - ... on StoryViewVega { - id - spec - } - } -} - `; - -/** - * __useVegaViewQuery__ - * - * To run a query within a React component, call `useVegaViewQuery` and pass it any options that fit your needs. - * When your component renders, `useVegaViewQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useVegaViewQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useVegaViewQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(VegaViewDocument, options); - } -export function useVegaViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(VegaViewDocument, options); - } -export type VegaViewQueryHookResult = ReturnType; -export type VegaViewLazyQueryHookResult = ReturnType; -export type VegaViewQueryResult = Apollo.QueryResult; export const TeamkatalogenDocument = gql` query Teamkatalogen($q: [String!]) { teamkatalogen(q: $q) { @@ -4324,15 +3727,6 @@ export const UserInfoDetailsDocument = gql` } } stories { - id - name - keywords - owner { - group - teamkatalogenURL - } - } - quartoStories { id name description diff --git a/pages/index.tsx b/pages/index.tsx index f6f8feeb..8a62940c 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -4,7 +4,6 @@ import { KeywordsDocument, MetabaseProudctsDocument, SearchContentDocument, - StoriesDocument, } from '../lib/schema/graphql' import { useRouter } from 'next/router' import { FrontPageLogo } from '../components/index/frontPageLogo' @@ -150,9 +149,6 @@ export const getServerSideProps: GetServerSideProps = async (context) => { await apolloClient.query({ query: KeywordsDocument, }) - await apolloClient.query({ - query: StoriesDocument, - }) return addApolloState(apolloClient, { props: {}, diff --git a/pages/productArea/[id].tsx b/pages/productArea/[id].tsx index 9c9115f2..30a9f41c 100644 --- a/pages/productArea/[id].tsx +++ b/pages/productArea/[id].tsx @@ -38,19 +38,6 @@ export interface PAItem { __typename?: 'Story' id: string name: string - created: any - keywords: Array - lastModified?: any | null | undefined - owner: { - __typename?: 'Owner' - group: string - teamkatalogenURL?: string | null | undefined - } - }[] - quartoStories: { - __typename?: 'QuartoStory' - id: string - name: string description: string created: any keywords: Array @@ -75,7 +62,6 @@ const isRelevantPA = (productArea: ProductAreaQuery['productArea']) => { return ( productArea.dataproducts.length || productArea.stories.length - || productArea.quartoStories.length || productArea.insightProducts.length ) } @@ -88,7 +74,6 @@ const createPAItems = (productArea: ProductAreaQuery['productArea']) => { dashboardURL: productArea.dashboardURL, dataproducts: productArea.dataproducts, stories: productArea.stories, - quartoStories: productArea.quartoStories, insightProducts: productArea.insightProducts, }) productArea.teams @@ -97,13 +82,11 @@ const createPAItems = (productArea: ProductAreaQuery['productArea']) => { (it) => it.dataproducts.length > 0 || it.stories.length > 0 || - it.quartoStories.length > 0 || it.insightProducts.length > 0 ) .sort((a, b) => { return ( b.dataproducts.length + - b.stories.length + b.insightProducts.length - (a.dataproducts.length + a.stories.length + a.insightProducts.length) ) @@ -115,7 +98,6 @@ const createPAItems = (productArea: ProductAreaQuery['productArea']) => { dashboardURL: t.dashboardURL, dataproducts: t.dataproducts, stories: t.stories, - quartoStories: t.quartoStories, insightProducts: t.insightProducts, }) }) diff --git a/pages/quarto/[id]/edit.tsx b/pages/quarto/[id]/edit.tsx deleted file mode 100644 index 2c5e28f4..00000000 --- a/pages/quarto/[id]/edit.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Loader } from "@navikt/ds-react"; -import { useRouter } from "next/router" -import { EditQuartoStoryMetadataForm } from "../../../components/stories/editQuartoStoryMetadata"; -import { useQuartoStoryQuery } from "../../../lib/schema/graphql"; - -const EditQuartoPage = ()=>{ - const router = useRouter() - const id = router.query.id; - const quartoQuery = useQuartoStoryQuery({variables: {id:id as string}}) - if(quartoQuery.error){ - return
{quartoQuery.error.message}
- } - - if(quartoQuery.loading || !quartoQuery.data){ - return - } - const quartoStory = quartoQuery.data.quartoStory - return
- -
-} - -export default EditQuartoPage; \ No newline at end of file diff --git a/pages/search.tsx b/pages/search.tsx index 4bef5707..19570f51 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -95,12 +95,12 @@ const mapProductAreasWithResultToArray = ( ) => productAreasQuery.productAreas .map((it) => - !!it.dataproducts.length || !!it.stories.length || !!it.quartoStories.length + !!it.dataproducts.length || !!it.stories.length ? ({ name: it.name, teams: it.teams .map((t) => - !!t.dataproducts.length || !!t.stories.length || !!t.quartoStories.length + !!t.dataproducts.length || !!t.stories.length ? ({ name: t.name, } as Team) diff --git a/pages/story/[id]/edit.tsx b/pages/story/[id]/edit.tsx index f58e073b..5f0cfdce 100644 --- a/pages/story/[id]/edit.tsx +++ b/pages/story/[id]/edit.tsx @@ -1,30 +1,29 @@ -import * as React from 'react' -import { useStoryQuery } from '../../../lib/schema/graphql' -import Head from 'next/head' -import { useRouter } from 'next/router' -import EditForm from '../../../components/stories/editForm' -import ErrorMessage from '../../../components/lib/error' -import LoaderSpinner from '../../../components/lib/spinner' -import InnerContainer from '../../../components/lib/innerContainer' +import { Loader } from "@navikt/ds-react"; +import { useRouter } from "next/router" +import { EditStoryMetadataForm } from "../../../components/stories/editStoryMetadata"; +import { useDataStoryQuery } from "../../../lib/schema/graphql"; -const StoryDraft = () => { - const router = useRouter() - const id = router.query.id as string - const { data, error, loading } = useStoryQuery({ variables: { id } }) +const EditStoryPage = ()=>{ + const router = useRouter() + const id = router.query.id; + const storyQuery = useDataStoryQuery({variables: {id:id as string}}) + if(storyQuery.error){ + return
{storyQuery.error.message}
+ } - if (error) return - if (loading || !data) return - - const story = data.story - - return ( - - - Lagre {story.name} - - - - ) + if(storyQuery.loading || !storyQuery.data){ + return + } + const story = storyQuery.data.dataStory + return
+ +
} -export default StoryDraft +export default EditStoryPage; \ No newline at end of file diff --git a/pages/story/[id]/index.tsx b/pages/story/[id]/index.tsx deleted file mode 100644 index ebbfe85a..00000000 --- a/pages/story/[id]/index.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import * as React from 'react' -import { Story } from '../../../components/stories/story' -import { - Group, - useDeleteStoryMutation, - useStoryQuery, -} from '../../../lib/schema/graphql' -import Head from 'next/head' -import { useRouter } from 'next/router' -import ErrorMessage from '../../../components/lib/error' -import LoaderSpinner from '../../../components/lib/spinner' -import DeleteModal from '../../../components/lib/deleteModal' -import TokenModal from '../../../components/lib/tokenModal' -import { useContext, useState } from 'react' -import { UserState } from '../../../lib/context' -import amplitudeLog from '../../../lib/amplitude' -import InnerContainer from '../../../components/lib/innerContainer' - -const StoryPage = () => { - const router = useRouter() - const id = router.query.id as string - const userInfo = useContext(UserState) - const query = useStoryQuery({ variables: { id } }) - const [deleteStory] = useDeleteStoryMutation({ - variables: { id }, - awaitRefetchQueries: true, - refetchQueries: ['searchContent','userInfoDetails'], - }) - - const [showDelete, setShowDelete] = useState(false) - const [showToken, setShowToken] = useState(false) - const [deleteError, setDeleteError] = useState('') - - const quartoRedirectOnError = async () => { - try { - await router.push(`/quarto/${id}`) - } catch (e: any) { - console.log(e.toString()) - } - } - - React.useEffect(() => { - if(!query.loading && query.data){ - const eventProperties = { - sidetittel: 'datafortelling', - title: query.data?.story.name, - } - amplitudeLog('sidevisning', eventProperties) - } - }) - - if (query.error) quartoRedirectOnError() - if (query.loading || !query.data) return - const story = query.data.story - const isOwner = - userInfo?.groups.some((g: Group) => g.email === story?.owner?.group) || - false - - const onDelete = async () => { - try { - await deleteStory() - await router.push('/user/stories') - } catch (e: any) { - setDeleteError(e.toString()) - } - } - - return ( - - - {story.name} - -
- -
- setShowDelete(false)} - onConfirm={() => onDelete()} - name={story.name} - error={deleteError} - resource="dataprodukt" - /> - setShowToken(false)} - id={story.id} - /> -
- ) -} - -export default StoryPage diff --git a/pages/user/[[...page]].tsx b/pages/user/[[...page]].tsx index c7fc51e7..e9bd8fc6 100644 --- a/pages/user/[[...page]].tsx +++ b/pages/user/[[...page]].tsx @@ -47,7 +47,7 @@ export const UserPages = () => { component: (

Mine fortellinger

- +
), },