@elice/material-runbox 1.250415.0 → 1.250424.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.
@@ -6,7 +6,9 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
6
6
  var _styled = require('@emotion/styled/base');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var React = require('react');
9
+ var apiClient = require('@elice/api-client');
9
10
  var intl = require('@elice/intl');
11
+ var materialSharedUtils = require('@elice/material-shared-utils');
10
12
  var muiElements = require('@elice/mui-elements');
11
13
  var runboxClient = require('@elice/runbox-client');
12
14
  var types = require('@elice/types');
@@ -50,6 +52,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
50
52
  var intl$1 = intl.useRawEliceIntl();
51
53
  var _useMaterialRunboxCon = MaterialRunboxContext.useMaterialRunboxContext(),
52
54
  enableAutoShutdownToggle = _useMaterialRunboxCon.enableAutoShutdownToggle;
55
+ var _useMaterialConfig = materialSharedUtils.useMaterialConfig(),
56
+ orgNameShort = _useMaterialConfig.orgNameShort;
53
57
  var _React$useState = React__default.default.useState(null),
54
58
  _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
55
59
  menuAnchorEl = _React$useState2[0],
@@ -57,6 +61,20 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
57
61
  var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
58
62
  status = _useEliceRunboxRunnin.status;
59
63
  var isRunboxRunning = status === 'running';
64
+ //
65
+ var _useQuery = reactQuery.useQuery({
66
+ queryKey: ['getGlobalOrganizationGet', orgNameShort],
67
+ queryFn: function queryFn() {
68
+ return apiClient.getGlobalOrganizationGet({
69
+ organizationNameShort: orgNameShort
70
+ });
71
+ },
72
+ select: function select(data) {
73
+ return data.organization;
74
+ },
75
+ refetchOnWindowFocus: false
76
+ }),
77
+ organization = _useQuery.data;
60
78
  /**
61
79
  *
62
80
  */
@@ -64,7 +82,7 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
64
82
  setMenuAnchorEl(null);
65
83
  };
66
84
  var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
