IKT201 - Exam Project
The jigit plugin is configured with smart commits; you can read all about them here: https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/
JiGit will have the wrong namepattern for a github branch and must therefore not include "task" or other issue prefixes. This is because github does not accept "" but only "/". That is why you have to always manually change the "" -> "/"
- Traverse to azurite.exe
- Install Visual studio 2022 community, if not already installed
- Go here
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator"
- There, you will find a file called azurite.exe.
- Run this command (replace any placeholders with what matches for you)
./azurite.exe --skipApiVersionCheck --silent --location "<<choose location too store data>>" --debug "<<Choose location to store debug data>>"
- Go to the Azure Storage Explorer
- Find the storage account you are using
- Go to the container you want to set the public access level on
- Right-click the container and select "Set public access level"
- Choose the public access level you want
This is the easiest method, but it can also be done with the Azure CLI. Here is an example of how to do it with the Azure CLI:
az storage container set-permission --name <container-name> --public-access blob --account-name <storage-account-name>If you want to set it through the asp.net core application, you can use the Azure.Storage.Blobs package. Here is an example of how to do it:
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);
await containerClient.SetAccessPolicyAsync(PublicAccessType.BlobContainer);You can manually do it in Azure storage explorer, or you can use the Azure CLI. Here is an example of how to do it with the Azure CLI:
az storage cors add --methods GET --origins https://localhost:7290 --services bRun the following command in the console to build the page CSS. This has to be done for the first launch of the site, as well as any time the page layouts are changed.
npm run build:cssJamly uses sendGrid API to automatically send e-mails. To link sendGrid API to Jamly you need to complete the following steps:
- Create a SendGrid Account
- Go to the SendGrid website and create an account.
- Once your account is set up, log in to your dashboard.
- Generate an API Key
- In your SendGrid dashboard, navigate to Settings > API Keys.
- Click on the Create API Key button.
- Provide a name for the key (e.g., MyProjectKey) and assign at least "Full Access" permissions.
- Copy the API key and keep it safe. You won’t be able to view it again.
- Verify Your Sender Identity
- Navigate to Settings > Sender Authentication.
- Choose to authenticate either with Single Sender or with Domain Authentication.
- Add the SendGrid API Key to Jamly
- Open a terminal in your project’s root directory.
- Add the SendGrid API Key and sender email address to your secrets manager:
dotnet user-secrets set "AuthMessageSenderOptions:SendGridKey" "your-sendgrid-api-key" dotnet user-secrets set "AuthMessageSenderOptions:SenderEmail" "your-email@example.com"
If something has been configured wrongly you will likely get an error in the console when you run the project.
The following JavaScript code snippet converts UTC dates to local dates and times. It also updates the content of HTML elements with the data-utc attribute to display the local date and time.
- Function
convertUtcToLocal:
- Takes a UTC date string as input.
- Creates a new
Dateobject, appending 'Z' to indicate UTC. - Converts the date to a local date string in the format
day.month.year hour:minute.
- Event Listener:
- Waits for the DOM content to be fully loaded.
- Selects all elements with the
data-utcattribute. - Updates the text content of each selected element with the local date and time.
<script>
function convertUtcToLocal(utcDate) {
const date = new Date(utcDate + 'Z'); // Add 'Z' to indicate UTC
return date.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' }).replace(/\s/g, '.')
+ ' ' + date.toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' }); // 3.Dec.2024 16:00
}
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('[data-utc]').forEach(function (element) {
const utcDate = element.getAttribute('data-utc');
element.textContent = convertUtcToLocal(utcDate);
});
});
</script>- Add the Script: Include the above script in your HTML file.
- Set
data-utcAttribute: Add thedata-utcattribute to any HTML element you want to display the local date and time.
Example:
<p data-utc="2024-12-03T16:00:00">Original UTC Date</p>After the script runs, the content of the paragraph will be updated to the local date and time format.