@elice/material-runbox 1.250321.0 → 1.250325.0-terminated.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var blocks = require('@elice/blocks');
|
|
9
9
|
var intl = require('@elice/intl');
|
|
10
|
+
var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
|
|
10
11
|
var runboxClient = require('@elice/runbox-client');
|
|
11
12
|
var iconsMaterial = require('@mui/icons-material');
|
|
12
13
|
var material = require('@mui/material');
|
|
@@ -106,15 +107,17 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
106
107
|
isError = _useQuery.isError,
|
|
107
108
|
refetch = _useQuery.refetch;
|
|
108
109
|
var paramsUserId = (_a = isTutoring ? studentUserId : userId) !== null && _a !== void 0 ? _a : 0;
|
|
110
|
+
var starterEnabled = Boolean(paramsUserId && (runbox === null || runbox === void 0 ? void 0 : runbox.id));
|
|
109
111
|
//
|
|
110
112
|
var _useMaterialRunboxRun = useMaterialRunboxRunboxIdStarterGet.useMaterialRunboxRunboxIdStarterGet({
|
|
111
113
|
runboxId: runbox === null || runbox === void 0 ? void 0 : runbox.id,
|
|
112
114
|
courseId: courseId,
|
|
113
115
|
studentUserId: paramsUserId,
|
|
114
|
-
enabled:
|
|
116
|
+
enabled: starterEnabled
|
|
115
117
|
}),
|
|
116
|
-
starter = _useMaterialRunboxRun.data
|
|
117
|
-
|
|
118
|
+
starter = _useMaterialRunboxRun.data,
|
|
119
|
+
isLoading = _useMaterialRunboxRun.isLoading;
|
|
120
|
+
var isStudentRunboxRunning = (starter === null || starter === void 0 ? void 0 : starter.userId) && userId !== starter.userId && starter.status !== openapiClientMaterialRunbox.RunboxStarterGetResponseStatusEnum.Terminated;
|
|
118
121
|
var _React$useState = React__default.default.useState(false),
|
|
119
122
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
120
123
|
isConfirmDialogOpen = _React$useState2[0],
|
|
@@ -146,7 +149,7 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
146
149
|
//
|
|
147
150
|
//
|
|
148
151
|
//
|
|
149
|
-
if (isInitialLoading) {
|
|
152
|
+
if (isInitialLoading || starterEnabled && isLoading) {
|
|
150
153
|
return jsxRuntime.jsx(StyledRunboxContainer, {
|
|
151
154
|
children: jsxRuntime.jsx(blocks.Spinner, {})
|
|
152
155
|
});
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Spinner } from '@elice/blocks';
|
|
5
5
|
import { useRawEliceIntl } from '@elice/intl';
|
|
6
|
+
import { RunboxStarterGetResponseStatusEnum } from '@elice/openapi-client-material-runbox';
|
|
6
7
|
import { EliceRunboxProvider } from '@elice/runbox-client';
|
|
7
8
|
import { Refresh } from '@mui/icons-material';
|
|
8
9
|
import { styled, Stack, Typography, Button } from '@mui/material';
|
|
@@ -98,15 +99,17 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
98
99
|
isError = _useQuery.isError,
|
|
99
100
|
refetch = _useQuery.refetch;
|
|
100
101
|
var paramsUserId = (_a = isTutoring ? studentUserId : userId) !== null && _a !== void 0 ? _a : 0;
|
|
102
|
+
var starterEnabled = Boolean(paramsUserId && (runbox === null || runbox === void 0 ? void 0 : runbox.id));
|
|
101
103
|
//
|
|
102
104
|
var _useMaterialRunboxRun = useMaterialRunboxRunboxIdStarterGet({
|
|
103
105
|
runboxId: runbox === null || runbox === void 0 ? void 0 : runbox.id,
|
|
104
106
|
courseId: courseId,
|
|
105
107
|
studentUserId: paramsUserId,
|
|
106
|
-
enabled:
|
|
108
|
+
enabled: starterEnabled
|
|
107
109
|
}),
|
|
108
|
-
starter = _useMaterialRunboxRun.data
|
|
109
|
-
|
|
110
|
+
starter = _useMaterialRunboxRun.data,
|
|
111
|
+
isLoading = _useMaterialRunboxRun.isLoading;
|
|
112
|
+
var isStudentRunboxRunning = (starter === null || starter === void 0 ? void 0 : starter.userId) && userId !== starter.userId && starter.status !== RunboxStarterGetResponseStatusEnum.Terminated;
|
|
110
113
|
var _React$useState = React.useState(false),
|
|
111
114
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
112
115
|
isConfirmDialogOpen = _React$useState2[0],
|
|
@@ -138,7 +141,7 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
138
141
|
//
|
|
139
142
|
//
|
|
140
143
|
//
|
|
141
|
-
if (isInitialLoading) {
|
|
144
|
+
if (isInitialLoading || starterEnabled && isLoading) {
|
|
142
145
|
return jsx(StyledRunboxContainer, {
|
|
143
146
|
children: jsx(Spinner, {})
|
|
144
147
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-runbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.250325.0-terminated.0",
|
|
4
4
|
"description": "User view and editing components of Elice material runbox",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@elice/intl": "0.241127.0",
|
|
54
|
-
"@elice/material-shared-types": "1.
|
|
55
|
-
"@elice/material-shared-utils": "1.
|
|
54
|
+
"@elice/material-shared-types": "1.250325.0-terminated.0",
|
|
55
|
+
"@elice/material-shared-utils": "1.250325.0-terminated.0",
|
|
56
56
|
"@elice/mui-elements": "^5.250108.0-controllabel.0",
|
|
57
57
|
"@elice/mui-system": "^5.250108.0-controllabel.0",
|
|
58
58
|
"@elice/mui-x-snackbar": "^5.250108.0-controllabel.0",
|