Compare commits
No commits in common. "66f0d22970ac0dba22fa7724402ac633d873f010" and "e682b8a619cac8065eb06863e5c5c082de097f4e" have entirely different histories.
66f0d22970
...
e682b8a619
107
app.js
107
app.js
@ -132,54 +132,33 @@ function Desks(inDesks)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let emptyCount = 0;
|
||||||
|
|
||||||
const work = [];
|
/** @type {(part:TYPES.Part, index:number, array:TYPES.Part[], pass:TYPES.Pass, dirty:number[], type:"need"|"make")=>HTMLElement|null} */
|
||||||
for(const [pass, scan] of desk.pass)
|
const Iterator = (part, index, array, pass, dirty, type)=>{
|
||||||
{
|
|
||||||
|
|
||||||
// at least one but not all need fields are empty
|
|
||||||
const caution = scan.need_empty.length>0 && scan.need_empty.length<desk.need.length;
|
|
||||||
|
|
||||||
work.push(DOM.tr(
|
|
||||||
DOM.td(pass.name),
|
|
||||||
desk.need.map((part, index, array)=>
|
|
||||||
{
|
|
||||||
const partPass = part.pass.get(pass);
|
const partPass = part.pass.get(pass);
|
||||||
if(!partPass){ return null }
|
if(partPass)
|
||||||
const latest = partPass.work.find(t=>t[0] == partPass.time)?.[1];
|
|
||||||
|
|
||||||
const attributes = {};
|
|
||||||
|
|
||||||
if(latest)
|
|
||||||
{
|
{
|
||||||
attributes.class = Tag("PartGood")
|
const time = partPass.time;
|
||||||
|
const latest = partPass.work.find(t=>t[0] == time);
|
||||||
|
|
||||||
|
if(type == "need")
|
||||||
|
{
|
||||||
|
if(!latest)
|
||||||
|
{
|
||||||
|
emptyCount++;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
attributes.class = caution ? Tag("PartCaution") : Tag("PartEmpty")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scan.need_dirty.includes(index))
|
|
||||||
{
|
|
||||||
attributes.class = Tag("PartDirty")
|
|
||||||
}
|
|
||||||
|
|
||||||
return DOM.td(
|
|
||||||
Div.Part(
|
|
||||||
attributes,
|
|
||||||
latest
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
DOM.td("⇉"),
|
|
||||||
desk.make.map((part, index, array)=>
|
|
||||||
{
|
|
||||||
const partPass = part.pass.get(pass);
|
|
||||||
if(!partPass){ return null }
|
|
||||||
const latest = partPass.work.find(t=>t[0] == partPass.time)?.[1];
|
|
||||||
|
|
||||||
const attributes = {
|
const attributes = {
|
||||||
onclick(){
|
class: dirty.includes(index) ? Tag("DeskDirty") : (type == "need"&&!latest) ? Tag("PartEmpty") : ""
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if(type == "make")
|
||||||
|
{
|
||||||
|
attributes.onclick=function(){
|
||||||
loggedIn.rawVal && van.add(this, Input((str)=>{
|
loggedIn.rawVal && van.add(this, Input((str)=>{
|
||||||
if(loggedIn.rawVal)
|
if(loggedIn.rawVal)
|
||||||
{
|
{
|
||||||
@ -196,38 +175,34 @@ function Desks(inDesks)
|
|||||||
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if(latest)
|
|
||||||
{
|
|
||||||
attributes.class = Tag("PartGood")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
attributes.class = Tag("PartEmpty")
|
|
||||||
}
|
|
||||||
|
|
||||||
if( (desk.need.length==0 && !latest) || scan.make_dirty.includes(index))
|
|
||||||
{
|
|
||||||
|
|
||||||
if(!latest && caution)
|
|
||||||
{
|
|
||||||
attributes.class = Tag("PartCaution")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
attributes.class = Tag("PartDirty");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return DOM.td(
|
return DOM.td(
|
||||||
Div.Part(
|
Div.Part(
|
||||||
attributes,
|
attributes,
|
||||||
latest
|
latest?.[1] || ""
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}),
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const work = [];
|
||||||
|
for(const [pass, dirty] of desk.pass)
|
||||||
|
{
|
||||||
|
emptyCount = 0;
|
||||||
|
|
||||||
|
const need = desk.need.map((part, index, array)=>Iterator(part, index, array, pass, dirty.need, "need"));
|
||||||
|
if(desk.need.length == 0 || emptyCount == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
work.push(DOM.tr(
|
||||||
|
DOM.td(pass.name),
|
||||||
|
need,
|
||||||
|
DOM.td("->"),
|
||||||
|
desk.make.map((part, index, array)=>Iterator(part, index, array, pass, dirty.make, "make"))
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +214,7 @@ function Desks(inDesks)
|
|||||||
DOM.tr(
|
DOM.tr(
|
||||||
DOM.th(),
|
DOM.th(),
|
||||||
desk.need.map((part, index)=>DOM.th(part.name)),
|
desk.need.map((part, index)=>DOM.th(part.name)),
|
||||||
DOM.th("→"),
|
DOM.th(),
|
||||||
desk.make.map((part, index)=>DOM.th(part.name))
|
desk.make.map((part, index)=>DOM.th(part.name))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@ -219,9 +219,6 @@ const Scan =(desk, pass)=>
|
|||||||
const dirtyNeed = [];
|
const dirtyNeed = [];
|
||||||
const dirtyMake = [];
|
const dirtyMake = [];
|
||||||
|
|
||||||
const emptyNeed = [];
|
|
||||||
const emptyMake = [];
|
|
||||||
|
|
||||||
let makeMin = Infinity;
|
let makeMin = Infinity;
|
||||||
let needMax = -Infinity;
|
let needMax = -Infinity;
|
||||||
|
|
||||||
@ -231,7 +228,6 @@ const Scan =(desk, pass)=>
|
|||||||
const part = desk.need[i];
|
const part = desk.need[i];
|
||||||
const partPassTime = part.pass.get(pass)?.time || 0;
|
const partPassTime = part.pass.get(pass)?.time || 0;
|
||||||
if(partPassTime > needMax) needMax = partPassTime;
|
if(partPassTime > needMax) needMax = partPassTime;
|
||||||
if(!partPassTime) emptyNeed.push(i)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update makeMin AND dirty check makes
|
// update makeMin AND dirty check makes
|
||||||
@ -240,8 +236,10 @@ const Scan =(desk, pass)=>
|
|||||||
const part = desk.make[i];
|
const part = desk.make[i];
|
||||||
const partPassTime = part.pass.get(pass)?.time || 0;
|
const partPassTime = part.pass.get(pass)?.time || 0;
|
||||||
if(partPassTime < makeMin) makeMin = partPassTime;
|
if(partPassTime < makeMin) makeMin = partPassTime;
|
||||||
if(partPassTime < needMax) dirtyMake.push(i);
|
if(partPassTime < needMax)
|
||||||
if(!partPassTime) emptyMake.push(i)
|
{
|
||||||
|
dirtyMake.push(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dirty check needs
|
// dirty check needs
|
||||||
@ -249,8 +247,11 @@ const Scan =(desk, pass)=>
|
|||||||
{
|
{
|
||||||
const part = desk.need[i];
|
const part = desk.need[i];
|
||||||
const partPassTime = part.pass.get(pass)?.time || 0;
|
const partPassTime = part.pass.get(pass)?.time || 0;
|
||||||
if(partPassTime > makeMin) dirtyNeed.push(i);
|
if(partPassTime > makeMin)
|
||||||
|
{
|
||||||
|
dirtyNeed.push(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
desk.pass.set(pass, {need_dirty:dirtyNeed, make_dirty:dirtyMake, need_empty:emptyNeed, make_empty:emptyMake})
|
desk.pass.set(pass, {need:dirtyNeed, make:dirtyMake})
|
||||||
};
|
};
|
||||||
@ -1,10 +1,10 @@
|
|||||||
export type User = {name:string, id:string, desk:Set<Desk>};
|
export type User = {name:string, id:string, desk:Set<Desk>};
|
||||||
export type Role = {name:string, id:string, user:User[]};
|
export type Role = {name:string, id:string, user:User[]};
|
||||||
export type Desk = {name:string, id:string, need:Part[], time:number[], make:Part[], pass:Map<Pass, Scan>, mode:string, role:Role[]};
|
export type Desk = {name:string, id:string, need:Part[], time:number[], make:Part[], pass:Map<Pass, Flag>, mode:string, role:Role[]};
|
||||||
export type Pass = {name:string, id:string, path:string, live:boolean, load:()=>Promise<void>, dump:()=>void};
|
export type Pass = {name:string, id:string, path:string, live:boolean, load:()=>Promise<void>, dump:()=>void};
|
||||||
export type Part = {name:string, id:string, pass:Map<Pass, {time:number, work:Work[], make:(user:User, data:string)=>Promise<void>}>, need:Desk[], make:Desk[]};
|
export type Part = {name:string, id:string, pass:Map<Pass, {time:number, work:Work[], make:(user:User, data:string)=>Promise<void>}>, need:Desk[], make:Desk[]};
|
||||||
export type Work = [time:number, data:string, user:User];
|
export type Work = [time:number, data:string, user:User];
|
||||||
export type Scan = {need_dirty:number[], make_dirty:number[], need_empty:number[], make_empty:number[]}
|
export type Flag = {need:number[], make:number[]}
|
||||||
|
|
||||||
export type GraphBuilder=
|
export type GraphBuilder=
|
||||||
<
|
<
|
||||||
|
|||||||
@ -8,7 +8,7 @@ const user = {
|
|||||||
u6:"Matt Y",
|
u6:"Matt Y",
|
||||||
u7:"Seth F",
|
u7:"Seth F",
|
||||||
u8:"Brittany F"
|
u8:"Brittany F"
|
||||||
};
|
}
|
||||||
|
|
||||||
export default CreateAllRooms({
|
export default CreateAllRooms({
|
||||||
room_01:Room({
|
room_01:Room({
|
||||||
@ -22,20 +22,15 @@ export default CreateAllRooms({
|
|||||||
p1:"Page title",
|
p1:"Page title",
|
||||||
p2:"Page slug",
|
p2:"Page slug",
|
||||||
p3:"Page preview",
|
p3:"Page preview",
|
||||||
p4:"Page Project",
|
|
||||||
},
|
},
|
||||||
desk:{
|
desk:{
|
||||||
d1:["Write page metas", ["admin", "write"], "all", {}, "p1", "p2"],
|
d1:["Write page metas", ["admin", "write"], "all", {}, "p1", "p2"],
|
||||||
d2:["Build Page preview", ["admin", "dev"], "all", {p1:1, p2:1}, "p3", "p4"]
|
d2:["Build Page preview", ["admin", "dev"], "all", {p1:1, p2:1}, "p3" ]
|
||||||
},
|
},
|
||||||
pass:{
|
pass:{
|
||||||
pass_01:["January"],
|
pass_01:["January"],
|
||||||
pass_02:["February"],
|
pass_02:["February"],
|
||||||
pass_03:["March"],
|
pass_03:["March"],
|
||||||
pass_04:["April"],
|
|
||||||
pass_05:["May"],
|
|
||||||
pass_06:["June"],
|
|
||||||
pass_07:["July"],
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
9
mock-user-folder/store/room_01/pass_01/u1.json
Normal file
9
mock-user-folder/store/room_01/pass_01/u1.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"p1":
|
||||||
|
[
|
||||||
|
[123, "data"],
|
||||||
|
[456, "more data"],
|
||||||
|
[789, "even more data"],
|
||||||
|
[101112, "even more data"]
|
||||||
|
]
|
||||||
|
}
|
||||||
8
mock-user-folder/store/room_01/pass_01/u2.json
Normal file
8
mock-user-folder/store/room_01/pass_01/u2.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"p2":
|
||||||
|
[
|
||||||
|
[123, "data"],
|
||||||
|
[456, "more data"],
|
||||||
|
[789, "even more data"]
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762196165935,
|
|
||||||
"normal title"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p2": [
|
|
||||||
[
|
|
||||||
1762196173135,
|
|
||||||
"normal slug"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"p4": [
|
|
||||||
[
|
|
||||||
1762193485093,
|
|
||||||
"Make made Late"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762186057868,
|
|
||||||
"Need made Early"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"p4": [
|
|
||||||
[
|
|
||||||
1762196034794,
|
|
||||||
"Make made Early"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762196047017,
|
|
||||||
"Need made Late"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"p3": [
|
|
||||||
[
|
|
||||||
1762196236384,
|
|
||||||
"complete 3"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p4": [
|
|
||||||
[
|
|
||||||
1762196245327,
|
|
||||||
"complete 4"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762196209704,
|
|
||||||
"complete 1"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p2": [
|
|
||||||
[
|
|
||||||
1762196217319,
|
|
||||||
"complete 2"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"p3": [
|
|
||||||
[
|
|
||||||
1762196341950,
|
|
||||||
"complete 3"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p4": [
|
|
||||||
[
|
|
||||||
1762196348950,
|
|
||||||
"complete 4"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
1762196393702,
|
|
||||||
"complete Later"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762196328127,
|
|
||||||
"complete 1"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"p2": [
|
|
||||||
[
|
|
||||||
1762196335342,
|
|
||||||
"complete 2"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
1762196363079,
|
|
||||||
"complete Late"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"p1": [
|
|
||||||
[
|
|
||||||
1762201681431,
|
|
||||||
"underway"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
20
styles.js
20
styles.js
@ -12,25 +12,11 @@ export default Gale({
|
|||||||
Part:{
|
Part:{
|
||||||
border: `1px solid black`,
|
border: `1px solid black`,
|
||||||
borderRadius: `5px`,
|
borderRadius: `5px`,
|
||||||
padding: `1rem`,
|
padding: `1rem`
|
||||||
},
|
|
||||||
PartGood:{
|
|
||||||
background:"#009b2e",
|
|
||||||
color:"white",
|
|
||||||
fontWeight: "bolder",
|
|
||||||
},
|
},
|
||||||
PartEmpty:{
|
PartEmpty:{
|
||||||
background:"gray"
|
background:"gray"
|
||||||
},
|
},
|
||||||
PartDirty:{
|
|
||||||
background:"tomato",
|
|
||||||
color:"black",
|
|
||||||
fontWeight:"bolder"
|
|
||||||
},
|
|
||||||
PartCaution:{
|
|
||||||
background:"yellow",
|
|
||||||
color:"black",
|
|
||||||
},
|
|
||||||
BlockScreen:{
|
BlockScreen:{
|
||||||
position: "fixed",
|
position: "fixed",
|
||||||
zIndex: "9999",
|
zIndex: "9999",
|
||||||
@ -45,6 +31,10 @@ export default Gale({
|
|||||||
borderRadius: `5px`,
|
borderRadius: `5px`,
|
||||||
padding: `1rem`
|
padding: `1rem`
|
||||||
},
|
},
|
||||||
|
DeskDirty:{
|
||||||
|
background:"tomato",
|
||||||
|
color:"white",
|
||||||
|
},
|
||||||
GapHorizontal:{
|
GapHorizontal:{
|
||||||
borderCollapse:"separate",
|
borderCollapse:"separate",
|
||||||
borderSpacing:"0 2rem",
|
borderSpacing:"0 2rem",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user