Very confusing ...
In this article. Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018. A deployment group is a logical set of deployment target machines that have agents installed on each one. docs.microsoft.com |
Very confusing ...
In this article. Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018. A deployment group is a logical set of deployment target machines that have agents installed on each one. docs.microsoft.com |
Create a new repo
I couldn't make git push work with DevOps. It just showed below stupid screen with wrong branch 'main' not 'master'.
The below could mismatch. That's fine. You just need to go to the DevOps site and select the correct repo.
Select correct one that you created from Visual Studio.
I want to add 4 more columns to the table.
Create a shell script
Above link's bcp command options didn't work.
Correct bcp command options could be found in:
https://docs.microsoft.com/en-us/azure/azure-sql/load-from-csv-with-bcp?view=azuresql
https://datacadamia.com/db/sql_server/bcp#csv
Also, make sure you didn't open the csv file.
https://stackoverflow.com/questions/39465354/bcp-error-unable-to-open-bcp-host-data-file
After changing 'Year' as int type, import had error.
https://stackoverflow.com/questions/604864/print-a-file-skipping-the-first-x-lines-in-bash
Run script from Informatica
Now updating priority into database
We first need to make Edit button work, then make Arrow button work.
View
Add Priority value input box
index.html
<input type="text" id="edit-priority">
site.js
updateItem() {
...
const item = {
id: parseInt(itemId, 10),
isComplete: document.getElementById('edit-isComplete').checked,
name: document.getElementById('edit-name').value.trim(),
priority: document.getElementById('edit-priority').value.trim(),
};
Model
no change
Controller
no change
All working well.
View
function increasePriority(id) {
const item = todos.find(item => item.id === id);
item.priority++;
callUpdateAPI(item);
console.log('item to increase:', item);
}
Model
no change
Controller
no change
All good, arrow button works.
Now let's sort by priority desc.
We just need to sort array data.https://stackoverflow.com/questions/1129216/sort-array-of-objects-by-string-property-value
function compare( a, b ) {
if ( a.last_nom < b.last_nom ){
return -1;
}
if ( a.last_nom > b.last_nom ){
return 1;
}
return 0;
}
objs.sort( compare );
We can modify it for priority and desc order.
View
I want to add 'Priority' column.
Priority int column in TodoItems table, default value 0
getItems
- change view
site.js
function getItems() {
displayLoading();
fetch(uri)
.then(response => response.json())
.then((data) => {
hideLoading();
_displayItems(data);
applyCompletedCss();
})
.catch(error => console.error('Unable to get items.', error));
}
function _displayItems() {
...
let tdPri = tr.insertCell(2);
let textNodePri = document.createTextNode(item.priority);
tdPri.appendChild(textNodePri);
- change model
- change controller
TodoItemsController.cs >> no change
When everything is good, GET works and it shows.
Errors
When priority is null you have below two errors.
GET https://localhost:7147/api/todoitems 500
site.js:15 Unable to get items. SyntaxError: Unexpected token S in JSON at position 0
InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.Int32'.
https://docs.microsoft.com/en-us/learn/modules/visual-studio-github-push/5-exercise-create-repo
Above links explains well how to use VS code provided github tool.
I wanted to use git commands.
Below site talks about it.
https://www.codemag.com/Article/1411061/The-Simplest-Thing-Possible-Git-and-Visual-Studio
I could download git and install was smooth, and installed Git Bash.
I followed below to delete git history because the first commit had credential strings.
https://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github
Checkout
git checkout --orphan latest_branch
Add all the files
git add -A
Commit the changes
git commit -am "commit message"
Delete the branch
git branch -D main
Rename the current branch to main
git branch -m main
Finally, force update your repository
git push -f origin main