Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jul 22, 2024
1 parent 62701fe commit e4cb66f
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 167 deletions.
10 changes: 10 additions & 0 deletions src/net/Wexflow.Core.Db.MongoDB/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public override bool CheckUserWorkflow(string userId, string workflowId)
return col.Find(u => u.Username.ToLower().Contains(keywordToLower) && u.UserProfile == UserProfile.Administrator).Sort(Builders<User>.Sort.Ascending(u => u.Username)).ToEnumerable();
case UserOrderBy.UsernameDescending:
return col.Find(u => u.Username.ToLower().Contains(keywordToLower) && u.UserProfile == UserProfile.Administrator).Sort(Builders<User>.Sort.Descending(u => u.Username)).ToEnumerable();
default:
break;
}

return Array.Empty<User>();
Expand Down Expand Up @@ -374,6 +376,8 @@ public override string GetPassword(string username)
return col.Find(u => u.Username.ToLower().Contains(keywordToLower)).Sort(Builders<User>.Sort.Ascending(u => u.Username)).ToEnumerable();
case UserOrderBy.UsernameDescending:
return col.Find(u => u.Username.ToLower().Contains(keywordToLower)).Sort(Builders<User>.Sort.Descending(u => u.Username)).ToEnumerable();
default:
break;
}

return Array.Empty<User>();
Expand Down Expand Up @@ -481,6 +485,9 @@ public override void UpdatePassword(string username, string password)
case EntryOrderBy.StatusDescending:

return col.Find(he => (he.Name.ToLower().Contains(keywordToLower) || he.Description.ToLower().Contains(keywordToLower)) && he.StatusDate > from && he.StatusDate < to).Sort(Builders<HistoryEntry>.Sort.Descending(he => he.Status)).ToEnumerable().Skip(skip).Take(entriesCount);

default:
break;
}

return Array.Empty<HistoryEntry>();
Expand Down Expand Up @@ -544,6 +551,9 @@ public override void UpdatePassword(string username, string password)
case EntryOrderBy.StatusDescending:

return col.Find(e => (e.Name.ToLower().Contains(keywordToLower) || e.Description.ToLower().Contains(keywordToLower)) && e.StatusDate > from && e.StatusDate < to).Sort(Builders<Entry>.Sort.Descending(e => e.Status)).ToEnumerable().Skip(skip).Take(entriesCount);

default:
break;
}

return Array.Empty<Entry>();
Expand Down
6 changes: 6 additions & 0 deletions src/net/Wexflow.Core.Db.MySQL/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ public override void DeleteWorkflows(string[] ids)

_ = sqlBuilder.Append(Entry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" LIMIT ").Append(entriesCount).Append(" OFFSET ").Append((page - 1) * entriesCount).Append(';');
Expand Down Expand Up @@ -888,6 +891,9 @@ public override DateTime GetEntryStatusDateMin()

_ = sqlBuilder.Append(HistoryEntry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" LIMIT ").Append(entriesCount).Append(" OFFSET ").Append((page - 1) * entriesCount).Append(';');
Expand Down
6 changes: 6 additions & 0 deletions src/net/Wexflow.Core.Db.Oracle/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ public override void DeleteWorkflows(string[] ids)

_ = sqlBuilder.Append(Entry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" OFFSET ").Append((page - 1) * entriesCount).Append(" ROWS FETCH NEXT ").Append(entriesCount).Append(" ROWS ONLY");
Expand Down Expand Up @@ -841,6 +844,9 @@ public override DateTime GetEntryStatusDateMin()

_ = sqlBuilder.Append(HistoryEntry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" OFFSET ").Append((page - 1) * entriesCount).Append(" ROWS FETCH NEXT ").Append(entriesCount).Append(" ROWS ONLY");
Expand Down
6 changes: 6 additions & 0 deletions src/net/Wexflow.Core.Db.PostgreSQL/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ public override void DeleteWorkflows(string[] ids)

_ = sqlBuilder.Append(Entry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" LIMIT ").Append(entriesCount).Append(" OFFSET ").Append((page - 1) * entriesCount).Append(';');
Expand Down Expand Up @@ -887,6 +890,9 @@ public override DateTime GetEntryStatusDateMin()

_ = sqlBuilder.Append(HistoryEntry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder.Append(" LIMIT ").Append(entriesCount).Append(" OFFSET ").Append((page - 1) * entriesCount).Append(';');
Expand Down
6 changes: 6 additions & 0 deletions src/net/Wexflow.Core.Db.SQLServer/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ public override void DeleteWorkflows(string[] ids)

_ = sqlBuilder.Append(Entry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder
Expand Down Expand Up @@ -894,6 +897,9 @@ public override DateTime GetEntryStatusDateMin()

_ = sqlBuilder.Append(HistoryEntry.COLUMN_NAME_STATUS).Append(" DESC");
break;

default:
break;
}

_ = sqlBuilder
Expand Down
2 changes: 2 additions & 0 deletions src/net/Wexflow.Tasks.Ftp/Ftp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ private bool DoWork(ref bool atLeastOneSuccess)
_plugin.Delete(file);
_ = Workflow.FilesPerTask[file.TaskId].Remove(file);
break;
default:
break;
}

if (!atLeastOneSuccess)
Expand Down
2 changes: 2 additions & 0 deletions src/net/Wexflow.Tasks.Ftp/PluginFTPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public PluginFtps(Task task, string server, int port, string user, string passwo
case EncryptionMode.Implicit:
_encryptionMode = FtpEncryptionMode.Implicit;
break;
default:
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/net/Wexflow.Tasks.ImagesTransformer/ImagesTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ private bool Transform(ref bool atLeastOneSuccess)
case ImgFormat.Wmf:
img.Save(destFilePath, ImageFormat.Wmf);
break;
default:
break;
}
}
Files.Add(new FileInf(destFilePath, Id));
Expand Down
2 changes: 2 additions & 0 deletions src/net/Wexflow.Tasks.MailsReceiver/MailsReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public override TaskStatus Run()
client.Disconnect(true);
}
break;
default:
break;
}
}
catch (ThreadAbortException)
Expand Down
Loading

0 comments on commit e4cb66f

Please sign in to comment.