Skip to content

Commit

Permalink
[CR] - Remove priority requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
NishalJohn committed Mar 17, 2024
1 parent d78b240 commit 00028d9
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 77 deletions.
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import './App.css';

import { AssetLibrary } from "./pages/AssetLibrary/AssetLibrary"
import { EditAsset } from "./pages/AssetLibrary/AssetActions/EditAsset"
import { DocumentLibrary } from "./pages/DocumentLibrary/DocumentLibrary"
import { ResourceLibrary } from "./pages/ResourceLibrary/ResourceLibrary"
import { AddResource } from "./pages/ResourceLibrary/AddResource"
Expand All @@ -26,6 +27,7 @@ function App() {
<Route path='/' element={<Home />} />
<Route path='/login' element={<Login />} />
<Route path='/assets' element={<AssetLibrary />} />
<Route path='/assets/edit' element={<EditAsset />} />
<Route path='/documents' element={<DocumentLibrary />} />
<Route path='/resources' element={<ResourceLibrary />} />
<Route path='/resources/add' element={<AddResource />} />
Expand Down
38 changes: 0 additions & 38 deletions src/pages/AssetLibrary/AnimationAssetLibraryModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const AnimationAssetLibraryModal = ({ onAddResource }) => {
const [open, setOpen] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const [modalText, setModalText] = useState('Content of the modal');
const [priorityLevel, setPriorityLevel] = useState('Priority: Moderate');
const { Text, Link } = Typography;
const { Option } = Select;
const { Title } = Typography;
Expand Down Expand Up @@ -92,7 +91,6 @@ export const AnimationAssetLibraryModal = ({ onAddResource }) => {
'project': values.project,
'assettype': values.assettype,
'assetLink': values.assetUrl,
'priority': values.priority,
'dateUpdated': Date.now(),
'pipeline': JSON.stringify(pipelineAssignees),
'tags': selectedTags,
Expand All @@ -112,29 +110,6 @@ export const AnimationAssetLibraryModal = ({ onAddResource }) => {



const onChangePriority = (value) => {
switch (value) {
case 1:
setPriorityLevel("Priority: Very Low");
break;
case 2:
setPriorityLevel("Priority: Low");
break;
case 3:
setPriorityLevel("Priority: Moderate");
break;
case 4:
setPriorityLevel("Priority: High");
break;
case 5:
setPriorityLevel("Priority: Urgent");
break;
default:
setPriorityLevel("Priority: Moderate");
break;
}
};


//---------------------

Expand Down Expand Up @@ -251,7 +226,6 @@ export const AnimationAssetLibraryModal = ({ onAddResource }) => {
autoComplete="off"
layout='vertical'
initialValues={{
priority: 3,
assettype: "Prop",
project: "Internal",
specialnotes: "-",
Expand Down Expand Up @@ -326,18 +300,6 @@ export const AnimationAssetLibraryModal = ({ onAddResource }) => {
</Form.Item>


<Form.Item name="priority" label={priorityLevel} style={{ marginBottom: "20px" }}>
<Slider max={5} min={1} defaultValue={3} onChange={onChangePriority} initialValues={3}
marks={{
1: '1',
2: '2',
3: '3',
4: '4',
5: '5',
}}
/>
</Form.Item>



{/* //-------------------Tags---------------------- */}
Expand Down
117 changes: 117 additions & 0 deletions src/pages/AssetLibrary/AssetActions/EditAsset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import { Button, Modal, Form, Input, Slider, Select, Typography, Space, Tag, Steps } from 'antd';
import { addDoc, collection } from 'firebase/firestore';
import { db } from "../../../config/firebase";
import { PlusCircleOutlined, CheckOutlined, UserOutlined, MehOutlined } from '@ant-design/icons';



export const EditAsset = () => {

const [form] = Form.useForm();
const [currentClient, setCurrentClient] = useState("Revox");
const { CheckableTag } = Tag;
const [selectedTags, setSelectedTags] = useState([]);
const { Title } = Typography;
const [currentStep, setCurrentProgress] = useState(0);
const [currentProgress, saveUpdatedProgress] = useState({});
const { TextArea } = Input;

const onFinish = (values) => {
console.log('Submitting:', values);
};
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};

const onProjectChange = (e) => {
switch (e) {
case "Internal":
setCurrentClient("Revox")
break;
case "Spiral":
setCurrentClient("Revox")
break;
case "Starwalker":
setCurrentClient("Marius")
break;
case "Goodness Game":
setCurrentClient("Foundation of Goodness")
break;
case "Other":
setCurrentClient("Unknown")
break;
default:
setCurrentClient("Unknown")
break;
}
};

const tagsData = ["Architecture",
"Sci-Fi",
"Realistic",
"Low-Poly",
"Modern",
"Fantasy",
"Steam/Cyber punk",
"Horror",
"Medieval",
"Forest",
"Underground",
"Kitchen",
"Interior",
"Hospital",
"Outdoor",
"Farm",
"Cave",
"Underwater",
"Furniture",
"Electronic",
"Construction",
"Food",
"Sports",
"Medical",

];


return (


<>
<h1>AssetAction</h1>
<div className="container form-container-assets">
<Form
form={form}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
layout='vertical'
initialValues={{
// priority: 3,
// assettype: "Prop",
// project: "Internal",
// specialnotes: "-"

}}
>
<div className=''>
<Form.Item label="Asset Name" name="assetName" hasFeedback
rules={[
{
required: true,
message: 'Please enter a recognizable name for the asset',
},
]}
>
<Input />
</Form.Item>
</div>
</Form>

</div>
</>

);
}
38 changes: 0 additions & 38 deletions src/pages/AssetLibrary/AssetLibraryModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const AssetLibraryModal = ({ onAddResource }) => {
const [open, setOpen] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const [modalText, setModalText] = useState('Content of the modal');
const [priorityLevel, setPriorityLevel] = useState('Priority: Moderate');
const { Text, Link } = Typography;
const { Option } = Select;
const { Title } = Typography;
Expand Down Expand Up @@ -95,7 +94,6 @@ export const AssetLibraryModal = ({ onAddResource }) => {
'assettype': values.assettype,
'assetLink': values.assetUrl,
'conceptArtUrl': values.cocneptUrl,
'priority': values.priority,
'pipeline': JSON.stringify(pipelineAssignees),
'tags': selectedTags,
'client': currentClient,
Expand All @@ -115,29 +113,6 @@ export const AssetLibraryModal = ({ onAddResource }) => {



const onChangePriority = (value) => {
switch (value) {
case 1:
setPriorityLevel("Priority: Very Low");
break;
case 2:
setPriorityLevel("Priority: Low");
break;
case 3:
setPriorityLevel("Priority: Moderate");
break;
case 4:
setPriorityLevel("Priority: High");
break;
case 5:
setPriorityLevel("Priority: Urgent");
break;
default:
setPriorityLevel("Priority: Moderate");
break;
}
};


//---------------------

Expand Down Expand Up @@ -252,7 +227,6 @@ export const AssetLibraryModal = ({ onAddResource }) => {
autoComplete="off"
layout='vertical'
initialValues={{
priority: 3,
assettype: "Prop",
project: "Internal",
specialnotes:"-"
Expand Down Expand Up @@ -329,18 +303,6 @@ export const AssetLibraryModal = ({ onAddResource }) => {
</Form.Item>


<Form.Item name="priority" label={priorityLevel} style={{ marginBottom: "20px" }}>
<Slider max={5} min={1} defaultValue={3} onChange={onChangePriority} initialValues={3}
marks={{
1: '1',
2: '2',
3: '3',
4: '4',
5: '5',
}}
/>
</Form.Item>



{/* //-------------------Tags---------------------- */}
Expand Down
1 change: 0 additions & 1 deletion src/pages/AssetLibrary/MarketplaceAssetLibraryModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ export const MarketplaceAssetLibraryModal = ({ onAddResource }) => {
autoComplete="off"
layout='vertical'
initialValues={{
priority: 3,
assettype: "Prop",
source: "epic",
project: "Internal",
Expand Down

0 comments on commit 00028d9

Please sign in to comment.