67
- var _useQuery = reactQuery.useQuery({
85
+ var _useQuery2 = reactQuery.useQuery({
68
86
  queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
69
87
  courseId: courseId,
70
88
  runtime: runtime
@@ -84,8 +102,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
84
102
  enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
85
103
  retry: false
86
104
  }),
87
- leaderboardSubmitInfo = _useQuery.data,
88
- isLeaderboardSubmitInfoLoading = _useQuery.isLoading;
105
+ leaderboardSubmitInfo = _useQuery2.data,
106
+ isLeaderboardSubmitInfoLoading = _useQuery2.isLoading;
89
107
  /**
90
108
  *
91
109
  */
@@ -114,7 +132,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
114
132
  *
115
133
  */
116
134
  var renderHeaderActionAutoShutdown = function renderHeaderActionAutoShutdown() {
117
- if (!enableAutoShutdownToggle || isTutoring) {
135
+ var isAidtOrg = (organization === null || organization === void 0 ? void 0 : organization.organizationType) === types.enums.OrganizationType.Aidt;
136
+ if (!enableAutoShutdownToggle || isTutoring || isAidtOrg) {
118
137
  return null;
119
138
  }
120
139
  return jsxRuntime.jsx(MaterialRunboxActionAutoShutdown.default, {
@@ -2,7 +2,9 @@ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBab
2
2
  import _styled from '@emotion/styled/base';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
4
  import React from 'react';
5
+ import { getGlobalOrganizationGet } from '@elice/api-client';
5
6
  import { useRawEliceIntl } from '@elice/intl';
7
+ import { useMaterialConfig } from '@elice/material-shared-utils';
6
8
  import { Tag, EliceIcon } from '@elice/mui-elements';
7
9
  import { useEliceRunboxRunning } from '@elice/runbox-client';
8
10
  import { enums } from '@elice/types';
@@ -41,6 +43,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
41
43
  var intl = useRawEliceIntl();
42
44
  var _useMaterialRunboxCon = useMaterialRunboxContext(),
43
45
  enableAutoShutdownToggle = _useMaterialRunboxCon.enableAutoShutdownToggle;
46
+ var _useMaterialConfig = useMaterialConfig(),
47
+ orgNameShort = _useMaterialConfig.orgNameShort;
44
48
  var _React$useState = React.useState(null),
45
49
  _React$useState2 = _slicedToArray(_React$useState, 2),
46
50
  menuAnchorEl = _React$useState2[0],
@@ -48,6 +52,20 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
48
52
  var _useEliceRunboxRunnin = useEliceRunboxRunning(),
49
53
  status = _useEliceRunboxRunnin.status;
50
54
  var isRunboxRunning = status === 'running';
55
+ //
56
+ var _useQuery = useQuery({
57
+ queryKey: ['getGlobalOrganizationGet', orgNameShort],
58
+ queryFn: function queryFn() {
59
+ return getGlobalOrganizationGet({
60
+ organizationNameShort: orgNameShort
61
+ });
62
+ },
63
+ select: function select(data) {
64
+ return data.organization;
65
+ },
66
+ refetchOnWindowFocus: false
67
+ }),
68
+ organization = _useQuery.data;
51
69
  /**
52
70
  *
53
71
  */
@@ -55,7 +73,7 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
55
73
  setMenuAnchorEl(null);
56
74
  };
57
75
  var materialRunboxApi = useMaterialRunboxApiContext();
58
- var _useQuery = useQuery({
76
+ var _useQuery2 = useQuery({
59
77
  queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
60
78
  courseId: courseId,
61
79
  runtime: runtime
@@ -75,8 +93,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
75
93
  enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
76
94
  retry: false
77
95
  }),
78
- leaderboardSubmitInfo = _useQuery.data,
79
- isLeaderboardSubmitInfoLoading = _useQuery.isLoading;
96
+ leaderboardSubmitInfo = _useQuery2.data,
97
+ isLeaderboardSubmitInfoLoading = _useQuery2.isLoading;
80
98
  /**
81
99
  *
82
100
  */
@@ -105,7 +123,8 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref3) {
105
123
  *
106
124
  */
107
125
  var renderHeaderActionAutoShutdown = function renderHeaderActionAutoShutdown() {
108
- if (!enableAutoShutdownToggle || isTutoring) {
126
+ var isAidtOrg = (organization === null || organization === void 0 ? void 0 : organization.organizationType) === enums.OrganizationType.Aidt;
127
+ if (!enableAutoShutdownToggle || isTutoring || isAidtOrg) {
109
128
  return null;
110
129
  }
111
130
  return jsx(MaterialRunboxActionAutoShutdown, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-runbox",
3
- "version": "1.250415.0",
3
+ "version": "1.250424.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",
@@ -23,6 +23,7 @@
23
23
  "clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
24
24
  },
25
25
  "peerDependencies": {
26
+ "@elice/api-client": "^1",
26
27
  "@elice/intl": "^0",
27
28
  "@elice/material-shared-types": "*",
28
29
  "@elice/material-shared-utils": "*",
@@ -31,6 +32,7 @@
31
32
  "@elice/mui-x-snackbar": "^5",
32
33
  "@elice/openapi-client-material-runbox": "^1",
33
34
  "@elice/runbox-client": "^1",
35
+ "@elice/types": "^1",
34
36
  "@emotion/react": "^11.10.5",
35
37
  "@emotion/styled": "^11.10.5",
36
38
  "@fortawesome/pro-regular-svg-icons": "^6",
@@ -50,15 +52,16 @@
50
52
  "tslib": "^2.6.1"
51
53
  },
52
54
  "devDependencies": {
55
+ "@elice/api-client": "^1.241220.0",
53
56
  "@elice/intl": "0.241127.0",
54
- "@elice/material-shared-types": "1.250415.0",
55
- "@elice/material-shared-utils": "1.250415.0",
57
+ "@elice/material-shared-types": "1.250424.0",
58
+ "@elice/material-shared-utils": "1.250424.0",
56
59
  "@elice/mui-elements": "^5.250108.0-controllabel.0",
57
60
  "@elice/mui-system": "^5.250108.0-controllabel.0",
58
61
  "@elice/mui-x-snackbar": "^5.250108.0-controllabel.0",
59
62
  "@elice/openapi-client-material-runbox": "1.250319.0",
60
63
  "@elice/runbox-client": "1.241127.0",
61
- "@elice/types": "1.241220.0",
64
+ "@elice/types": "^1.241220.0",
62
65
  "@emotion/react": "^11.10.5",
63
66
  "@emotion/styled": "^11.10.5",
64
67
  "@fortawesome/pro-regular-svg-icons": "^6.4.2",