|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */ |
|
|
|
|
import React, {useEffect, useRef, useContext} from 'react' |
|
|
|
|
import {useIntl, FormattedMessage} from 'react-intl' |
|
|
|
|
import {TEMPLATE_NAMES} from '@remix-ui/workspace' |
|
|
|
|
import {TEMPLATE_NAMES,TEMPLATE_METADATA} from '@remix-ui/workspace' |
|
|
|
|
import {ThemeContext} from '../themeContext' |
|
|
|
|
import Carousel from 'react-multi-carousel' |
|
|
|
|
import WorkspaceTemplate from './workspaceTemplate' |
|
|
|
@ -58,9 +58,13 @@ function HomeTabGetStarted({plugin}: HomeTabGetStartedProps) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const createWorkspace = async (templateName) => { |
|
|
|
|
await plugin.appManager.activatePlugin('filePanel') |
|
|
|
|
const timeStamp = Date.now() |
|
|
|
|
let templateDisplayName = TEMPLATE_NAMES[templateName] |
|
|
|
|
const metadata = TEMPLATE_METADATA[templateName] |
|
|
|
|
if (metadata) { |
|
|
|
|
await plugin.call('dGitProvider', 'clone', {url: metadata.url, branch: metadata.branch}, templateDisplayName) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
await plugin.appManager.activatePlugin('filePanel')
|
|
|
|
|
templateDisplayName = await plugin.call('filePanel', 'getAvailableWorkspaceName', templateDisplayName) |
|
|
|
|
await plugin.call('filePanel', 'createWorkspace', templateDisplayName, templateName) |
|
|
|
|
await plugin.call('filePanel', 'setWorkspace', templateDisplayName) |
|
|
|
|