Skip to content

Commit

Permalink
Merge branch 'main' into bug/WP-47-fix-shared-workspace-manage-team-m…
Browse files Browse the repository at this point in the history
…odal
  • Loading branch information
edmondsgarrett authored Dec 18, 2023
2 parents cf048f8 + 272c632 commit fbce247
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 15 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.4.3] - 2023-12-11: Fix push key handling
### Fixed

- WP-408: use archiveSystemId set in app definition as default (#917)


## [3.4.2] - 2023-12-07: Fix push key handling
### Fixed

Expand Down Expand Up @@ -1019,7 +1025,8 @@ WP-306: Fix target path regression (#871)
## [1.0.0] - 2020-02-28
v1.0.0 Production release as of Feb 28, 2020.

[unreleased]: https://github.com/TACC/Core-Portal/compare/v3.4.2...HEAD
[unreleased]: https://github.com/TACC/Core-Portal/compare/v3.4.3...HEAD
[3.4.3]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.3
[3.4.2]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.2
[3.4.1]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.1
[3.4.0]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.0
Expand Down
11 changes: 8 additions & 3 deletions client/src/components/Applications/AppForm/AppForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const AppSchemaForm = ({ app }) => {
coresPerNode: app.definition.jobAttributes.coresPerNode,
maxMinutes: app.definition.jobAttributes.maxMinutes,
archiveSystemId:
defaultSystem || app.definition.jobAttributes.archiveSystemId,
app.definition.jobAttributes.archiveSystemId || defaultSystem,
archiveSystemDir: app.definition.jobAttributes.archiveSystemDir,
archiveOnAppError: true,
appId: app.definition.id,
Expand Down Expand Up @@ -785,14 +785,19 @@ export const AppSchemaForm = ({ app }) => {
description="System into which output files are archived after application execution."
name="archiveSystemId"
type="text"
placeholder={defaultSystem}
placeholder={
app.definition.archiveSystemId || defaultSystem
}
/>
<FormField
label="Archive Directory"
description="Directory into which output files are archived after application execution."
name="archiveSystemDir"
type="text"
placeholder="HOST_EVAL($WORK)/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}" // TODOv3: Determine safe root path for archiving https://jira.tacc.utexas.edu/browse/WP-103
placeholder={
app.definition.archiveSystemDir ||
'HOST_EVAL($HOME)/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}'
}
/>
</>
) : null}
Expand Down
11 changes: 10 additions & 1 deletion client/src/components/Applications/AppForm/AppForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,20 @@ describe('AppSchemaForm', () => {
...initialMockState,
});

const { getByText } = renderAppSchemaFormComponent(store, {
const { getByText, container } = renderAppSchemaFormComponent(store, {
...helloWorldAppFixture,
});

const archiveSystemId = container.querySelector(
'input[name="archiveSystemId"]'
);
await waitFor(() => {
expect(getByText(/TACC-ACI/)).toBeDefined();

// use app definition default archive system
expect(archiveSystemId.value).toBe(
helloWorldAppFixture.definition.jobAttributes.archiveSystemId
);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const helloWorldAppFixture = {
execSystemInputDir: '${JobWorkingDir}',
execSystemOutputDir: '${JobWorkingDir}/output',
execSystemLogicalQueue: 'development',
archiveSystemId: 'cloud.data',
archiveSystemId: 'frontera',
archiveSystemDir:
'HOST_EVAL($HOME)/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}',
archiveOnAppError: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,32 @@ const DataFilesListing = ({ api, scheme, system, path, isPublic }) => {
const systemDisplayName = useSystemDisplayName({ scheme, system, path });
const homeDir = selectedSystem?.homeDir;

// Check if the current path is the home directory itself
const isAtHomeDir = path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, '');
// Check if the current path is the root directory
const isRootDir = path === '/' || path === '';

// Determine the sectionName based on the path (if homeDir, use systemDisplayName--else use current dir)
const sectionName = isAtHomeDir
? systemDisplayName
: getCurrentDirectory(path);
// Adjusted check for home directory
const isAtHomeDir =
isRootDir || path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, '');

// Determine the sectionName with added handling for root directory
function determineSectionName(
isAtHomeDir,
isRootDir,
systemDisplayName,
path
) {
if (isAtHomeDir) {
return isRootDir ? 'Root' : systemDisplayName;
}
return getCurrentDirectory(path);
}

const sectionName = determineSectionName(
isAtHomeDir,
isRootDir,
systemDisplayName,
path
);

return (
<>
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/PublicData/PublicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import DataFilesShowPathModal from '../DataFiles/DataFilesModals/DataFilesShowPa
import { ToolbarButton } from '../DataFiles/DataFilesToolbar/DataFilesToolbar';

import styles from './PublicData.module.css';
import dropdownStyles from '../../styles/components/dropdown-menu.css';
import CombinedBreadcrumbs from '../DataFiles/CombinedBreadcrumbs/CombinedBreadcrumbs';

const PublicData = () => {
const history = useHistory();
Expand Down Expand Up @@ -98,9 +100,9 @@ const PublicDataListing = ({ canDownload, downloadCallback }) => {
<Section
// HACK: Replicate wrapper class gives button correct global style
// WARNING: Applies unused and redundant `.workbench-content` styles
className="workbench-content"
className="workbench-content workbench-wrapper"
header={
<DataFilesBreadcrumbs
<CombinedBreadcrumbs
api={api}
scheme={scheme}
system={system}
Expand Down
1 change: 1 addition & 0 deletions server/portal/apps/workspace/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def getPublicApps(self, user):

categoryResult["apps"].append(app)

categoryResult["apps"] = sorted(categoryResult["apps"], key=lambda app: app['label'] or app['appId'])
categories.append(categoryResult)

return categories, html_definitions
Expand Down
5 changes: 5 additions & 0 deletions server/portal/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from django.views.generic.base import TemplateView
from django.urls import path, re_path, include
from impersonate import views as impersonate_views
from portal.views.views import health_check
admin.autodiscover()

urlpatterns = [
Expand Down Expand Up @@ -112,4 +113,8 @@
# version check.
path('version/', portal_version),

# health check
path('core/health-check', health_check)


] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
7 changes: 7 additions & 0 deletions server/portal/views/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import requests
import json


# route to be used for testing purposes
API_ROUTE = '/api/system-monitor/'

Expand Down Expand Up @@ -110,3 +111,9 @@ def test_exception(client, api_method_mock):
response = client.get(API_ROUTE)
assert response.status_code == 500
assert json.loads(response.content) == {'message': 'Something went wrong here...'}


def test_health_check(client):
response = client.get('/core/health-check')
assert response.status_code == 200
assert json.loads(response.content) == {'status': 'healthy'}
7 changes: 6 additions & 1 deletion server/portal/views/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from django.http import HttpResponse
from django.http import HttpResponse, JsonResponse

logger = logging.getLogger(__name__)

Expand All @@ -23,3 +23,8 @@ def project_version(request):
version = 'UNKNOWN'

return HttpResponse(version, content_type='text/plain')


def health_check(request):
health_status = {'status': 'healthy'}
return JsonResponse(health_status)

0 comments on commit fbce247

Please sign in to comment.