pollination-react-io 0.0.45-beta.2 → 0.0.45-beta.3
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Project, ProjectsApiListProjectsRequest, UserPrivate } from '@pollination-solutions/pollination-sdk';
|
|
2
2
|
import { APIClient } from '../hooks';
|
|
3
3
|
export interface SelectStudyProps {
|
|
4
|
+
projectName?: string;
|
|
4
5
|
projectOwner?: string;
|
|
5
6
|
authUser?: UserPrivate;
|
|
6
7
|
client?: APIClient;
|
package/build/index.esm.js
CHANGED
|
@@ -34183,15 +34183,15 @@ var SelectAccount = function (_a) {
|
|
|
34183
34183
|
|
|
34184
34184
|
var SelectStudy = function (_a) {
|
|
34185
34185
|
var _b;
|
|
34186
|
-
var projectOwner = _a.projectOwner, authUser = _a.authUser, client = _a.client, setSelStudy = _a.setSelStudy, queryConfig = _a.queryConfig, environment = _a.environment;
|
|
34186
|
+
var projectName = _a.projectName, projectOwner = _a.projectOwner, authUser = _a.authUser, client = _a.client, setSelStudy = _a.setSelStudy, queryConfig = _a.queryConfig, environment = _a.environment;
|
|
34187
34187
|
var _c = useState(), studies = _c[0], setStudies = _c[1];
|
|
34188
34188
|
var comboBoxRef = useRef();
|
|
34189
34189
|
var _d = useState(false), loading = _d[0], setLoading = _d[1];
|
|
34190
|
-
var fetchStudies = useCallback(function (owner) {
|
|
34190
|
+
var fetchStudies = useCallback(function (name, owner) {
|
|
34191
34191
|
if (!authUser)
|
|
34192
34192
|
return;
|
|
34193
34193
|
setLoading(true);
|
|
34194
|
-
client.jobs.listJobs(__assign$3({
|
|
34194
|
+
client.jobs.listJobs(__assign$3({ name: name,
|
|
34195
34195
|
// @ts-ignore
|
|
34196
34196
|
owner: owner, page: 1, perPage: 25 }, queryConfig))
|
|
34197
34197
|
.then(function (_a) {
|
|
@@ -34210,11 +34210,11 @@ var SelectStudy = function (_a) {
|
|
|
34210
34210
|
}, [queryConfig]);
|
|
34211
34211
|
// initial fetch
|
|
34212
34212
|
useEffect(function () {
|
|
34213
|
-
if (!authUser)
|
|
34213
|
+
if (!authUser || !projectName)
|
|
34214
34214
|
return;
|
|
34215
34215
|
var owner = projectOwner !== null && projectOwner !== void 0 ? projectOwner : authUser.username;
|
|
34216
|
-
fetchStudies(owner);
|
|
34217
|
-
}, [authUser, fetchStudies, projectOwner]);
|
|
34216
|
+
fetchStudies(projectName, owner);
|
|
34217
|
+
}, [authUser, fetchStudies, projectName, projectOwner]);
|
|
34218
34218
|
return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment, items: (_b = studies === null || studies === void 0 ? void 0 : studies.resources.map(function (r) { var _a; return (__assign$3(__assign$3({}, r), { name: (_a = r.spec.name) !== null && _a !== void 0 ? _a : "".concat(r.recipe.metadata.name, " : ").concat(r.status.id.slice(0, 5), "...") })); })) !== null && _b !== void 0 ? _b : [], setSelected: setSelStudy, inputProps: {
|
|
34219
34219
|
placeholder: 'Select a study...',
|
|
34220
34220
|
}, loading: !client || loading, disabled: !client || !(queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.owner), footer: (React__default.createElement("div", { key: "footer", style: {
|