Skip to content

Commit

Permalink
Fixed upload page
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed May 5, 2022
1 parent d223253 commit ff42570
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
3 changes: 2 additions & 1 deletion ui/src/app/dashboard/view/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import API_BASE_PATH from '../../App.constant';
import { useNonAdminSources } from '../../metadata/hooks/api';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
import Badge from 'react-bootstrap/esm/Badge';

export function Dashboard () {

Expand Down Expand Up @@ -89,7 +90,7 @@ export function Dashboard () {
<Nav.Item>
<NavLink className="nav-link d-flex align-items-center" to={`${path}/admin/actions`}>
<Translate value="label.action-required">Action Required</Translate>
<span className="badge badge-pill badge-danger ms-1">{actions}</span>
<Badge pill bg="danger" className="ms-1">{actions}</Badge>
</NavLink>
</Nav.Item>
</>
Expand Down
5 changes: 3 additions & 2 deletions ui/src/app/form/component/widgets/AttributeReleaseWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons";
import Button from 'react-bootstrap/Button';
import ListGroup from 'react-bootstrap/ListGroup';
import Badge from "react-bootstrap/esm/Badge";

const selectValue = (value, selected, all) => {
const at = all.indexOf(value);
Expand Down Expand Up @@ -117,10 +118,10 @@ const AttributeReleaseWidget = ({
>
<strong><Translate value="label.bundle-disp" params={{name: option.label}}></Translate></strong>
<p id={`bundle-descr-${i}`} className="sr-only">Bundled attributes: {option.value.join(', ')}</p>
<span className={`${option.selected ? 'badge-primary' : 'badge-light'} badge border p-2`}>
<Badge bg={ option.selected ? 'primary' : 'light' } className={`border p-2`}>
<Translate value="action.select-bundle">Select Bundle</Translate>
<FontAwesomeIcon icon={faCheck} className="ms-1" />
</span>
</Badge>
</ListGroup.Item>
))}
</ListGroup>
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/form/component/widgets/TextWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const TextWidget = ({
</Form.Label>
<Form.Control
id={id}
name=""
placeholder={placeholder}
autoFocus={autofocus}
required={required}
Expand Down
9 changes: 5 additions & 4 deletions ui/src/app/metadata/component/MetadataHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { createNotificationAction, NotificationTypes, useNotificationDispatcher
import { useTranslator } from '../../i18n/hooks';
import { useMetadataLoader } from '../hoc/MetadataSelector';
import Form from 'react-bootstrap/Form';
import Badge from 'react-bootstrap/esm/Badge';

export function MetadataHeader ({ showGroup, model, current = true, enabled = true, children, ...props }) {

Expand Down Expand Up @@ -84,13 +85,13 @@ export function MetadataHeader ({ showGroup, model, current = true, enabled = tr
</div>

<p className="card-text">
<span className={`badge badge-${enabled ? 'primary' : 'danger' }`}>
<Badge bg={ enabled ? 'primary' : 'danger' }>
<Translate value={`value.${enabled ? 'enabled' : 'disabled'}`}>Enabled</Translate>
</span>
</Badge>
&nbsp;
<span className={`badge badge-${current ? 'primary' : 'warning'}`}>
<Badge bg={ enabled ? 'primary' : 'warning' }>
<Translate value={`value.${current ? 'current' : 'not-current'}`}>Current</Translate>
</span>
</Badge>
</p>

</div>
Expand Down
9 changes: 5 additions & 4 deletions ui/src/app/metadata/view/MetadataUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function MetadataUpload() {
</li>
</ul>
<fieldset className="bg-light border rounded p-4">
<div className="form-group">
<div className="form-group mb-3">
<label htmlFor="serviceProviderName">
<Translate value="label.service-resolver-name-dashboard-display-only">Service Resolver Name (Dashboard Display Only)</Translate>
<FontAwesomeIcon icon={faAsterisk} className="text-danger" />
Expand All @@ -122,8 +122,9 @@ export function MetadataUpload() {
</Translate>
</small>}
</div>
<div className="form-group">
<Form.File
<div className="form-group mb-3">
<Form.Control
type="file"
id="custom-file"
disabled={watchUrl}
accept={'.xml'}
Expand All @@ -141,7 +142,7 @@ export function MetadataUpload() {
<Translate value="label.or">OR</Translate>
&mdash;
</div>
<div className="form-group">
<div className="form-group mb-3">
<label htmlFor="url"><Translate value="label.service-resolver-metadata-url">Service Resolver Metadata URL</Translate></label>
<input id="url" disabled={ watchFile && watchFile.length > 0 } type="text" className="form-control"{...register('url')} />
</div>
Expand Down
8 changes: 7 additions & 1 deletion ui/src/app/metadata/view/MetadataWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ export function MetadataWizard ({type, data, onCallback}) {

const [blocking, setBlocking] = React.useState(false);

const gotoDetail = () => {
setTimeout(() => {
history.push(`/dashboard/metadata/manager/${type === 'source' ? 'resolvers' : 'providers'}`);
}, 1);
};

async function save(metadata) {
await post('', metadata);
if (response.ok) {
setBlocking(false);
history.push(`/dashboard/metadata/manager/${type === 'source' ? 'resolvers' : 'providers'}`);
gotoDetail();
} else {
let msg;
if (response.status) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {

const port = 8080;
const port = 10101;

app.use(
'/api',
Expand Down
4 changes: 3 additions & 1 deletion ui/src/theme/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@ $theme-color-interval: 8%;
$font-size-xs: .75rem !default;
$fa-font-path: "~font-awesome/fonts";

$body-bg: $gray-100;
$body-bg: $gray-100;

$link-decoration: none;

0 comments on commit ff42570

Please sign in to comment.