Skip to content

Commit

Permalink
Merge pull request #10 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release: 1.2.7
  • Loading branch information
MichaelTaylor3D authored Sep 7, 2023
2 parents 26879f7 + faadf88 commit ab312bc
Show file tree
Hide file tree
Showing 20 changed files with 173 additions and 220 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-registry-cadt-ui",
"version": "1.2.6",
"version": "1.2.8",
"private": true,
"author": "Chia Network Inc. <[email protected]>",
"homepage": "./",
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/APIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const APIDataTable = withTheme(
let fullRecord = null;

if (actions === 'Projects') {
fullRecord = projects.filter(
fullRecord = projects?.filter(
project =>
project.warehouseProjectId === partialRecord.warehouseProjectId,
)[0];
Expand Down
3 changes: 1 addition & 2 deletions src/components/blocks/UnitsDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const UnitsDetails = ({ data, stagingData, changeColor }) => {
<Body size="Bold" width="100%">
<FormattedMessage id="unit-block-start" />
</Body>
{data &&
detailsViewData('data', data, 'unitBlockStart', changeColor)}
{data && detailsViewData('data', data, 'unitBlockStart', false)}
{stagingData &&
detailsViewData(
'stagingData',
Expand Down
29 changes: 29 additions & 0 deletions src/components/forms/OrgCreateFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ const OrgCreateFormModal = ({ onClose }) => {
const [formData, setFormData] = useState({
name: '',
png: null,
prefix: '',
});
const [importedOrgUid, setImportedOrgUid] = useState('');
const [tabValue, setTabValue] = useState(0);

const nameIsValid = formData?.name?.length > 0;
const prefixIsValid = formData?.prefix?.length > 0;
const isOrgUidValid = importedOrgUid?.length > 4;

const handleTabChange = (event, newValue) => {
Expand Down Expand Up @@ -113,6 +115,33 @@ const OrgCreateFormModal = ({ onClose }) => {
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
*<FormattedMessage id="organization-prefix" />
</Body>
</StyledLabelContainer>
<InputContainer>
<StandardInput
size={InputSizeEnum.large}
variant={InputVariantEnum.default}
value={formData.prefix}
onChange={value =>
setFormData(prevState => ({
...prevState,
prefix: value,
}))
}
/>
</InputContainer>
{!prefixIsValid && (
<Body size="Small" color="red">
{intl.formatMessage({
id: 'add-valid-organization-prefix',
})}
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
Expand Down
30 changes: 29 additions & 1 deletion src/components/forms/OrgEditFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import {
} from '..';
import { editExistingOrg } from '../../store/actions/climateWarehouseActions';

const OrgEditFormModal = ({ onClose, name, icon }) => {
const OrgEditFormModal = ({ onClose, name, prefix, icon }) => {
const intl = useIntl();
const dispatch = useDispatch();
const { notification } = useSelector(state => state.app);
const [formData, setFormData] = useState({
name,
prefix,
png: icon,
});

Expand Down Expand Up @@ -81,6 +82,33 @@ const OrgEditFormModal = ({ onClose, name, icon }) => {
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
*<FormattedMessage id="organization-prefix" />
</Body>
</StyledLabelContainer>
<InputContainer>
<StandardInput
size={InputSizeEnum.large}
variant={InputVariantEnum.default}
value={formData.prefix}
onChange={value =>
setFormData(prevState => ({
...prevState,
prefix: value,
}))
}
/>
</InputContainer>
{!nameIsValid && (
<Body size="Small" color="red">
{intl.formatMessage({
id: 'add-valid-organization-prefix',
})}
</Body>
)}
</StyledFieldContainer>
<StyledFieldContainer>
<StyledLabelContainer>
<Body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ProjectEditModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ProjectEditModal = ({
}) => {
const projectToBeEdited = useSelector(
state =>
state.climateWarehouse.projects.filter(
state?.climateWarehouse?.projects?.filter(
project => project.warehouseProjectId === record.warehouseProjectId,
)[0],
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ProjectTransferModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ProjectTransferModal = ({
}) => {
const projectToBeTransferred = useSelector(
state =>
state.climateWarehouse.projects.filter(
state?.climateWarehouse?.projects?.filter(
project => project.warehouseProjectId === record.warehouseProjectId,
)[0],
);
Expand Down
2 changes: 0 additions & 2 deletions src/components/forms/UnitCreateModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const emptyUnit = {
countryJurisdictionOfOwner: '',
inCountryJurisdictionOfOwner: '',
unitCount: 0,
unitBlockEnd: '',
unitBlockStart: '',
marketplace: '',
marketplaceLink: '',
marketplaceIdentifier: '',
Expand Down
Loading

0 comments on commit ab312bc

Please sign in to comment.