Compare commits
6 Commits
21683f5e8b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f1ccb7375b | |||
| f5ef2aac0f | |||
| fae65a637c | |||
| fd5ec49569 | |||
| 8daa8bf0ff | |||
| 788ec55bde |
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "3cx-tapi",
|
||||
"description": "3CX CP Tapi and Projectmanager integration",
|
||||
"version": "9.6.0",
|
||||
"version": "9.6.1",
|
||||
"author": {
|
||||
"name": "Daniel Triendl",
|
||||
"email": "d.triendl@cp-solutions.at"
|
||||
|
||||
@@ -42,7 +42,7 @@ export class Status {
|
||||
if (!this._enabled || !this._user) {
|
||||
return;
|
||||
}
|
||||
var entry = avs.find(a => a.user === this._user);
|
||||
var entry = avs.find(a => a.user.toLowerCase() === this._user.toLowerCase());
|
||||
if (!entry) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<OpenApiDocumentsDirectory>.</OpenApiDocumentsDirectory>
|
||||
<Version>9.6.0</Version>
|
||||
<Version>9.6.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -22,6 +22,7 @@ COPY ["server/src/CPATapi.Server/CPATapi.Server.csproj", "server/src/CPATapi.Ser
|
||||
RUN dotnet restore "server/src/CPATapi.Server/CPATapi.Server.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/server/src/CPATapi.Server"
|
||||
COPY --from=build-userscript ["/src/dist/3CX TAPI.prod.user.js", "./wwwroot/3CX_TAPI.user.js"]
|
||||
RUN dotnet build "./CPATapi.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
# This stage is used to publish the service project to be copied to the final stage
|
||||
@@ -33,5 +34,4 @@ RUN dotnet publish "./CPATapi.Server.csproj" -c $BUILD_CONFIGURATION -o /app/pub
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
COPY --from=build-userscript ["/src/dist/3CX TAPI.prod.user.js", "./wwwroot/3CX_TAPI.user.js"]
|
||||
ENTRYPOINT ["dotnet", "CPATapi.Server.dll"]
|
||||
|
||||
@@ -2,9 +2,9 @@ namespace CPATapi.Server.Models;
|
||||
|
||||
public class TapiContact
|
||||
{
|
||||
public string TD_ID { get; set; }
|
||||
public string TD_NAME { get; set; }
|
||||
public string TD_NUMBER { get; set; }
|
||||
public string TD_NUMBER_TAPI { get; set; }
|
||||
public string TD_MEDIUM { get; set; }
|
||||
public required string TD_ID { get; set; }
|
||||
public required string TD_NAME { get; set; }
|
||||
public required string TD_NUMBER { get; set; }
|
||||
public required string TD_NUMBER_TAPI { get; set; }
|
||||
public required string TD_MEDIUM { get; set; }
|
||||
}
|
||||
@@ -31,6 +31,7 @@ internal class ZeitConsensRepository(IConfiguration config) : Repository(config)
|
||||
) buLast
|
||||
WHERE
|
||||
ma.MA_USER_AKTIV = 1
|
||||
AND us.US_ACTIVE = 1
|
||||
""";
|
||||
|
||||
public async Task<IEnumerable<Availability>> GetUsersAvailabilityAsync(DateTime from, DateTime to)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace CPATapi.Server.Tests;
|
||||
|
||||
public class RepositoryTestsBase
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
// the type specified here is just so the secrets library can
|
||||
// find the UserSecretId we added in the csproj file
|
||||
var builder = new ConfigurationBuilder().AddUserSecrets<RepositoryTestsBase>();
|
||||
|
||||
Configuration = builder.Build();
|
||||
}
|
||||
|
||||
protected IConfigurationRoot Configuration { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using CPATapi.Server.Repository;
|
||||
|
||||
namespace CPATapi.Server.Tests;
|
||||
|
||||
public class TapiDirectoryRepositoryTests : RepositoryTestsBase
|
||||
{
|
||||
[Test]
|
||||
public async Task TestGetAllAsync()
|
||||
{
|
||||
var tdRepo = new TapiDirectoryRepository(Configuration);
|
||||
var contacts = (await tdRepo.GetAllAsync()).ToList();
|
||||
Assert.That(contacts, Is.Not.Empty);
|
||||
Assert.That(contacts, Has.Count.GreaterThan(1));
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,13 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using CPATapi.Server.Repository;
|
||||
|
||||
namespace CPATapi.Server.Tests;
|
||||
|
||||
public class ZeitConsensRepositoryTest
|
||||
public class ZeitConsensRepositoryTest : RepositoryTestsBase
|
||||
{
|
||||
[OneTimeSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
// the type specified here is just so the secrets library can
|
||||
// find the UserSecretId we added in the csproj file
|
||||
var builder = new ConfigurationBuilder().AddUserSecrets<ZeitConsensRepositoryTest>();
|
||||
|
||||
_configuration = builder.Build();
|
||||
}
|
||||
|
||||
private IConfigurationRoot _configuration { get; set; }
|
||||
|
||||
[Test]
|
||||
public async Task TestGetUsersAvailabilityAsync()
|
||||
{
|
||||
var zcRepo = new ZeitConsensRepository(_configuration);
|
||||
var zcRepo = new ZeitConsensRepository(Configuration);
|
||||
var availability= (await zcRepo.GetUsersAvailabilityAsync(DateTime.Now.Date, DateTime.Now.AddDays(1).Date)).ToList();
|
||||
Assert.That(availability, Is.Not.Empty);
|
||||
Assert.That(availability, Has.Count.GreaterThan(1));
|
||||
@@ -29,7 +16,7 @@ public class ZeitConsensRepositoryTest
|
||||
[Test]
|
||||
public async Task TestGetUserAvailabilityAsync()
|
||||
{
|
||||
var zcRepo = new ZeitConsensRepository(_configuration);
|
||||
var zcRepo = new ZeitConsensRepository(Configuration);
|
||||
var availability = await zcRepo.GetUserAvailabilityAsync("CPATRD", DateTime.Now.Date, DateTime.Now.AddDays(1).Date);
|
||||
Assert.That(availability, Is.Not.Null);
|
||||
Assert.That(availability.MA_USER_NAME, Is.EqualTo("CPATRD"));
|
||||
|
||||
Reference in New Issue
Block a user