From 2b4165966ef2ad75476759fdc538591c82f8edbc Mon Sep 17 00:00:00 2001 From: MasterPtato Date: Tue, 6 Feb 2024 23:22:05 +0000 Subject: [PATCH] Remove version page from routes --- .../common/button/rvt-button.styles.ts | 4 +- src/elements/dev/version/version-info.ts | 2 - .../dev/game/pages/game-version-draft.scss | 134 ------ .../dev/game/pages/game-version-draft.ts | 434 ------------------ .../pages/dev/game/pages/game-version.scss | 169 ------- .../pages/dev/game/pages/game-version.ts | 253 ---------- src/elements/pages/dev/game/pages/module.ts | 1 - .../dev/game/pages/rvt-game-dashboard.ts | 20 - src/elements/profile/user-banner.ts | 4 +- src/routes.ts | 31 -- src/utils/settings.ts | 7 - 11 files changed, 5 insertions(+), 1054 deletions(-) delete mode 100644 src/elements/pages/dev/game/pages/game-version-draft.scss delete mode 100644 src/elements/pages/dev/game/pages/game-version-draft.ts delete mode 100644 src/elements/pages/dev/game/pages/game-version.scss delete mode 100644 src/elements/pages/dev/game/pages/game-version.ts diff --git a/src/elements/common/button/rvt-button.styles.ts b/src/elements/common/button/rvt-button.styles.ts index 22a80c1b..753a997e 100644 --- a/src/elements/common/button/rvt-button.styles.ts +++ b/src/elements/common/button/rvt-button.styles.ts @@ -24,8 +24,8 @@ export const button = tv({ variant: { primary: [ 'relative text-cream-100 fill-cream-100 border-cream-100 border transition-all', - "before:content-[''] before:absolute before:inset-0 before:-z-10 before:bg-light-grain before:bg-[size:32px] before:bg-blend-multiply before:transition-all before:opacity-0", - "after:content-[''] after:absolute after:inset-0 after:-z-10 after:bg-dark-grain after:bg-[size:32px] after:transition-all after:opacity-100" + "before:content-[''] before:absolute before:inset-0 before:-z-10 before:bg-light-grain before:[image-rendering:pixelated] before:bg-blend-multiply before:transition-all before:opacity-0", + "after:content-[''] after:absolute after:inset-0 after:-z-10 after:bg-dark-grain after:[image-rendering:pixelated] after:transition-all after:opacity-100" ], secondary: 'text-white fill-white bg-charcole-900 border-cream-100 border transition-all', danger: 'border-red-500 text-red-500 fill-red-500 border transition-all' diff --git a/src/elements/dev/version/version-info.ts b/src/elements/dev/version/version-info.ts index 7df339ef..ca32f434 100644 --- a/src/elements/dev/version/version-info.ts +++ b/src/elements/dev/version/version-info.ts @@ -7,7 +7,6 @@ import { when } from 'lit/directives/when.js'; import { ToggleSwitchEvent } from '../../common/toggle-switch'; import CheckBox from '../check-box'; import { TraversableErrors, VALIDATION_ERRORS } from '../../../utils/traversable-errors'; -import { UpdateConfigEvent } from '../../pages/dev/game/pages/game-version-draft'; @customElement('dev-version-info') export default class DevVersionInfo extends LitElement { @@ -30,7 +29,6 @@ export default class DevVersionInfo extends LitElement { updateConfig() { this.requestUpdate('config'); - this.dispatchEvent(new UpdateConfigEvent(this.config)); } toggleCdn(e: ToggleSwitchEvent) { diff --git a/src/elements/pages/dev/game/pages/game-version-draft.scss b/src/elements/pages/dev/game/pages/game-version-draft.scss deleted file mode 100644 index 5e6ec168..00000000 --- a/src/elements/pages/dev/game/pages/game-version-draft.scss +++ /dev/null @@ -1,134 +0,0 @@ -@use '../../../../shared/common'; -@use '../../../../shared/consts'; - -#base { - #draft-buttons { - display: flex; - flex-direction: row; - margin: -40px 0 40px 0; - - stylized-button { - margin-right: 10px; - --padding: 0 15px 0 12px; - --text-transform: none; - - &:last-child { - margin-right: 0; - } - } - - #clear-button { - --bg-color: #808080; - - &:hover { - --bg-color: #d4393b; - } - } - } - - h1 { - max-width: 600px; - font-size: 28px; - font-weight: 700; - margin-bottom: 18px; - } - - error-list { - max-width: 435px; - display: block; - margin-bottom: 12px; - } - - #input-area { - max-width: 435px; - margin-bottom: 20px; - - h3 { - font-size: 10px; - color: #ecececcc; - text-transform: uppercase; - margin-bottom: 6px; - } - - text-input { - width: 100%; - } - } - - #namespace-title { - margin-bottom: 0; - } - - #namespace-subtitle { - display: block; - margin-bottom: 18px; - } - - #namespaces { - max-width: 350px; - margin-bottom: 20px; - - .namespace { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - padding: 11px 17px; - margin-bottom: 12px; - background: rgba(255, 255, 255, 0.09); - border-radius: 4px; - box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2); - cursor: pointer; - - transition: - transform consts.$transition-length, - background-color consts.$transition-length; - - &:hover { - transform: translateY(-1px); - background-color: rgba(255, 255, 255, 0.15); - } - - &.selected { - background: rgba(255, 255, 255, 0.15); - - h3 { - color: #ececec; - } - } - - &:last-child { - margin-bottom: 0; - } - - @include common.active-state(); - - h3 { - display: -webkit-box; - flex: 1 1 auto; - color: #ecececcc; - font-size: 16px; - margin: 0 10px 0 0; - - line-break: anywhere; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - } - - e-svg { - margin-left: 12px; - --fill: #ececec; - } - } - } -} - -@media only screen and (max-width: consts.$mobile-width-threshold) { - #base { - #draft-buttons { - margin-top: 0; - } - } -} diff --git a/src/elements/pages/dev/game/pages/game-version-draft.ts b/src/elements/pages/dev/game/pages/game-version-draft.ts deleted file mode 100644 index 581f5f7a..00000000 --- a/src/elements/pages/dev/game/pages/game-version-draft.ts +++ /dev/null @@ -1,434 +0,0 @@ -import { html, LitElement, PropertyValues } from 'lit'; -import { customElement, property } from 'lit/decorators.js'; -import { repeat } from 'lit/directives/repeat.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { cssify } from '../../../../../utils/css'; -import styles from './game-version-draft.scss'; -import { Rivet } from '@rivet-gg/api'; -import settings from '../../../../../utils/settings'; -import logging from '../../../../../utils/logging'; -import global from '../../../../../utils/global'; -import RvtRouter from '../../../../root/rvt-router'; -import routes from '../../../../../routes'; -import { showAlert } from '../../../../../ui/helpers'; -import { TraversableErrors, VALIDATION_ERRORS } from '../../../../../utils/traversable-errors'; -import timing, { Debounce, wait } from '../../../../../utils/timing'; -import { globalEventGroups } from '../../../../../utils/global-events'; - -export class UpdateConfigEvent extends Event { - constructor(public config: Rivet.cloud.version.Config) { - super('update'); - } -} - -interface DraftSettings { - config?: Rivet.cloud.version.Config; - displayName?: string; -} - -@customElement('page-dev-game-version-draft') -export default class DevGameNamespace extends LitElement { - static styles = cssify(styles); - - @property({ type: Object }) - game: Rivet.cloud.GameFull; - - @property({ type: String }) - namespaceId: string; - - @property({ type: Object }) - tiers: Rivet.cloud.RegionTier[] = []; - - @property({ type: Boolean }) - isPublishing = false; - - @property({ type: Object }) - publishError?: any; - @property({ type: Object }) - validateError?: any; - - @property({ type: String }) - validationErrors: TraversableErrors = new TraversableErrors(VALIDATION_ERRORS.GAME_VERSION); - - @property({ type: Object }) - publishNamespaces: Set = new Set(); - - nameValue = ''; - versionConfig: Rivet.cloud.version.Config; - - @property({ type: Boolean }) - versionIsValid = false; - - // === DEBOUNCE INFO === - validateConfigDebounce: Debounce<() => ReturnType>; - - constructor() { - super(); - - this.validateConfigDebounce = new Debounce({ - delay: timing.milliseconds(500), - cb: async () => { - let displayName = (this.nameValue || '').trim(); - - return await global.api.cloud.games.versions.validateGameVersion(this.game.gameId, { - displayName: displayName, - config: this.versionConfig - }); - }, - completeCb: res => { - // Save errors - this.validationErrors.load(res.errors.map(err => err.path)); - this.versionIsValid = this.validationErrors.isEmpty(); - this.validateError = null; - - // Refresh UI - this.requestUpdate('validationErrors'); - } - }); - - this.validateConfigDebounce.onError((err: any) => { - this.versionIsValid = false; - this.validateError = err.body ?? err; - }); - } - - async firstUpdated(changedProperties: PropertyValues) { - super.firstUpdated(changedProperties); - - // Fetch tier options - let res = await global.api.cloud.tiers.getRegionTiers(); - this.tiers = res.tiers; - - this.versionConfig = this.readDraft().config; - this.validateConfigDebounce.trigger(); - } - - readDraft(): DraftSettings { - let strDraft = settings.getVersionConfigDraft(this.game.gameId); - - if (!strDraft || strDraft.length == 0) { - // Duplicate latest version - if (this.game.versions.length) this.getLatestVersion(); - - // Blank draft - return {}; - } - - try { - let draft = JSON.parse(strDraft) as DraftSettings; - this.migrateDraft(draft.config); - - this.nameValue = draft.displayName; - - return draft; - } catch (err) { - logging.warn('Failed to parse version config draft', err); - return {}; - } - } - - migrateDraft(config: Rivet.cloud.version.Config) { - if (config.cdn) { - if (!config.cdn.routes) config.cdn.routes = []; - } - - if (config.matchmaker) { - // Delete deprecated - delete config.matchmaker.lobbyGroups; - } - } - - async saveDraft(config: Rivet.cloud.version.Config = this.versionConfig) { - this.versionConfig = config; - - settings.setVersionConfigDraft( - this.game.gameId, - JSON.stringify({ - displayName: this.nameValue, - config: config - }) - ); - - this.validateConfigDebounce.trigger(); - } - - clearDraft() { - settings.setVersionConfigDraft(this.game.gameId, ''); - } - - confirmClearDraft() { - showAlert( - 'Confirm Clear Draft', - html`Are you sure you want to delete this draft? This action cannot be undone.`, - [ - { - label: 'No', - cb: () => globalEventGroups.dispatch('alert-panel-close', false) - }, - { - label: 'Yes', - destructive: true, - cb: () => globalEventGroups.dispatch('alert-panel-close', true) - } - ] - ); - - return globalEventGroups.await('alert-panel-close'); - } - - async clearDraftAction() { - if ((await this.confirmClearDraft()).value) { - this.nameValue = 'Blank Version'; - this.versionConfig = {}; - this.publishNamespaces.clear(); - this.saveDraft(); - - this.requestUpdate('versionConfig'); - } - } - - async getLatestVersion() { - try { - // Sort game versions by timestamp descending, get latest version - this.game.versions.sort((a, b) => b.createTs.getTime() - a.createTs.getTime()); - let latest = this.game.versions[0]; - - // Fetch full version config - let config = ( - await global.api.cloud.games.versions.getGameVersionById(this.game.gameId, latest.versionId) - ).version.config; - - let nextBuildName; - let buildNoMatch = latest.displayName.trim().match(/\(\s*\d+\s*\)$/); - - // Check for a build number in the title - if (buildNoMatch) { - let buildNo = parseInt(buildNoMatch[0].slice(1)); - nextBuildName = `${latest.displayName.replace(/\s*\(\s*\d+\s*\)$/, '')} (${buildNo + 1})`; - } else { - nextBuildName = `${latest.displayName} (2)`; - } - - this.nameValue = nextBuildName; - this.saveDraft(config); - - this.versionConfig = this.readDraft().config; - this.validateConfigDebounce.trigger(); - } catch (err) { - logging.error(err); - } - } - - async noNamespaceAlert() { - showAlert( - 'Publish version', - html`You have not selected any namespaces to deploy this new version to. Are you sure you want to - publish without deploying?`, - [ - { - label: 'No', - cb: () => globalEventGroups.dispatch('alert-panel-close', false) - }, - { - label: 'Yes', - cb: () => globalEventGroups.dispatch('alert-panel-close', true) - } - ] - ); - - return globalEventGroups.await('alert-panel-close'); - } - - async publishConfirmationAlert() { - showAlert( - `Confirm Publish ${this.nameValue}`, - html``, - [ - { - label: 'Cancel', - cb: () => globalEventGroups.dispatch('alert-panel-close', false) - }, - { - label: 'Publish', - cb: () => globalEventGroups.dispatch('alert-panel-close', true) - } - ] - ); - - return globalEventGroups.await('alert-panel-close'); - } - - async publishVersion() { - if (!this.versionIsValid) return; - - // Fetch publish namespaces before removing them from the DOM - let publishNamespaces = this.publishNamespaces; - - // Ask identity if they want to deploy without any selected namespaces - if (!publishNamespaces.size && this.game.namespaces.length) { - if (!(await this.noNamespaceAlert()).value) return; - - // Stop alerts from colliding - await wait(timing.milliseconds(325)); - } - - if (!(await this.publishConfirmationAlert()).value) return; - - this.publishError = null; - this.isPublishing = true; - - try { - // Create version - let config = this.readDraft().config; - logging.net('publishing version', this.game, config); - - let res = await global.api.cloud.games.versions.createGameVersion(this.game.gameId, { - displayName: this.nameValue, - config - }); - - let versionId = res.versionId; - - // Update namespaces - console.log('ns', this.publishNamespaces); - - for (let namespaceId of publishNamespaces.values()) { - logging.net('publishing namespace', namespaceId, versionId); - - await global.deprecatedApi.cloud.updateGameNamespaceVersion({ - gameId: this.game.gameId, - namespaceId, - versionId - }); - } - - // Redirect to version page - RvtRouter.shared.navigate( - routes.devVersion.build({ - gameId: this.game.gameId, - versionId, - namespaceId: this.namespaceId - }) - ); - - // Reset the stored draft - this.clearDraft(); - } catch (err) { - this.publishError = err; - this.isPublishing = false; - - if (err.hasOwnProperty('statusText')) this.publishError = await err.json(); - } - } - - nameInputChange(event: Event) { - let target = event.target as HTMLInputElement; - - this.nameValue = target.value; - - // Save name - this.saveDraft(); - } - - toggleNamespace(namespaceId: string) { - if (this.publishNamespaces.has(namespaceId)) this.publishNamespaces.delete(namespaceId); - else this.publishNamespaces.add(namespaceId); - - this.requestUpdate(); - } - - onConfigUpdate(event: UpdateConfigEvent) { - this.saveDraft(event.config); - } - - render() { - if (this.isPublishing) return html``; - - let settings = this.readDraft(); - - let displayNameErrors = this.validationErrors.findFormatted('display-name'); - - return html` -
-
- Publish - Clear Draft -
- ${this.publishError || this.validateError - ? html`` - : null} - ${displayNameErrors.length - ? html`` - : null} -

Version properties

-
-

Version Name

- -
- - ${this.game.namespaces.length - ? html`

Initiate namespaces

- You can change this later -
- ${repeat( - this.game.namespaces, - n => n.namespaceId, - n => { - let selected = this.publishNamespaces.has(n.namespaceId); - let classes = classMap({ - namespace: true, - selected: selected - }); - - return html`
-

${n.displayName}

- -
`; - } - )} -
` - : null} - -

Services

- -
- `; - } -} diff --git a/src/elements/pages/dev/game/pages/game-version.scss b/src/elements/pages/dev/game/pages/game-version.scss deleted file mode 100644 index 1545d87b..00000000 --- a/src/elements/pages/dev/game/pages/game-version.scss +++ /dev/null @@ -1,169 +0,0 @@ -@use '../../../../shared/common'; -@use '../../../../shared/consts'; - -#base { - h1 { - max-width: 600px; - font-size: 28px; - font-weight: 700; - margin-bottom: 18px; - } - - #subtitle-area { - margin: 0 0 30px 0; - - #duplicate-button { - --padding: 0 15px 0 12px; - --icon-margin: 0 4px 0 0; - --text-transform: none; - } - - #date { - margin: 0 0 12px 0; - font-size: 14px; - - date-display { - font-weight: 600; - } - } - } - - #namespaces { - max-width: 380px; - margin-bottom: 20px; - - #deploy-namespace { - display: inline-flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - box-sizing: border-box; - background: $raised-bg; - box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2); - border-radius: 6px; - padding: 7px 7px 7px 17px; - margin-bottom: 24px; - width: 100%; - - h2 { - margin: 0; - font-size: 16px; - } - - drop-down-list { - margin-left: 12px; - --bg-color: #3a3a3a; - --highlight-color: #3f3f3f; - } - } - - .namespace { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - padding: 11px 17px; - margin-bottom: 12px; - background: rgba(255, 255, 255, 0.15); - border-radius: 4px; - box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2); - - transition: - transform consts.$transition-length, - background-color consts.$transition-length; - - &:hover { - transform: translateY(-1px); - background-color: rgba(255, 255, 255, 0.17); - } - - &:last-child { - margin-bottom: 0; - } - - @include common.active-state(); - - h3 { - display: -webkit-box; - flex: 1 1 auto; - color: #ececec; - font-size: 16px; - margin: 0; - - line-break: anywhere; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - } - - e-svg { - flex: 0 0 auto; - } - } - } -} - -#placeholder { - display: flex; - flex-direction: column; - - loading-placeholder { - --border-radius: 3px; - max-width: 100%; - } - - #placeholder-subtitle-area { - margin: 0 0 34px 0; - - #placeholder-date { - margin-bottom: 12px; - width: 190px; - height: 19px; - } - - #placeholder-duplicate { - width: 80px; - height: 32px; - } - } - - .placeholder-subtitle { - width: 120px; - height: 34px; - margin-bottom: 20px; - } - - #placeholder-namespaces { - margin-bottom: 44px; - - loading-placeholder { - width: 380px; - height: 45px; - - &:not(:last-child) { - margin-bottom: 12px; - } - } - } - - .placeholder-service { - width: 100%; - height: 72px; - margin-bottom: 20px; - } -} - -@media only screen and (max-width: consts.$mobile-width-threshold) { - #base { - #duplicate-button { - margin-top: 0; - } - } - - #placeholder { - #placeholder-duplicate { - margin-top: 0; - } - } -} diff --git a/src/elements/pages/dev/game/pages/game-version.ts b/src/elements/pages/dev/game/pages/game-version.ts deleted file mode 100644 index 7aae78ac..00000000 --- a/src/elements/pages/dev/game/pages/game-version.ts +++ /dev/null @@ -1,253 +0,0 @@ -import { html, LitElement, PropertyValues } from 'lit'; -import { customElement, property } from 'lit/decorators.js'; -import { repeat } from 'lit/directives/repeat.js'; -import { cssify } from '../../../../../utils/css'; -import styles from './game-version.scss'; -import routes, { responses } from '../../../../../routes'; -import global from '../../../../../utils/global'; -import { Rivet } from '@rivet-gg/api'; -import { showAlert } from '../../../../../ui/helpers'; -import settings from '../../../../../utils/settings'; -import RvtRouter from '../../../../root/rvt-router'; -import { DropDownSelectEvent } from '../../../../dev/drop-down-list'; -import { globalEventGroups } from '../../../../../utils/global-events'; -import { Orientation } from '../../../../common/overlay-positioning'; - -@customElement('page-dev-game-version') -export default class DevGameNamespace extends LitElement { - static styles = cssify(styles); - - @property({ type: Object }) - game: Rivet.cloud.GameFull; - - @property({ type: String }) - namespaceId: string; - - @property({ type: String }) - versionId: string; - - @property({ type: Object }) - version: Rivet.cloud.version.Full = null; - - @property({ type: Object }) - versionHistory: Rivet.cloud.NamespaceVersion[] = []; - - @property({ type: Object }) - loadError?: any; - - @property({ type: Object }) - tiers: Rivet.cloud.RegionTier[] = []; - - @property({ type: String }) - namespaceSelection: string = null; - - async firstUpdated(changedProperties: PropertyValues) { - super.firstUpdated(changedProperties); - - // Fetch tier options - let res = await global.api.cloud.tiers.getRegionTiers(); - this.tiers = res.tiers; - } - - updated(changedProperties: PropertyValues) { - // Request data if category set - if (changedProperties.has('versionId')) { - this.resetData(); - this.fetchData(); - } - } - - resetData() { - this.version = null; - this.versionHistory.length = 0; - - this.loadError = null; - } - - async fetchData() { - try { - let [versionRes, historyRes] = await Promise.all([ - global.api.cloud.games.versions.getGameVersionById(this.game.gameId, this.versionId), - global.api.cloud.games.namespaces.getGameNamespaceVersionHistoryList( - this.game.gameId, - this.namespaceId, - { limit: 10 } - ) - ]); - this.version = versionRes.version; - this.versionHistory = historyRes.versions; - } catch (err) { - this.loadError = err; - } - } - - changeNamespaceSelection(event: DropDownSelectEvent) { - this.namespaceSelection = event.selection.value; - - showAlert( - 'Deploy version', - html`

- Are you sure you want to deploy version ${this.version.displayName} to namespace - ${event.selection.label}? -

`, - [ - { - label: 'No' - }, - { - label: 'Yes', - cb: this.deployToNamespace.bind(this) - } - ] - ); - } - - async deployToNamespace() { - await global.deprecatedApi.cloud.updateGameNamespaceVersion({ - gameId: this.game.gameId, - namespaceId: this.namespaceSelection, - versionId: this.version.versionId - }); - } - - async overwriteAlert() { - showAlert( - 'Duplicate version', - html`You currently have a version draft in progress. Duplicating this version will overwrite the - saved draft.`, - [ - { - label: 'Cancel', - cb: () => globalEventGroups.dispatch('alert-panel-close', false) - }, - { - label: 'Continue', - destructive: true, - cb: () => globalEventGroups.dispatch('alert-panel-close', true) - } - ] - ); - - // Use either a button press or dim area click to resolve promise - return globalEventGroups.await('alert-panel-close'); - } - - // Duplicate latest version - async duplicateVersion() { - let strDraft = settings.getVersionConfigDraft(this.game.gameId); - - // Ask the identity if they want to overwrite the current saved draft - if (strDraft && strDraft.length != 0) { - let res = (await this.overwriteAlert()).value; - - if (!res) return; - } - - let nextBuildName; - let buildNoMatch = this.version.displayName.trim().match(/\(\s*\d+\s*\)$/); - - // Check for a build number in the title - if (buildNoMatch) { - let buildNo = parseInt(buildNoMatch[0].slice(1)); - nextBuildName = `${this.version.displayName.replace(/\s*\(\s*\d+\s*\)$/, '')} (${buildNo + 1})`; - } else { - nextBuildName = `${this.version.displayName} (2)`; - } - - // Update version draft that we'll render - settings.setVersionConfigDraft( - this.game.gameId, - JSON.stringify({ - displayName: nextBuildName, - config: this.version.config - }) - ); - - // Switch to draft view - RvtRouter.shared.navigate( - routes.devVersion.build({ - gameId: this.game.gameId, - versionId: this.versionId, - namespaceId: this.namespaceId - }) - ); - } - - render() { - if (this.loadError) return responses.renderError(this.loadError); - if (this.version == null) return this.renderPlaceholder(); - - let namespaceOptions = this.game.namespaces - .filter(n => n.versionId != this.version.versionId) - .map(n => ({ - label: n.displayName, - value: n.namespaceId - })); - - return html` -
-
-

- Created: -

- Duplicate -
-

Active namespaces

-
- ${repeat( - this.game.namespaces.filter(n => n.versionId == this.version.versionId), - n => n.namespaceId, - n => - html` -
${n.displayName}
- -
` - )} -
-
Deploy to namespace:
- -
-
- -

Services

- -
- `; - } - - renderPlaceholder() { - return html`
-
- - -
- -
- - -
- - - -
`; - } -} diff --git a/src/elements/pages/dev/game/pages/module.ts b/src/elements/pages/dev/game/pages/module.ts index eaf79b84..856983cb 100644 --- a/src/elements/pages/dev/game/pages/module.ts +++ b/src/elements/pages/dev/game/pages/module.ts @@ -4,6 +4,5 @@ import './game-lobbies'; import './game-logs'; import './game-overview'; import './game-tokens'; -import './game-version-draft'; import './rvt-game-dashboard'; diff --git a/src/elements/pages/dev/game/pages/rvt-game-dashboard.ts b/src/elements/pages/dev/game/pages/rvt-game-dashboard.ts index 49bf4514..a26ac1fe 100644 --- a/src/elements/pages/dev/game/pages/rvt-game-dashboard.ts +++ b/src/elements/pages/dev/game/pages/rvt-game-dashboard.ts @@ -104,26 +104,6 @@ export default class DevGame extends LitElement { >`; RvtRouter.shared.updateTitle(`${this.game.data.game.displayName} – Versions`); - } else if (this.config.version) { - body = html``; - - let version = this.game.data.game.versions.find( - v => v.versionId == this.config.version.versionId - ); - let versionName = version ? version.displayName : 'Unknown version'; - - RvtRouter.shared.updateTitle(`${this.game.data.game.displayName} – ${versionName}`); - } else if (this.config.versionDraft) { - body = html``; - - RvtRouter.shared.updateTitle(`${this.game.data.game.displayName} – Version Draft`); - - pageId = 'draft'; } else if (this.config.tokens) { body = html` -
+
({ - path: '/games/:gameId/namespaces/:namespaceId/versions/:versionId', - middlewares: () => [ - MIDDLEWARES.validateUuid('gameId'), - MIDDLEWARES.validateUuid('namespaceId'), - MIDDLEWARES.validateUuid('versionId') - ], - render({ gameId, namespaceId, versionId }) { - return { - title: 'Game Version', - breadcrumb: { type: 'Namespace', gameId, namespaceId, title: 'Version' }, - template: responses.game(gameId, namespaceId, { - namespace: { namespaceId }, - version: { versionId } - }) - }; - } - }); - export let devVersionSettings = new Route<{ gameId: string; namespaceId: string }>({ path: '/games/:gameId/namespaces/:namespaceId/settings', render({ gameId, namespaceId }) { @@ -355,18 +336,6 @@ namespace routes { } }); - export let devVersionDraft = new Route<{ gameId: string }>({ - path: '/games/:gameId/version-draft', - middlewares: () => [MIDDLEWARES.validateUuid('gameId')], - render({ gameId }) { - return { - title: 'Game Version Draft', - breadcrumb: { type: 'Game', gameId, title: 'Version Draft' }, - template: responses.game(gameId, null, { versionDraft: true }) - }; - } - }); - export let devTokens = new Route<{ gameId: string; namespaceId: string }>({ path: '/games/:gameId/namespaces/:namespaceId/api', middlewares: () => [MIDDLEWARES.validateUuid('gameId'), MIDDLEWARES.validateUuid('namespaceId')], diff --git a/src/utils/settings.ts b/src/utils/settings.ts index 9611b55a..1c05d005 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -26,13 +26,6 @@ const settings = { }, set fullscreenMedia(v: boolean) { ls.setBoolean('fullscreen-media', v); - }, - - getVersionConfigDraft(gameId: string): string { - return ls.getString(`version-config-draft:${gameId}`, ''); - }, - setVersionConfigDraft(gameId: string, v: string) { - ls.setString(`version-config-draft:${gameId}`, v); } };